mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
AK: Add offset_in_page() method in PhysicalAddress class
This method is useful for later usage.
This commit is contained in:
parent
fe664965c2
commit
43d570a1e3
Notes:
sideshowbarker
2024-07-19 09:05:32 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/43d570a1e3f Pull-request: https://github.com/SerenityOS/serenity/pull/1274 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/shannonbooth
1 changed files with 1 additions and 0 deletions
|
@ -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; }
|
||||
|
|
Loading…
Add table
Reference in a new issue