aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86_64/kapi/memory.cpp4
-rw-r--r--arch/x86_64/src/memory/kernel_mapper.cpp2
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};