aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/memory/paging.cpp
diff options
context:
space:
mode:
authorFabian Imhof <fabian.imhof@ost.ch>2024-10-15 08:40:56 +0000
committerFabian Imhof <fabian.imhof@ost.ch>2024-10-15 08:40:56 +0000
commit03d3dec4807d6adcfc5e21bd13992014900b4eac (patch)
treea5c083c33ce4eea3e538ac1a62e58ed2d7cfee7c /arch/x86_64/src/memory/paging.cpp
parent205934ca45d591924b4be6e7ae5a8849958e0cf6 (diff)
downloadteachos-03d3dec4807d6adcfc5e21bd13992014900b4eac.tar.xz
teachos-03d3dec4807d6adcfc5e21bd13992014900b4eac.zip
implement page table members
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