aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/include')
-rw-r--r--arch/x86_64/include/arch/memory/frame_allocator.hpp4
-rw-r--r--arch/x86_64/include/arch/memory/paging.hpp21
2 files changed, 21 insertions, 4 deletions
diff --git a/arch/x86_64/include/arch/memory/frame_allocator.hpp b/arch/x86_64/include/arch/memory/frame_allocator.hpp
index 69c108c..3d1f826 100644
--- a/arch/x86_64/include/arch/memory/frame_allocator.hpp
+++ b/arch/x86_64/include/arch/memory/frame_allocator.hpp
@@ -32,9 +32,9 @@ namespace teachos::arch::memory
static auto containing_address(std::size_t address) -> physical_frame;
/**
- * @brief TODO
+ * @brief Evaluates the start address of the physical frame
*
- * @return uint64_t
+ * @return start address of the physical frame
*/
auto start_address() const -> uint64_t;
diff --git a/arch/x86_64/include/arch/memory/paging.hpp b/arch/x86_64/include/arch/memory/paging.hpp
index 1870c28..43f13e0 100644
--- a/arch/x86_64/include/arch/memory/paging.hpp
+++ b/arch/x86_64/include/arch/memory/paging.hpp
@@ -89,11 +89,28 @@ namespace teachos::arch::memory
};
/**
- * @brief TODO
- *
+ * @brief A Page table containing 512 entries
*/
struct page_table
{
+ /**
+ * @brief Set every entry of the page to unused
+ */
+ auto zero_entries() -> void;
+
+ /**
+ * @brief Index operator overload to access specific entries directy
+ *
+ * @param index
+ * @return The address of the accessed entry
+ */
+ entry & operator[](size_t index)
+ {
+ arch::exception_handling::assert(index < PAGE_TABLE_ENTRY_COUNT, "[Page Table] index out of bounds");
+ return entries[index];
+ }
+
+ private:
entry entries[PAGE_TABLE_ENTRY_COUNT];
};
} // namespace teachos::arch::memory