diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-03-18 15:24:26 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-03-18 15:24:26 +0100 |
| commit | 12c0586ee15cadfa178e6982dc0f76b047cb2df9 (patch) | |
| tree | 7ef0e4dda9960baa93cb572af04f137cd2cebc81 /kapi/include | |
| parent | d25a933ee9df6bc34e806f71b86afb68c391a177 (diff) | |
| download | teachos-12c0586ee15cadfa178e6982dc0f76b047cb2df9.tar.xz teachos-12c0586ee15cadfa178e6982dc0f76b047cb2df9.zip | |
kapi/memory: remove page/frame size macros
Diffstat (limited to 'kapi/include')
| -rw-r--r-- | kapi/include/kapi/memory/layout.hpp | 20 |
1 files changed, 17 insertions, 3 deletions
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 |
