AK: Add offset_in_page() method in PhysicalAddress class

This method is useful for later usage.
This commit is contained in:
Liav A 2020-02-24 00:50:00 +02:00 committed by Andreas Kling
parent fe664965c2
commit 43d570a1e3
Notes: sideshowbarker 2024-07-19 09:05:32 +09:00

View file

@ -48,6 +48,7 @@ public:
const u8* as_ptr() const { return reinterpret_cast<const u8*>(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; }