aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/include
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2024-10-28 12:29:39 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2024-10-28 12:29:39 +0000
commit58680f7d84ca5771be31c0037e8caf5791d79b3c (patch)
treed915d1def0dfc6a0754be3e962a596df1dcdc39b /arch/x86_64/include
parent04b0285d8329e45cea426aa1a8e69203685a4467 (diff)
downloadteachos-58680f7d84ca5771be31c0037e8caf5791d79b3c.tar.xz
teachos-58680f7d84ca5771be31c0037e8caf5791d79b3c.zip
Fix invalid assertion
Diffstat (limited to 'arch/x86_64/include')
-rw-r--r--arch/x86_64/include/arch/memory/paging/page_mapper.hpp2
-rw-r--r--arch/x86_64/include/arch/memory/paging/page_table.hpp1
2 files changed, 1 insertions, 2 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 5b74bd2..c07c73c 100644
--- a/arch/x86_64/include/arch/memory/paging/page_mapper.hpp
+++ b/arch/x86_64/include/arch/memory/paging/page_mapper.hpp
@@ -82,7 +82,7 @@ namespace teachos::arch::memory::paging
auto level1_entry = current_handle[page.get_level_index(page_table_handle::LEVEL1)];
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");
+ 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});
}
diff --git a/arch/x86_64/include/arch/memory/paging/page_table.hpp b/arch/x86_64/include/arch/memory/paging/page_table.hpp
index 8fcde9f..765e9bb 100644
--- a/arch/x86_64/include/arch/memory/paging/page_table.hpp
+++ b/arch/x86_64/include/arch/memory/paging/page_table.hpp
@@ -91,7 +91,6 @@ namespace teachos::arch::memory::paging
// There should now be an entry at the previously not existent index, therefore we can simply access it again.
next_handle = next_table(table_index);
exception_handling::assert(next_handle.has_value(), "[Page mapper] Unable to create new entry into page table");
- // TODO: Crashes when trying to access underlying entries array.
next_handle.value().zero_entries();
}
return next_handle.value();