mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
0dc9af5f7e
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
27 lines
788 B
C++
27 lines
788 B
C++
#pragma once
|
|
|
|
class PhysicalAddress {
|
|
public:
|
|
PhysicalAddress() {}
|
|
explicit PhysicalAddress(dword address)
|
|
: m_address(address)
|
|
{
|
|
}
|
|
|
|
PhysicalAddress offset(dword o) const { return PhysicalAddress(m_address + o); }
|
|
dword get() const { return m_address; }
|
|
void set(dword address) { m_address = address; }
|
|
void mask(dword m) { m_address &= m; }
|
|
|
|
bool is_null() const { return m_address == 0; }
|
|
|
|
byte* as_ptr() { return reinterpret_cast<byte*>(m_address); }
|
|
const byte* as_ptr() const { return reinterpret_cast<const byte*>(m_address); }
|
|
|
|
dword page_base() const { return m_address & 0xfffff000; }
|
|
|
|
bool operator==(const PhysicalAddress& other) const { return m_address == other.m_address; }
|
|
|
|
private:
|
|
dword m_address { 0 };
|
|
};
|