aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/include')
-rw-r--r--arch/x86_64/include/arch/memory/paging/active_page_table.hpp12
-rw-r--r--arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp3
2 files changed, 11 insertions, 4 deletions
diff --git a/arch/x86_64/include/arch/memory/paging/active_page_table.hpp b/arch/x86_64/include/arch/memory/paging/active_page_table.hpp
index 5140c3d..0561420 100644
--- a/arch/x86_64/include/arch/memory/paging/active_page_table.hpp
+++ b/arch/x86_64/include/arch/memory/paging/active_page_table.hpp
@@ -27,6 +27,14 @@ namespace teachos::arch::memory::paging
static auto create_or_get() -> active_page_table &;
/**
+ * @brief Index operator overload to access specific mutable entry directy of the level 4 page table.
+ *
+ * @param index Index of the entry we want to access and only read.
+ * @return Entry at the given table index.
+ */
+ auto operator[](std::size_t index) -> entry &;
+
+ /**
* @brief Translates virtual address into corresponding physical address. Calls translate_page under the hood.
*
* @param address Virtual address we want to translate into physical one.
@@ -160,8 +168,6 @@ namespace teachos::arch::memory::paging
tlb_flush(page.start_address());
}
- page_table_handle active_handle; ///< Underlying active level 4 page table
-
private:
/**
* @brief Private constructor should only be used by create or get method, which ensures to create only ever one
@@ -202,6 +208,8 @@ namespace teachos::arch::memory::paging
entry.set_unused();
allocator.deallocate_frame(frame.value());
}
+
+ page_table_handle active_handle; ///< Underlying active level 4 page table
};
} // namespace teachos::arch::memory::paging
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 d7365a0..ede027c 100644
--- a/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp
+++ b/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp
@@ -77,8 +77,7 @@ namespace teachos::arch::memory::paging
auto const backup = allocator::physical_frame::containing_address(PAGE_TABLE_LEVEL_4_ADDRESS);
auto page_table_level4 = temporary_page.map_table_frame(backup, active_table);
- active_table.active_handle[511].set_entry(inactive_table.page_table_level_4_frame,
- entry::PRESENT | entry::WRITABLE);
+ 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);