aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/memory/paging
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2024-10-20 12:35:39 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2024-10-20 12:35:39 +0000
commitdd5dab7fd34c6745a16ac572ecd099e4bc26c1fb (patch)
tree576b33c1030c4af1a14e0e51b463247e445b62be /arch/x86_64/src/memory/paging
parent8e9a924f9fba18de9a5e37b1baf1d97e9b008251 (diff)
downloadteachos-dd5dab7fd34c6745a16ac572ecd099e4bc26c1fb.tar.xz
teachos-dd5dab7fd34c6745a16ac572ecd099e4bc26c1fb.zip
Fix set_entry flags usage
Diffstat (limited to 'arch/x86_64/src/memory/paging')
-rw-r--r--arch/x86_64/src/memory/paging/page_entry.cpp2
-rw-r--r--arch/x86_64/src/memory/paging/page_mapper.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86_64/src/memory/paging/page_entry.cpp b/arch/x86_64/src/memory/paging/page_entry.cpp
index 8a7442e..a172ca8 100644
--- a/arch/x86_64/src/memory/paging/page_entry.cpp
+++ b/arch/x86_64/src/memory/paging/page_entry.cpp
@@ -37,6 +37,6 @@ namespace teachos::arch::memory::paging
{
exception_handling::assert((frame.start_address() & ~0x000fffff'fffff000) == 0,
"[Paging Entry] Start address is not aligned with page");
- flags = std::bitset<64U>(frame.start_address()) | flags;
+ flags = std::bitset<64U>{frame.start_address()} | flags;
}
} // namespace teachos::arch::memory::paging
diff --git a/arch/x86_64/src/memory/paging/page_mapper.cpp b/arch/x86_64/src/memory/paging/page_mapper.cpp
index 1912174..0874230 100644
--- a/arch/x86_64/src/memory/paging/page_mapper.cpp
+++ b/arch/x86_64/src/memory/paging/page_mapper.cpp
@@ -78,7 +78,7 @@ namespace teachos::arch::memory::paging
}
auto map_page_to_frame(allocator::area_frame_allocator & allocator, virtual_page page,
- allocator::physical_frame frame, entry::bitset flags) -> void
+ allocator::physical_frame frame, std::bitset<64U> flags) -> void
{
page_table page_table{};
bool table_exists = false;
@@ -101,6 +101,6 @@ 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 | entry::PRESENT);
+ level1_entry.set_entry(frame, flags | std::bitset<64U>{entry::PRESENT});
}
-} // namespace teachos::arch::memory::paging \ No newline at end of file
+} // namespace teachos::arch::memory::paging