diff options
Diffstat (limited to 'kapi')
| -rw-r--r-- | kapi/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | kapi/include/kapi/memory/layout.hpp | 20 |
2 files changed, 17 insertions, 9 deletions
diff --git a/kapi/CMakeLists.txt b/kapi/CMakeLists.txt index 028cdbb..b239adb 100644 --- a/kapi/CMakeLists.txt +++ b/kapi/CMakeLists.txt @@ -29,9 +29,3 @@ target_link_libraries("kapi" INTERFACE "gcc" "stdc++" ) - -target_compile_definitions("kapi" INTERFACE - "PLATFORM_PAGE_SIZE=${TEACHOS_PLATFORM_PAGE_SIZE}uz" - "PLATFORM_PAGING_LEVELS=${TEACHOS_PLATFORM_PAGING_LEVELS}uz" - "PLATFORM_FRAME_SIZE=${TEACHOS_PLATFORM_FRAME_SIZE}uz" -) diff --git a/kapi/include/kapi/memory/layout.hpp b/kapi/include/kapi/memory/layout.hpp index f5ba0f9..d4153d8 100644 --- a/kapi/include/kapi/memory/layout.hpp +++ b/kapi/include/kapi/memory/layout.hpp @@ -8,17 +8,31 @@ namespace kapi::memory { - constexpr auto page_size = PLATFORM_PAGE_SIZE; - constexpr auto frame_size = PLATFORM_FRAME_SIZE; - + //! The size of a single page of virtual memory. + //! + //! Platforms that use different sizes of pages are expected to emulate 4 KiB pages towards the kernel. + constexpr auto page_size = 4096uz; + + //! The size of a single frame of physical memory. + //! + //! Platforms that use different sizes of frames are expected to emulate 4 KiB pages towards the kernel. + constexpr auto frame_size = 4096uz; + + //! The linear base address of the higher-half direct map. + //! + //! Platforms are expected to provide a mapping of at least the first 512 GiB of available memory at this address. constexpr auto higher_half_direct_map_base = linear_address{0xffff'8000'0000'0000uz}; + //! The linear base address of the kernel heap. constexpr auto heap_base = linear_address{0xffff'c000'0000'0000uz}; + //! The linear base address of the memory region reserved for the metadata required by the PMM. constexpr auto pmm_metadata_base = linear_address{0xffff'd000'0000'0000uz}; + //! The linear base address of all Memory Mapped I/O mappings. constexpr auto mmio_base = linear_address{0xffff'e000'0000'0000uz}; + //! The linear base address of the loaded kernel image. constexpr auto kernel_base = linear_address{0xffff'ffff'8000'0000uz}; } // namespace kapi::memory |
