diff options
Diffstat (limited to 'arch/x86_64/include')
| -rw-r--r-- | arch/x86_64/include/arch/memory/paging/active_page_table.hpp | 12 | ||||
| -rw-r--r-- | arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp | 4 |
2 files changed, 11 insertions, 5 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 84f0471..f06c4e2 100644 --- a/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp +++ b/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp @@ -83,9 +83,7 @@ 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); - 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); |
