From efcb913196ccf0386a557e8c1053c430e5896179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matteo=20Gm=C3=BCr?= Date: Mon, 28 Oct 2024 12:45:46 +0000 Subject: Convert bitset to uint64_t instead of uint64_t to bitset --- arch/x86_64/include/arch/memory/paging/page_mapper.hpp | 2 +- arch/x86_64/src/memory/paging/page_entry.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86_64/include/arch/memory/paging/page_mapper.hpp b/arch/x86_64/include/arch/memory/paging/page_mapper.hpp index c07c73c..e08f195 100644 --- a/arch/x86_64/include/arch/memory/paging/page_mapper.hpp +++ b/arch/x86_64/include/arch/memory/paging/page_mapper.hpp @@ -83,7 +83,7 @@ namespace teachos::arch::memory::paging arch::exception_handling::assert(!level1_entry.contains_flags(entry::HUGE_PAGE), "[Page Mapper] Unable to map huge pages"); arch::exception_handling::assert(level1_entry.is_unused(), "[Page Mapper] Page table entry is already used"); - level1_entry.set_entry(frame, flags | std::bitset<64U>{entry::PRESENT}); + level1_entry.set_entry(frame, flags.to_ulong() | entry::PRESENT); } /** diff --git a/arch/x86_64/src/memory/paging/page_entry.cpp b/arch/x86_64/src/memory/paging/page_entry.cpp index c3e9614..dbf23e2 100644 --- a/arch/x86_64/src/memory/paging/page_entry.cpp +++ b/arch/x86_64/src/memory/paging/page_entry.cpp @@ -23,7 +23,7 @@ namespace teachos::arch::memory::paging { if (contains_flags(PRESENT)) { - return allocator::physical_frame::containing_address(flags.to_ullong() & PHYSICAL_ADDRESS_MASK); + return allocator::physical_frame::containing_address(flags.to_ulong() & PHYSICAL_ADDRESS_MASK); } return std::nullopt; } @@ -34,6 +34,6 @@ namespace teachos::arch::memory::paging { exception_handling::assert((frame.start_address() & ~PHYSICAL_ADDRESS_MASK) == 0, "[Paging Entry] Start address is not aligned with page"); - flags = std::bitset<64U>{frame.start_address()} | additional_flags; + flags = frame.start_address() | additional_flags.to_ulong(); } } // namespace teachos::arch::memory::paging -- cgit v1.2.3