aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/memory/paging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/src/memory/paging.cpp')
-rw-r--r--arch/x86_64/src/memory/paging.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86_64/src/memory/paging.cpp b/arch/x86_64/src/memory/paging.cpp
index 90c4199..58a2b99 100644
--- a/arch/x86_64/src/memory/paging.cpp
+++ b/arch/x86_64/src/memory/paging.cpp
@@ -40,4 +40,15 @@ namespace teachos::arch::memory
auto entry::contains_flags(std::bitset<64U> b) const -> bool { return (flags & b) == b; }
+ auto page_table::zero_entries() -> void
+ {
+ auto begin = &entries[0];
+ auto end = &entries[PAGE_TABLE_ENTRY_COUNT];
+
+ for (auto entry = begin; entry < end; ++entry)
+ {
+ entry->set_unused();
+ }
+ }
+
} // namespace teachos::arch::memory