diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2025-12-02 18:40:10 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2025-12-02 18:40:10 +0100 |
| commit | a96b1b4b43a1ed962b412c3d28db0fe00661d96f (patch) | |
| tree | ddc7e9dcc9814b07c2ff36d4875a0fe2ae13a665 /arch/x86_64/include | |
| parent | be86be1facfce8fe3f376153b9c582f2c5c026aa (diff) | |
| download | teachos-a96b1b4b43a1ed962b412c3d28db0fe00661d96f.tar.xz teachos-a96b1b4b43a1ed962b412c3d28db0fe00661d96f.zip | |
x86_64/memory: extract PML4 injection
Diffstat (limited to 'arch/x86_64/include')
| -rw-r--r-- | arch/x86_64/include/x86_64/memory/page_table.hpp | 3 | ||||
| -rw-r--r-- | arch/x86_64/include/x86_64/memory/scoped_mapping.hpp | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86_64/include/x86_64/memory/page_table.hpp b/arch/x86_64/include/x86_64/memory/page_table.hpp index 53af5d0..6b8eb8c 100644 --- a/arch/x86_64/include/x86_64/memory/page_table.hpp +++ b/arch/x86_64/include/x86_64/memory/page_table.hpp @@ -74,6 +74,9 @@ namespace teachos::memory::x86_64 //! Clear the entire page table, effectively evicting all entries. auto clear() -> void; + //! Check if the page table is empty. + [[nodiscard]] auto empty() const noexcept -> bool; + private: std::array<entry, entry_count> m_entries{}; }; diff --git a/arch/x86_64/include/x86_64/memory/scoped_mapping.hpp b/arch/x86_64/include/x86_64/memory/scoped_mapping.hpp index 1719e6b..5737bb0 100644 --- a/arch/x86_64/include/x86_64/memory/scoped_mapping.hpp +++ b/arch/x86_64/include/x86_64/memory/scoped_mapping.hpp @@ -12,7 +12,7 @@ namespace teachos::memory::x86_64 { scoped_mapping(scoped_mapping const &) = delete; scoped_mapping(scoped_mapping &&); - scoped_mapping(linear_address address, frame_allocator & allocator); + scoped_mapping(page page, frame_allocator & allocator); ~scoped_mapping(); @@ -29,7 +29,7 @@ namespace teachos::memory::x86_64 } private: - linear_address m_address; + page m_page; frame_allocator * m_allocator; bool m_mapped; }; |
