diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2025-10-29 11:53:34 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2025-10-29 11:53:34 +0100 |
| commit | c71d18f32e06fb456bc2829d9dfc5b42b78160b0 (patch) | |
| tree | 337be5371b08a57754503c9cd0fa0eeb57fef5ca | |
| parent | 845a96f5e6bfbbbeba19bf3df07f0e9de53d9a88 (diff) | |
| download | teachos-c71d18f32e06fb456bc2829d9dfc5b42b78160b0.tar.xz teachos-c71d18f32e06fb456bc2829d9dfc5b42b78160b0.zip | |
x86_64: reduce using namespace use
| -rw-r--r-- | arch/x86_64/src/kapi/memory.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/arch/x86_64/src/kapi/memory.cpp b/arch/x86_64/src/kapi/memory.cpp index be47941..46686b6 100644 --- a/arch/x86_64/src/kapi/memory.cpp +++ b/arch/x86_64/src/kapi/memory.cpp @@ -6,6 +6,7 @@ #include "x86_64/boot/boot.hpp" #include "x86_64/boot/ld.hpp" +#include "x86_64/cpu/registers.hpp" #include "x86_64/memory/region_allocator.hpp" #include <multiboot2/information.hpp> @@ -14,9 +15,6 @@ namespace teachos::memory { - using namespace boot::x86_64; - using namespace memory::x86_64; - std::size_t const PLATFORM_FRAME_SIZE{4096}; namespace @@ -24,12 +22,13 @@ namespace teachos::memory auto constinit is_initialized = std::atomic_flag{}; auto constinit allocator = static_cast<frame_allocator *>(nullptr); - auto create_memory_information() -> region_allocator::memory_information + auto create_memory_information() -> x86_64::region_allocator::memory_information { - auto const & mbi = multiboot_information_pointer.get(); + auto const & mbi = boot::x86_64::multiboot_information_pointer.get(); auto map = mbi->memory_map(); - return {std::make_pair(physical_address{&_start_physical}, physical_address{&_end_physical}), + return {std::make_pair(physical_address{&boot::x86_64::_start_physical}, + physical_address{&boot::x86_64::_end_physical}), std::make_pair(physical_address{std::bit_cast<std::byte *>(&mbi)}, physical_address{std::bit_cast<std::byte *>(&mbi) + mbi->size_bytes()}), map}; @@ -53,19 +52,20 @@ namespace teachos::memory system::panic("[x86_64] Memory management has already been initialized."); } - auto memory_map = multiboot_information_pointer->maybe_memory_map(); + auto memory_map = boot::x86_64::multiboot_information_pointer->maybe_memory_map(); if (!memory_map) { system::panic("[x86_64] No memory map available."); } auto mem_info = create_memory_information(); - auto allocator = region_allocator{mem_info}; + auto allocator = x86_64::region_allocator{mem_info}; static_cast<void>(allocator); - // kernel::cpu::set_cr0_bit(kernel::cpu::cr0_flags::WRITE_PROTECT); - // kernel::cpu::set_efer_bit(kernel::cpu::efer_flags::NXE); + cpu::x86_64::set_cr0_bit(cpu::x86_64::cr0_flags::WRITE_PROTECT); + + // set_efer_bit(efer_flags::NXE); // paging::kernel_mapper kernel(allocator, memory_information); // kernel.remap_kernel(); |
