From 5920b84696e9534380a1fe74cfac198cf5bdd896 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sun, 31 Oct 2021 16:10:18 -0600 Subject: [PATCH] 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(). --- Kernel/Arch/x86/PageDirectory.h | 6 +++--- 1 file 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; };