diff options
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x86_64/CMakeLists.txt | 7 | ||||
| -rw-r--r-- | arch/x86_64/src/kapi/memory.cpp | 2 | ||||
| -rw-r--r-- | arch/x86_64/src/memory/paging_root.cpp | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86_64/CMakeLists.txt b/arch/x86_64/CMakeLists.txt index 9afbce3..4d984cf 100644 --- a/arch/x86_64/CMakeLists.txt +++ b/arch/x86_64/CMakeLists.txt @@ -41,7 +41,12 @@ target_sources("x86_64" PRIVATE FILES ${ARCH_HEADERS} ) +target_compile_definitions("x86_64" PUBLIC + "PLATFORM_PAGE_SIZE=4096" + "PLATFORM_FRAME_SIZE=PLATFORM_PAGE_SIZE" +) + set(KERNEL_LINKER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/kernel.ld" PARENT_SCOPE -)
\ No newline at end of file +) diff --git a/arch/x86_64/src/kapi/memory.cpp b/arch/x86_64/src/kapi/memory.cpp index 36b1706..1a8b36f 100644 --- a/arch/x86_64/src/kapi/memory.cpp +++ b/arch/x86_64/src/kapi/memory.cpp @@ -19,8 +19,6 @@ namespace teachos::memory { - std::size_t const PLATFORM_FRAME_SIZE{4096}; - std::size_t const PLATFORM_PAGE_SIZE{PLATFORM_FRAME_SIZE}; namespace { diff --git a/arch/x86_64/src/memory/paging_root.cpp b/arch/x86_64/src/memory/paging_root.cpp index a29304e..6b8e1ab 100644 --- a/arch/x86_64/src/memory/paging_root.cpp +++ b/arch/x86_64/src/memory/paging_root.cpp @@ -23,7 +23,7 @@ namespace teachos::memory::x86_64 auto paging_root::translate(linear_address address) const -> std::optional<physical_address> { - auto offset = address.raw() % PLATFORM_PAGE_SIZE; + auto offset = address.raw() % page::size; return translate(page::containing(address)).transform([offset](auto frame) -> auto { return physical_address{frame.start_address().raw() + offset}; }); |
