aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/include/sys.h
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2015-03-09 13:35:45 +0100
committerAlex Auvolat <alex@adnab.me>2015-03-09 13:35:45 +0100
commita9a2ea9125f89347e0aa038a136ebd43e6b251b4 (patch)
treea2ef4b04803a6ce9689d472f7ee26ed477a376a0 /src/kernel/include/sys.h
parent8c1f280c1bc948a20e244b32d824780b08bf85c9 (diff)
downloadkogata-a9a2ea9125f89347e0aa038a136ebd43e6b251b4.tar.gz
kogata-a9a2ea9125f89347e0aa038a136ebd43e6b251b4.zip
Add pager interface ; implement basic functionnality to replace private maps.
Diffstat (limited to 'src/kernel/include/sys.h')
-rw-r--r--src/kernel/include/sys.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/kernel/include/sys.h b/src/kernel/include/sys.h
index 944df96..61bfc59 100644
--- a/src/kernel/include/sys.h
+++ b/src/kernel/include/sys.h
@@ -75,9 +75,10 @@ static inline void invlpg(void* addr) {
#define PAGE_SIZE 0x1000
#define PAGE_MASK 0xFFFFF000
-#define PAGE_ALIGN_DOWN(x) (((size_t)x) & PAGE_MASK)
-#define PAGE_ALIGN_UP(x) ((((size_t)x)&(~PAGE_MASK)) == 0 ? ((size_t)x) : (((size_t)x) & PAGE_MASK) + PAGE_SIZE)
-#define PAGE_ID(x) (((size_t)x) / PAGE_SIZE)
+#define PAGE_ALIGNED(x) ((((size_t)(x)) & (~PAGE_MASK)) == 0)
+#define PAGE_ALIGN_DOWN(x) (((size_t)(x)) & PAGE_MASK)
+#define PAGE_ALIGN_UP(x) ((((size_t)(x))&(~PAGE_MASK)) == 0 ? ((size_t)x) : (((size_t)x) & PAGE_MASK) + PAGE_SIZE)
+#define PAGE_ID(x) (((size_t)(x)) / PAGE_SIZE)
#define PAGE_SHIFT 12
#define PT_SHIFT 10
// PAGE_SHIFT + PT_SHIFT + PT_SHIFT = 32