diff options
Diffstat (limited to 'src/kernel/mem.c')
-rw-r--r-- | src/kernel/mem.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/kernel/mem.c b/src/kernel/mem.c index 1fce506..5684bb7 100644 --- a/src/kernel/mem.c +++ b/src/kernel/mem.c @@ -7,13 +7,12 @@ static void *highest_page; void mem_init(struct kmain_info *info) { // finds the highest used page, and starts allocating pages above it void *highest = &_bss_end; - size_t page_mask = PAGE_SIZE - 1; if (highest < info->init.at + info->init.size) highest = info->init.at + info->init.size; // align up to PAGE_SIZE - highest_page = (void*)(((uintptr_t)highest + page_mask) & ~page_mask); + highest_page = (void*)(((uintptr_t)highest + PAGE_MASK) & ~PAGE_MASK); } void *page_alloc(size_t pages) { |