aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/memory/page_table.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/src/memory/page_table.cpp')
-rw-r--r--arch/x86_64/src/memory/page_table.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86_64/src/memory/page_table.cpp b/arch/x86_64/src/memory/page_table.cpp
index 1273676..60bf94d 100644
--- a/arch/x86_64/src/memory/page_table.cpp
+++ b/arch/x86_64/src/memory/page_table.cpp
@@ -54,4 +54,10 @@ namespace teachos::memory::x86_64
std::ranges::for_each(m_entries, &page_table::entry::clear);
}
+ auto page_table::empty() const noexcept -> bool
+ {
+ return std::ranges::all_of(m_entries,
+ [](auto const & entry) -> auto { return entry.all_flags() == entry::flags::empty; });
+ }
+
} // namespace teachos::memory::x86_64