diff options
Diffstat (limited to 'kapi')
| -rw-r--r-- | kapi/include/kapi/memory/frame.hpp | 5 | ||||
| -rw-r--r-- | kapi/include/kapi/memory/page.hpp | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/kapi/include/kapi/memory/frame.hpp b/kapi/include/kapi/memory/frame.hpp index 095a3df..5793b8b 100644 --- a/kapi/include/kapi/memory/frame.hpp +++ b/kapi/include/kapi/memory/frame.hpp @@ -42,6 +42,11 @@ namespace teachos::memory return physical_address{m_number * PLATFORM_FRAME_SIZE}; } + [[nodiscard]] constexpr auto number() const noexcept -> std::size_t + { + return m_number; + } + /** * @brief Get the nth next frame. * diff --git a/kapi/include/kapi/memory/page.hpp b/kapi/include/kapi/memory/page.hpp index b84094f..473a8b8 100644 --- a/kapi/include/kapi/memory/page.hpp +++ b/kapi/include/kapi/memory/page.hpp @@ -42,6 +42,11 @@ namespace teachos::memory return linear_address{m_number * PLATFORM_PAGE_SIZE}; } + [[nodiscard]] constexpr auto number() const noexcept -> std::size_t + { + return m_number; + } + /** * @brief Check if this page refers to the same page as @p other. */ |
