From aa0634589cb7d51f57e3e555bb15ebca99bc162e Mon Sep 17 00:00:00 2001 From: Fabian Imhof Date: Sun, 20 Oct 2024 12:17:58 +0000 Subject: document page mapping and entry --- arch/x86_64/include/arch/memory/paging/page_entry.hpp | 3 ++- arch/x86_64/include/arch/memory/paging/page_mapper.hpp | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'arch/x86_64/include') diff --git a/arch/x86_64/include/arch/memory/paging/page_entry.hpp b/arch/x86_64/include/arch/memory/paging/page_entry.hpp index 109735d..2d97d77 100644 --- a/arch/x86_64/include/arch/memory/paging/page_entry.hpp +++ b/arch/x86_64/include/arch/memory/paging/page_entry.hpp @@ -59,8 +59,9 @@ namespace teachos::arch::memory::paging * calculate_physical_address() will return the new address instead of the old one. * * @param frame Physical frame that contains the address we want to copy into our underlying std::bitset. + * @param flags Entry flags which will be set on the entry */ - auto set_entry(allocator::physical_frame frame, std::bitset<64U> additional_flags) -> void; + auto set_entry(allocator::physical_frame frame, std::bitset<64U> flags) -> void; /** * @brief Checks if the given std::bitset is a subset or equivalent to the underlying std::bitset, meaning that all diff --git a/arch/x86_64/include/arch/memory/paging/page_mapper.hpp b/arch/x86_64/include/arch/memory/paging/page_mapper.hpp index c82b08c..069161f 100644 --- a/arch/x86_64/include/arch/memory/paging/page_mapper.hpp +++ b/arch/x86_64/include/arch/memory/paging/page_mapper.hpp @@ -34,13 +34,15 @@ namespace teachos::arch::memory::paging auto translate_address(std::size_t virtual_address) -> std::optional; /** - * @brief TODO + * @brief Maps a virtual page to a physical frame in the page table with the specified flags. * - * @param allocator - * @param page - * @param frame - * @param flags + * @param allocator Reference to the area frame allocator, which is used to allocate frames when a new page table is + * required. + * @param page Reference to the virtual page that is being mapped. + * @param frame The physical frame that the virtual page will be mapped to. + * @param flags A bitset of flags that configure the page table entry for this mapping. */ + auto map_page_to_frame(memory::allocator::area_frame_allocator & allocator, virtual_page const & page, memory::allocator::physical_frame const & frame, entry::bitset flags) -> void; } // namespace teachos::arch::memory::paging -- cgit v1.2.3