aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64')
-rw-r--r--arch/x86_64/include/arch/memory/allocator/concept.hpp5
-rw-r--r--arch/x86_64/include/arch/memory/paging/temporary_page.hpp30
2 files changed, 21 insertions, 14 deletions
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<typename T>
concept FrameAllocator = requires(T t, physical_frame a) {
{ t.allocate_frame() } -> std::same_as<std::optional<physical_frame>>;
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<allocator::FrameAllocator T>
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;