From 43d570a1e3fb85476f9c2520b147bd836a6966e3 Mon Sep 17 00:00:00 2001 From: Liav A Date: Mon, 24 Feb 2020 00:50:00 +0200 Subject: [PATCH] AK: Add offset_in_page() method in PhysicalAddress class This method is useful for later usage. --- Libraries/LibBareMetal/Memory/PhysicalAddress.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/LibBareMetal/Memory/PhysicalAddress.h b/Libraries/LibBareMetal/Memory/PhysicalAddress.h index 4b51a4fd18..02594b3389 100644 --- a/Libraries/LibBareMetal/Memory/PhysicalAddress.h +++ b/Libraries/LibBareMetal/Memory/PhysicalAddress.h @@ -48,6 +48,7 @@ public: const u8* as_ptr() const { return reinterpret_cast(m_address); } PhysicalAddress page_base() const { return PhysicalAddress(m_address & 0xfffff000); } + PhysicalAddress offset_in_page() const { return PhysicalAddress(m_address & 0xfff); } bool operator==(const PhysicalAddress& other) const { return m_address == other.m_address; } bool operator!=(const PhysicalAddress& other) const { return m_address != other.m_address; }