From c8a81b1101b83c3d835ed70e5b157ac0b69438c4 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 18 Oct 2022 21:53:38 -0400 Subject: [PATCH] Add PAGE_SIZE constant --- src/hulk/hippo.d | 5 ++++- src/hulk/hurl.d | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hulk/hippo.d b/src/hulk/hippo.d index 4042c75..a63c26f 100644 --- a/src/hulk/hippo.d +++ b/src/hulk/hippo.d @@ -8,6 +8,9 @@ import hulk.bootinfo; import hulk.klog; import hulk.linker_addresses; +/** Page size. */ +enum size_t PAGE_SIZE = 4096u; + struct hippo { /** @@ -80,7 +83,7 @@ struct hippo { free_page(phys); } - phys += 4096u; + phys += PAGE_SIZE; } } } diff --git a/src/hulk/hurl.d b/src/hulk/hurl.d index 6275191..1988444 100644 --- a/src/hulk/hurl.d +++ b/src/hulk/hurl.d @@ -112,7 +112,7 @@ struct hurl else { PageTable * next_pt = cast(PageTable *)hippo.allocate_page(); - memset32(next_pt, 0, 4096u / 4u); + memset64(next_pt, 0u, PAGE_SIZE / 8u); (*pt)[virtual, level] = PageTableEntry(next_pt, MAP_WRITABLE | MAP_PRESENT); pt = next_pt; }