aboutsummaryrefslogtreecommitdiff
path: root/kapi
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2025-12-01 15:56:58 +0100
committerFelix Morgner <felix.morgner@ost.ch>2025-12-01 15:56:58 +0100
commit27eddc3fa8d4c6001f223670d6001554fc47b657 (patch)
tree33b2a87427cf7b4bbea0458d6340b1a4ab64948d /kapi
parentcf833d0e8676f6a5ee6b536b4cb5202e9446ab87 (diff)
downloadteachos-27eddc3fa8d4c6001f223670d6001554fc47b657.tar.xz
teachos-27eddc3fa8d4c6001f223670d6001554fc47b657.zip
x86_64/memory: implement PML4 injection
Diffstat (limited to 'kapi')
-rw-r--r--kapi/include/kapi/memory/address.hpp11
1 files changed, 11 insertions, 0 deletions
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<std::byte *>(m_value);
}
+ constexpr auto operator>>(std::size_t n) const noexcept -> address
+ {
+ return address{m_value >> n};
+ }
+
+ template<typename MaskType>
+ constexpr auto operator&(MaskType mask) const noexcept -> MaskType
+ {
+ return static_cast<MaskType>(m_value & mask);
+ }
+
constexpr auto operator<=>(address const &) const noexcept -> std::strong_ordering = default;
constexpr auto operator==(address const &) const noexcept -> bool = default;