X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Facess.h;h=394f9f1ed7c423e4e79c7eaa80153d37cdb4a70b;hb=eecce4b7a55315f6c385ad8be35c25dbb12d43d8;hp=8e62578afafd521e256dce6d615ed9162c99a154;hpb=85eb17b306404571aa39596946c87ad9bb1d9d13;p=tpg%2Facess2.git diff --git a/Kernel/include/acess.h b/Kernel/include/acess.h index 8e62578a..394f9f1e 100644 --- a/Kernel/include/acess.h +++ b/Kernel/include/acess.h @@ -8,7 +8,7 @@ #define NULL ((void*)0) #define PACKED __attribute__ ((packed)) -#include +//#include #include #include #include "errno.h" @@ -192,12 +192,6 @@ extern int MM_Map(tVAddr VAddr, tPAddr PAddr); * \return Physical page mapped at \a Addr */ extern tPAddr MM_GetPhysAddr(tVAddr Addr); -/** - * \brief Checks is a memory range is user accessable - * \param VAddr Base address to check - * \return 1 if the memory is all user-accessable, 0 otherwise - */ -extern int MM_IsUser(tVAddr VAddr); /** * \brief Set the access flags on a page * \param VAddr Virtual address of the page @@ -205,6 +199,18 @@ extern int MM_IsUser(tVAddr VAddr); * \param Mask Flags to set */ extern void MM_SetFlags(tVAddr VAddr, Uint Flags, Uint Mask); +/** + * \brief Get the flags on a flag + * \param VAddr Virtual address of page + * \return Flags value of the page + */ +extern Uint MM_GetFlags(tVAddr VAddr); +/** + * \brief Checks is a memory range is user accessable + * \param VAddr Base address to check + * \return 1 if the memory is all user-accessable, 0 otherwise + */ +#define MM_IsUser(VAddr) (!(MM_GetFlags((VAddr))&MM_PFLAG_KERNEL)) /** * \brief Temporarily map a page into the address space * \param PAddr Physical addres to map