diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-01 17:08:13 +0000 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-01 17:08:13 +0000 |
| commit | 5c59cd35a2fa3e620542b73e8c3f66f0dccd241c (patch) | |
| tree | 985e7e39fd9657ceb45ab292f6a934e0e6d4571b /Private/NewKit/PageManager.hpp | |
| parent | 6c4cc0dba681fef1cef3c31877653a1d6413fc90 (diff) | |
| parent | 6ce7dffe92775f262384a028af233999a7d18048 (diff) | |
Merge branch 'HCR-9-add-support-for-file-load-hel-amd64' into 'trunk'
See below.
See merge request mahrouss-logic/micro-kernel!2
Diffstat (limited to 'Private/NewKit/PageManager.hpp')
| -rw-r--r-- | Private/NewKit/PageManager.hpp | 103 |
1 files changed, 52 insertions, 51 deletions
diff --git a/Private/NewKit/PageManager.hpp b/Private/NewKit/PageManager.hpp index b5337268..fdde95f8 100644 --- a/Private/NewKit/PageManager.hpp +++ b/Private/NewKit/PageManager.hpp @@ -18,64 +18,65 @@ #ifndef kBadAddress #define kBadAddress (0) -#endif // #ifndef kBadAddress +#endif // #ifndef kBadAddress -namespace HCore -{ +namespace HCore { class PageManager; -class PTEWrapper final -{ - public: - explicit PTEWrapper(Boolean Rw = false, Boolean User = false, Boolean ExecDisable = false, UIntPtr Address = 0); - ~PTEWrapper(); - - PTEWrapper &operator=(const PTEWrapper &) = default; - PTEWrapper(const PTEWrapper &) = default; - - public: - void FlushTLB(Ref<PageManager> &pm); - const UIntPtr &VirtualAddress(); - - bool Reclaim(); - bool Shareable(); - bool Present(); - bool Access(); - - private: - Boolean m_Rw; - Boolean m_User; - Boolean m_ExecDisable; - UIntPtr m_VirtAddr; - Boolean m_Cache; - Boolean m_Shareable; - Boolean m_Wt; - Boolean m_Present; - Boolean m_Accessed; - - private: - friend class PageManager; - friend class Pmm; +class PTEWrapper final { + public: + explicit PTEWrapper(Boolean Rw = false, Boolean User = false, + Boolean ExecDisable = false, UIntPtr Address = 0); + ~PTEWrapper(); + + PTEWrapper &operator=(const PTEWrapper &) = default; + PTEWrapper(const PTEWrapper &) = default; + + public: + void FlushTLB(Ref<PageManager> &pm); + const UIntPtr &VirtualAddress(); + + void NoExecute(const bool enable = false); + const bool &NoExecute(); + + bool Reclaim(); + bool Shareable(); + bool Present(); + bool Access(); + + private: + Boolean m_Rw; + Boolean m_User; + Boolean m_ExecDisable; + UIntPtr m_VirtAddr; + Boolean m_Cache; + Boolean m_Shareable; + Boolean m_Wt; + Boolean m_Present; + Boolean m_Accessed; + + private: + friend class PageManager; + friend class Pmm; }; -struct PageManager final -{ - public: - PageManager() = default; - ~PageManager() = default; +struct PageManager final { + public: + PageManager() = default; + ~PageManager() = default; - PageManager &operator=(const PageManager &) = default; - PageManager(const PageManager &) = default; + PageManager &operator=(const PageManager &) = default; + PageManager(const PageManager &) = default; - public: - PTEWrapper *Request(Boolean Rw, Boolean User, Boolean ExecDisable); - bool Free(Ref<PTEWrapper*> &wrapper); + public: + PTEWrapper *Request(Boolean Rw, Boolean User, Boolean ExecDisable); + bool Free(Ref<PTEWrapper *> &wrapper); - private: - void FlushTLB(UIntPtr VirtAddr); + private: + void FlushTLB(UIntPtr VirtAddr); - private: - friend PTEWrapper; - friend class Pmm; + private: + friend PTEWrapper; + friend class Pmm; }; -} // namespace HCore +} // namespace HCore |
