summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2021-10-31 16:10:18 -0600
committerAndreas Kling <kling@serenityos.org>2021-11-14 22:52:35 +0100
commit5920b84696e9534380a1fe74cfac198cf5bdd896 (patch)
tree231e0e551e769ba5b6a501f5a6fe1ce24b58f635
parente824bead5477e7dc16343d4812d4c37dfbda9efd (diff)
downloadserenity-5920b84696e9534380a1fe74cfac198cf5bdd896.zip
Kernel: Stop truncating PageTableEntry::raw(), and make set_bit private
set_bit() in both PageDirectory and PageTableEntry are now private, and remove a useless cast from PageTableEntry::raw().
-rw-r--r--Kernel/Arch/x86/PageDirectory.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Arch/x86/PageDirectory.h b/Kernel/Arch/x86/PageDirectory.h
index d36373ea8f..12278e422c 100644
--- a/Kernel/Arch/x86/PageDirectory.h
+++ b/Kernel/Arch/x86/PageDirectory.h
@@ -63,6 +63,7 @@ public:
bool is_execute_disabled() const { return (raw() & NoExecute) == NoExecute; }
void set_execute_disabled(bool b) { set_bit(NoExecute, b); }
+private:
void set_bit(u64 bit, bool value)
{
if (value)
@@ -71,7 +72,6 @@ public:
m_raw &= ~bit;
}
-private:
u64 m_raw;
};
@@ -84,7 +84,7 @@ public:
m_raw |= PhysicalAddress::physical_page_base(value);
}
- u64 raw() const { return (u32)m_raw; }
+ u64 raw() const { return m_raw; }
enum Flags {
Present = 1 << 0,
@@ -120,6 +120,7 @@ public:
bool is_null() const { return m_raw == 0; }
void clear() { m_raw = 0; }
+private:
void set_bit(u64 bit, bool value)
{
if (value)
@@ -128,7 +129,6 @@ public:
m_raw &= ~bit;
}
-private:
u64 m_raw;
};