From e6ebf9e5c1e82a638ac2a0c40166da36ca1d5bd5 Mon Sep 17 00:00:00 2001 From: Liav A Date: Sun, 27 Mar 2022 17:51:16 +0300 Subject: [PATCH] Kernel/Memory: Add TypedMapping base_address method This method will be used to ease usage with the structure when we need to do virtual pointer arithmetics. --- Kernel/Memory/TypedMapping.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Kernel/Memory/TypedMapping.h b/Kernel/Memory/TypedMapping.h index 10dbd9ecf2..f1dd584aef 100644 --- a/Kernel/Memory/TypedMapping.h +++ b/Kernel/Memory/TypedMapping.h @@ -15,6 +15,7 @@ template struct TypedMapping { const T* ptr() const { return reinterpret_cast(region->vaddr().offset(offset).as_ptr()); } T* ptr() { return reinterpret_cast(region->vaddr().offset(offset).as_ptr()); } + VirtualAddress base_address() const { return region->vaddr().offset(offset); } const T* operator->() const { return ptr(); } T* operator->() { return ptr(); } const T& operator*() const { return *ptr(); }