From 8fc5f9e3cc28b07b1f120eb1ffedc042fa6662b8 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 12 Dec 2025 13:00:26 +0100 Subject: x86_64/kapi: implement remaining mapping steps --- kapi/include/kapi/boot.hpp | 2 +- kapi/include/kapi/memory/page.hpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'kapi') diff --git a/kapi/include/kapi/boot.hpp b/kapi/include/kapi/boot.hpp index 9c344cf..dd99198 100644 --- a/kapi/include/kapi/boot.hpp +++ b/kapi/include/kapi/boot.hpp @@ -11,7 +11,7 @@ namespace teachos::boot //! @qualifier platform-defined //! An object passed from the early pre-main stage to the kernel executable. - extern "C" information const bootstrap_information; + extern "C" information bootstrap_information; } // namespace teachos::boot #endif diff --git a/kapi/include/kapi/memory/page.hpp b/kapi/include/kapi/memory/page.hpp index 66e8482..0b7083a 100644 --- a/kapi/include/kapi/memory/page.hpp +++ b/kapi/include/kapi/memory/page.hpp @@ -51,6 +51,15 @@ namespace teachos::memory return m_number; } + //! Get a handle n pages after the one referenced by this handle. + //! + //! @param n The positive offset to this page. + //! @return A handle referencing the page n pages after the one referenced by this handle. + constexpr auto operator+(std::size_t n) const noexcept -> page + { + return page{m_number + n}; + } + //! Check if this page handle reference the same frame as another one. //! //! @param other Another page handle. -- cgit v1.2.3