diff options
Diffstat (limited to 'arch/x86_64/src/memory/scoped_mapping.cpp')
| -rw-r--r-- | arch/x86_64/src/memory/scoped_mapping.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/x86_64/src/memory/scoped_mapping.cpp b/arch/x86_64/src/memory/scoped_mapping.cpp index 945183d..dde1dda 100644 --- a/arch/x86_64/src/memory/scoped_mapping.cpp +++ b/arch/x86_64/src/memory/scoped_mapping.cpp @@ -1,32 +1,32 @@ -#include "x86_64/memory/scoped_mapping.hpp" +#include "arch/memory/scoped_mapping.hpp" #include "kapi/memory.hpp" #include "kapi/system.hpp" -#include "x86_64/memory/mmu.hpp" -#include "x86_64/memory/page_table.hpp" -#include "x86_64/memory/paging_root.hpp" +#include "arch/memory/mmu.hpp" +#include "arch/memory/page_table.hpp" +#include "arch/memory/paging_root.hpp" #include <cstddef> #include <utility> -namespace teachos::memory::x86_64 +namespace arch::memory { scoped_mapping::scoped_mapping(scoped_mapping && other) noexcept - : m_page{std::exchange(other.m_page, page{})} + : m_page{std::exchange(other.m_page, kapi::memory::page{})} , m_mapper{std::exchange(other.m_mapper, nullptr)} , m_mapped{std::exchange(other.m_mapped, false)} {} - scoped_mapping::scoped_mapping(page page, page_mapper & mapper) + scoped_mapping::scoped_mapping(kapi::memory::page page, kapi::memory::page_mapper & mapper) : m_page{page} , m_mapper{&mapper} , m_mapped{false} { if (paging_root::get()->translate(page)) { - system::panic("[MEM] Tried to map a page that is already mapped!"); + kapi::system::panic("[MEM] Tried to map a page that is already mapped!"); } } @@ -35,7 +35,7 @@ namespace teachos::memory::x86_64 if (m_mapped) { unmap(); - x86_64::tlb_flush(m_page.start_address()); + tlb_flush(m_page.start_address()); } } @@ -45,7 +45,7 @@ namespace teachos::memory::x86_64 return *this; } - auto scoped_mapping::map(frame frame, page_table::entry::flags flags) -> std::byte * + auto scoped_mapping::map(kapi::memory::frame frame, page_table::entry::flags flags) -> std::byte * { auto result = m_mapper->map(m_page, frame, to_mapper_flags(flags)); m_mapped = true; @@ -66,4 +66,4 @@ namespace teachos::memory::x86_64 swap(lhs.m_mapped, rhs.m_mapped); } -} // namespace teachos::memory::x86_64
\ No newline at end of file +} // namespace arch::memory
\ No newline at end of file |
