aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/include
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2024-11-24 13:27:15 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2024-11-24 13:27:15 +0000
commit47732f54474a083e9f98e52714c12c0ca1181174 (patch)
treea350031797e8fd98b22de18e7a720fd0e9f57e11 /arch/x86_64/include
parent24805678884bcfcc3f14e88757955ab574d647cb (diff)
downloadteachos-47732f54474a083e9f98e52714c12c0ca1181174.tar.xz
teachos-47732f54474a083e9f98e52714c12c0ca1181174.zip
Use container helper classes for heap remapping
Diffstat (limited to 'arch/x86_64/include')
-rw-r--r--arch/x86_64/include/arch/memory/allocator/physical_frame.hpp4
-rw-r--r--arch/x86_64/include/arch/memory/paging/virtual_page.hpp23
2 files changed, 24 insertions, 3 deletions
diff --git a/arch/x86_64/include/arch/memory/allocator/physical_frame.hpp b/arch/x86_64/include/arch/memory/allocator/physical_frame.hpp
index a39517a..d5e2f4c 100644
--- a/arch/x86_64/include/arch/memory/allocator/physical_frame.hpp
+++ b/arch/x86_64/include/arch/memory/allocator/physical_frame.hpp
@@ -54,14 +54,14 @@ namespace teachos::arch::memory::allocator
/**
* @brief Post increment operator. Returns a copy of the value.
*
- * @return Copy of the incremented underlying address.
+ * @return Copy of the incremented underlying frame number.
*/
auto operator++(int) -> physical_frame;
/**
* @brief Pre increment operator. Returns a reference to the changed value.
*
- * @return Reference to the incremented underlying address.
+ * @return Reference to the incremented underlying frame number.
*/
auto operator++() -> physical_frame &;
diff --git a/arch/x86_64/include/arch/memory/paging/virtual_page.hpp b/arch/x86_64/include/arch/memory/paging/virtual_page.hpp
index c319af2..0ee9cbd 100644
--- a/arch/x86_64/include/arch/memory/paging/virtual_page.hpp
+++ b/arch/x86_64/include/arch/memory/paging/virtual_page.hpp
@@ -18,6 +18,11 @@ namespace teachos::arch::memory::paging
struct virtual_page
{
/**
+ * @brief Defaulted constructor.
+ */
+ constexpr virtual_page() = default;
+
+ /**
* @brief Constructor.
*
* @param page_number Index number of the current virtual page, used to distinguish it from other pages.
@@ -52,6 +57,20 @@ namespace teachos::arch::memory::paging
auto get_level_index(page_table_handle::level level) const -> size_t;
/**
+ * @brief Post increment operator. Returns a copy of the value.
+ *
+ * @return Copy of the incremented underlying page number.
+ */
+ auto operator++(int) -> virtual_page;
+
+ /**
+ * @brief Pre increment operator. Returns a reference to the changed value.
+ *
+ * @return Reference to the incremented underlying page number.
+ */
+ auto operator++() -> virtual_page &;
+
+ /**
* @brief Defaulted equals operator.
*/
auto operator==(const virtual_page & other) const -> bool = default;
@@ -61,9 +80,11 @@ namespace teachos::arch::memory::paging
*/
auto operator<=>(const virtual_page & other) const -> std::partial_ordering = default;
- std::size_t page_number; ///< Index number of the current virtual page, used to distinguish it from other pages.
+ std::size_t page_number =
+ {}; ///< Index number of the current virtual page, used to distinguish it from other pages.
};
+ typedef shared::container<shared::forward_value_iterator<virtual_page>> page_container;
} // namespace teachos::arch::memory::paging
#endif // TEACHOS_ARCH_X86_64_MEMORY_PAGING_VIRTUAL_PAGE_HPP