From b38ce5e24222ec97b45e1f87da4a392859947064 Mon Sep 17 00:00:00 2001 From: Fabian Imhof Date: Fri, 1 Nov 2024 13:16:13 +0000 Subject: add doxygen comments --- .../include/arch/memory/allocator/concept.hpp | 5 ++++ .../include/arch/memory/paging/temporary_page.hpp | 30 ++++++++++++---------- 2 files changed, 21 insertions(+), 14 deletions(-) (limited to 'arch/x86_64/include') diff --git a/arch/x86_64/include/arch/memory/allocator/concept.hpp b/arch/x86_64/include/arch/memory/allocator/concept.hpp index 0aa45c6..4a7ab72 100644 --- a/arch/x86_64/include/arch/memory/allocator/concept.hpp +++ b/arch/x86_64/include/arch/memory/allocator/concept.hpp @@ -7,6 +7,11 @@ namespace teachos::arch::memory::allocator { + /** + * @brief Frame allocator concept + * + * @tparam T + */ template concept FrameAllocator = requires(T t, physical_frame a) { { t.allocate_frame() } -> std::same_as>; diff --git a/arch/x86_64/include/arch/memory/paging/temporary_page.hpp b/arch/x86_64/include/arch/memory/paging/temporary_page.hpp index 0293dd9..c42745a 100644 --- a/arch/x86_64/include/arch/memory/paging/temporary_page.hpp +++ b/arch/x86_64/include/arch/memory/paging/temporary_page.hpp @@ -10,17 +10,16 @@ namespace teachos::arch::memory::paging { /** - * @brief - * + * @brief A temporary page used to remap the kernel. */ struct temporary_page { /** * @brief Construct a new temporary page object * - * @tparam T - * @param page - * @param allocator + * @tparam FrameAllocator concept + * @param page Page to turn into temporary page + * @param allocator Frame allocator used to fill page */ template temporary_page(virtual_page page, T & allocator) @@ -31,32 +30,35 @@ namespace teachos::arch::memory::paging } /** - * @brief + * @brief Set all page table entries to unused. * - * @param frame + * @param active_table the page table whose values are set to unused. */ auto zero_entries(active_page_table & active_table) -> void; private: /** - * @brief + * @brief Map the temporary page to a frame. * - * @param frame - * @return virtual_address + * @param frame The frame to which the page is mapped. + * @param active_table The current active page table. + * @return The virtual address of the page. */ auto map_to_frame(allocator::physical_frame frame, active_page_table & active_table) -> virtual_address; /** - * @brief + * @brief Unmap the current page. * + * @param active_table The current active page table. */ auto unmap(active_page_table & active_table) -> void; /** - * @brief + * @brief Map the temporary page to a frame. * - * @param frame - * @return page_table_handle + * @param frame The frame to which the page is mapped. + * @param active_table The current active page table. + * @return level1 page table handle containing the mapped page. */ auto map_table_frame(allocator::physical_frame frame, active_page_table & active_table) -> page_table_handle; -- cgit v1.2.3