From 27eddc3fa8d4c6001f223670d6001554fc47b657 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 1 Dec 2025 15:56:58 +0100 Subject: x86_64/memory: implement PML4 injection --- kapi/include/kapi/memory/address.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'kapi') diff --git a/kapi/include/kapi/memory/address.hpp b/kapi/include/kapi/memory/address.hpp index 19615e4..ad82f20 100644 --- a/kapi/include/kapi/memory/address.hpp +++ b/kapi/include/kapi/memory/address.hpp @@ -33,6 +33,17 @@ namespace teachos::memory return std::bit_cast(m_value); } + constexpr auto operator>>(std::size_t n) const noexcept -> address + { + return address{m_value >> n}; + } + + template + constexpr auto operator&(MaskType mask) const noexcept -> MaskType + { + return static_cast(m_value & mask); + } + constexpr auto operator<=>(address const &) const noexcept -> std::strong_ordering = default; constexpr auto operator==(address const &) const noexcept -> bool = default; -- cgit v1.2.3