From 3194b460ccf58b33ea839cf8700d92aa2b7a91f6 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Sat, 23 May 2020 12:33:28 -0700 Subject: [PATCH] [memory] Update kernel_memory to current layout The `kernel_offset` and `page_offset` had already been updated with previous bootloader changes, but `kernel_max_heap` had not. Also, make all the constants `constexpr` instead of `static const` that would live in multiple TUs. --- src/include/kernel_memory.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/include/kernel_memory.h b/src/include/kernel_memory.h index cef2be8..d449ce6 100644 --- a/src/include/kernel_memory.h +++ b/src/include/kernel_memory.h @@ -8,25 +8,25 @@ namespace memory { /// Size of a single page frame. - static const size_t frame_size = 0x1000; + constexpr size_t frame_size = 0x1000; /// Start of kernel memory. - static const uintptr_t kernel_offset = 0xffff800000000000; + constexpr uintptr_t kernel_offset = 0xffff800000000000; /// Offset from physical where page tables are mapped. - static const uintptr_t page_offset = 0xffffc00000000000; + constexpr uintptr_t page_offset = 0xffffc00000000000; /// Initial process thread's stack address - static const uintptr_t initial_stack = 0x0000800000000000; + constexpr uintptr_t initial_stack = 0x0000800000000000; /// Initial process thread's stack size, in pages - static const unsigned initial_stack_pages = 1; + constexpr unsigned initial_stack_pages = 1; /// Max size of the kernel heap - static const size_t kernel_max_heap = 0x800000000; // 32GiB + constexpr size_t kernel_max_heap = 0x8000000000; // 512GiB /// Start of the kernel heap - static const uintptr_t heap_start = page_offset - kernel_max_heap; + constexpr uintptr_t heap_start = page_offset - kernel_max_heap; /// Helper to determine if a physical address can be accessed /// through the page_offset area.