aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/include
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-03-16 10:38:54 +0100
committerFelix Morgner <felix.morgner@ost.ch>2026-03-16 10:38:54 +0100
commit80ae75bf039820ecb332ae1ab86ef6ce4e2675e4 (patch)
tree1bb344657e2516f175c7ce0045f491c8ff811de1 /arch/x86_64/include
parentd9a653e66d3e7ce3a93219626b281d727e51e2a9 (diff)
downloadteachos-80ae75bf039820ecb332ae1ab86ef6ce4e2675e4.tar.xz
teachos-80ae75bf039820ecb332ae1ab86ef6ce4e2675e4.zip
kapi/memory: support additional address arithmetic
Diffstat (limited to 'arch/x86_64/include')
-rw-r--r--arch/x86_64/include/arch/memory/page_table.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86_64/include/arch/memory/page_table.hpp b/arch/x86_64/include/arch/memory/page_table.hpp
index 003dbf3..778c201 100644
--- a/arch/x86_64/include/arch/memory/page_table.hpp
+++ b/arch/x86_64/include/arch/memory/page_table.hpp
@@ -189,9 +189,9 @@ namespace arch::memory
-> std::optional<kapi::memory::physical_address>
requires(Level == 4)
{
- auto offset = address.raw() % kapi::memory::page::size;
+ auto offset = address % kapi::memory::page::size;
return translate(kapi::memory::page::containing(address)).transform([offset](auto frame) -> auto {
- return kapi::memory::physical_address{frame.start_address().raw() + offset};
+ return frame.start_address() + offset;
});
}