From 7d1d7c5f63791506049cc188740cc4956fc8d14c Mon Sep 17 00:00:00 2001 From: Fabian Imhof Date: Tue, 22 Oct 2024 05:37:28 +0000 Subject: update comments --- arch/x86_64/src/memory/paging/page_table.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'arch/x86_64/src/memory') diff --git a/arch/x86_64/src/memory/paging/page_table.cpp b/arch/x86_64/src/memory/paging/page_table.cpp index 9c9ca76..939f3b1 100644 --- a/arch/x86_64/src/memory/paging/page_table.cpp +++ b/arch/x86_64/src/memory/paging/page_table.cpp @@ -15,10 +15,11 @@ namespace teachos::arch::memory::paging auto zero_entries() -> void; /** - * @brief Returns the next page table level from the given page table index. Meaning we - * use an index into a Level 4 page table to get the according Level 3 page table. This method should not be called - * on a Level 1 page table, because there is no furthere page table and mangeling up and returning the physical - * address would cause hard to debug issues. + * @brief Returns the next page table level from the given page table index. + * + * Meaning we use an index into a Level 4 page table to get the according Level 3 page table. This method should not + * be called on a Level 1 page table, because there is no furthere page table and mangeling up and returning the + * physical address would cause hard to debug issues. * * @param table_index Index of this page table in the page table one level lower. */ @@ -34,7 +35,9 @@ namespace teachos::arch::memory::paging private: /** - * @brief Calculates the address of the next page table level for the given table index. The next page table address + * @brief Calculates the address of the next page table level for the given table index. + * + * The next page table address * is only valid if the corresponding entry is present and not a huge page. Meaning we use an index into a * Level 4 page table to get the according Level 3 page table address. * @@ -43,8 +46,8 @@ namespace teachos::arch::memory::paging */ auto next_table_address(std::size_t table_index) const -> std::optional; - entry entries[PAGE_TABLE_ENTRY_COUNT]; ///< Entries containing addresses to page tables of a level below or actual - ///< virtual addresses for the level 1 page table. + entry entries[PAGE_TABLE_ENTRY_COUNT]; ///< Entries containing addresses to page tables of a level below or + ///< actual virtual addresses for the level 1 page table. }; auto page_table::zero_entries() -> void @@ -91,7 +94,7 @@ namespace teachos::arch::memory::paging : handle(handle) , handle_level(handle_level) { - exception_handling::assert(handle, "[Page table] Attemptd to pass nullptr as handle to page table handle method"); + exception_handling::assert(handle, "[Page table] Attempted to pass nullptr as handle to page table handle method"); } auto page_table_handle::zero_entries() -> void { handle->zero_entries(); } @@ -113,7 +116,7 @@ namespace teachos::arch::memory::paging auto operator--(page_table_handle::level value, int) -> page_table_handle::level { exception_handling::assert(value != page_table_handle::LEVEL1, - "[Page table] Attemptd to decrement enum to value outside of range"); + "[Page table] Attempted to decrement enum to value outside of range"); auto new_value = static_cast::type>(value); return static_cast(--new_value); } -- cgit v1.2.3