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 /arch | |
| parent | d25a933ee9df6bc34e806f71b86afb68c391a177 (diff) | |
| download | teachos-12c0586ee15cadfa178e6982dc0f76b047cb2df9.tar.xz teachos-12c0586ee15cadfa178e6982dc0f76b047cb2df9.zip | |
kapi/memory: remove page/frame size macros
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x86_64/kapi/memory.cpp | 4 | ||||
| -rw-r--r-- | arch/x86_64/src/memory/kernel_mapper.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86_64/kapi/memory.cpp b/arch/x86_64/kapi/memory.cpp index 547d359..07e7465 100644 --- a/arch/x86_64/kapi/memory.cpp +++ b/arch/x86_64/kapi/memory.cpp @@ -110,7 +110,7 @@ namespace kapi::memory auto mbi_size = boot::bootstrap_information.mbi->size_bytes(); auto mbi_physical_start = physical_address{mbi_base & ~std::bit_cast<std::uintptr_t>(&arch::boot::TEACHOS_VMA)}; auto mbi_virtual_start = linear_address{mbi_base}; - auto mbi_block_count = (mbi_size + PLATFORM_FRAME_SIZE - 1) / PLATFORM_FRAME_SIZE; + auto mbi_block_count = (mbi_size + frame::size - 1) / frame::size; for (auto i = 0uz; i < mbi_block_count; ++i) { @@ -127,7 +127,7 @@ namespace kapi::memory auto module_virtual_start = linear_address{module.start_address + std::bit_cast<std::uintptr_t>(&arch::boot::TEACHOS_VMA)}; auto module_size = module.end_address - module.start_address; - auto module_block_count = (module_size + PLATFORM_FRAME_SIZE - 1) / PLATFORM_FRAME_SIZE; + auto module_block_count = (module_size + frame::size - 1) / frame::size; for (auto i = 0uz; i < module_block_count; ++i) { diff --git a/arch/x86_64/src/memory/kernel_mapper.cpp b/arch/x86_64/src/memory/kernel_mapper.cpp index 08c32c5..e5bb7f8 100644 --- a/arch/x86_64/src/memory/kernel_mapper.cpp +++ b/arch/x86_64/src/memory/kernel_mapper.cpp @@ -71,7 +71,7 @@ namespace arch::memory auto kernel_mapper::map_section(section_header_type const & section, std::string_view name, kapi::memory::page_mapper & mapper) -> void { - auto number_of_pages = (section.size + (PLATFORM_PAGE_SIZE - 1)) / PLATFORM_PAGE_SIZE; + auto number_of_pages = (section.size + (kapi::memory::page::size - 1)) / kapi::memory::page::size; auto linear_start_address = kapi::memory::linear_address{section.virtual_load_address}; auto physical_start_address = kapi::memory::physical_address{section.virtual_load_address & ~m_kernel_load_base}; |
