diff options
Diffstat (limited to 'arch/x86_64/include')
| -rw-r--r-- | arch/x86_64/include/arch/memory/allocator/physical_frame.hpp | 4 | ||||
| -rw-r--r-- | arch/x86_64/include/arch/memory/paging/virtual_page.hpp | 23 |
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 |
