diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-11-03 11:56:46 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-11-03 11:56:46 +0000 |
| commit | be546b091795e740e9dd4c35fce6453fafe0319c (patch) | |
| tree | 1d8c7bfc93f91e80534e9f0fb96d32c6fda69194 /arch/x86_64/include | |
| parent | 9292814545ab5df5aa69d4f75a6d9230f3e03f5b (diff) | |
| download | teachos-be546b091795e740e9dd4c35fce6453fafe0319c.tar.xz teachos-be546b091795e740e9dd4c35fce6453fafe0319c.zip | |
Make member variables private again.
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 | 3 |
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); |
