aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2024-11-04 13:55:22 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2024-11-04 13:55:22 +0000
commitc887e22cd7827ae53fd3eab6f5af41969cdd616c (patch)
treea53f5ff4ec81048d1d8b5f0e58ba446c48683ba6
parent30466aeb3da181c21bd451f32c1ff97e53a55dbc (diff)
downloadteachos-c887e22cd7827ae53fd3eab6f5af41969cdd616c.tar.xz
teachos-c887e22cd7827ae53fd3eab6f5af41969cdd616c.zip
Use auto where possible
-rw-r--r--arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp2
-rw-r--r--arch/x86_64/src/memory/paging/page_table.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp b/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp
index 2eb3c4a..05a1cf2 100644
--- a/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp
+++ b/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp
@@ -80,6 +80,8 @@ namespace teachos::arch::memory::paging
auto const backup = allocator::physical_frame::containing_address(physical_address.value());
auto page_table_level4 = temporary_page.map_table_frame(backup, active_table);
+ // TODO: Page Table Level 4 is invalid, all entries point to non-existent memory :(
+
active_table[511].set_entry(inactive_table.page_table_level_4_frame, entry::PRESENT | entry::WRITABLE);
tlb_flush_all();
map_elf_kernel_sections(active_table);
diff --git a/arch/x86_64/src/memory/paging/page_table.cpp b/arch/x86_64/src/memory/paging/page_table.cpp
index 3c9942a..a39c235 100644
--- a/arch/x86_64/src/memory/paging/page_table.cpp
+++ b/arch/x86_64/src/memory/paging/page_table.cpp
@@ -46,7 +46,7 @@ namespace teachos::arch::memory::paging
auto page_table::zero_entries() -> void
{
- std::ranges::for_each(entries, [](entry & entry) { entry.set_unused(); });
+ std::ranges::for_each(entries, [](auto & entry) { entry.set_unused(); });
}
auto page_table::is_empty() const -> bool