summaryrefslogtreecommitdiff
path: root/kernel/includes/mmu.h
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-04-11 17:22:00 +0200
committerAnton Kling <anton@kling.gg>2024-04-11 17:23:39 +0200
commitca082f686fd2dc7ee6f0284421f6212d6d4acee8 (patch)
tree493b1047661174816f0d1d300952e40e2846b24b /kernel/includes/mmu.h
parente25a47fcc4db09ab9b845a691297da67243e6049 (diff)
bug fixes
Diffstat (limited to 'kernel/includes/mmu.h')
-rw-r--r--kernel/includes/mmu.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/includes/mmu.h b/kernel/includes/mmu.h
index 9a27c5b..43814d5 100644
--- a/kernel/includes/mmu.h
+++ b/kernel/includes/mmu.h
@@ -9,8 +9,11 @@ typedef u8 mmu_flags;
#define MMU_FLAG_RW (1 << 0)
#define MMU_FLAG_KERNEL (1 << 1)
-void *next_page(void *a);
-void *align_page(void *a);
+#define PAGE_SIZE ((uintptr_t)0x1000)
+#define next_page(_ptr) \
+ ((_ptr) + (PAGE_SIZE - (((uintptr_t)_ptr) & (PAGE_SIZE - 1))))
+#define align_page(_ptr) \
+ (((((uintptr_t)_ptr) & (PAGE_SIZE - 1)) > 0) ? next_page((_ptr)) : (_ptr))
typedef struct Page {
u32 present : 1;