aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/memory/paging/tlb.cpp
diff options
context:
space:
mode:
authorFabian Imhof <fabian.imhof@ost.ch>2024-11-01 15:32:24 +0000
committerFabian Imhof <fabian.imhof@ost.ch>2024-11-01 15:32:24 +0000
commit38cda6bf579f7b09d06ad73c9f4ab893939727a2 (patch)
treec745deb418d93de274b321795fe0ce79c62b2b98 /arch/x86_64/src/memory/paging/tlb.cpp
parent86f19267c7ca4e14ac6169f758130b3c27e62cdb (diff)
downloadkernel-38cda6bf579f7b09d06ad73c9f4ab893939727a2.tar.xz
kernel-38cda6bf579f7b09d06ad73c9f4ab893939727a2.zip
extract tlb methods and finish implementation of with
Diffstat (limited to 'arch/x86_64/src/memory/paging/tlb.cpp')
-rw-r--r--arch/x86_64/src/memory/paging/tlb.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86_64/src/memory/paging/tlb.cpp b/arch/x86_64/src/memory/paging/tlb.cpp
new file mode 100644
index 0000000..b3255e9
--- /dev/null
+++ b/arch/x86_64/src/memory/paging/tlb.cpp
@@ -0,0 +1,7 @@
+#include "arch/memory/paging/tlb.hpp"
+
+namespace teachos::arch::memory::paging
+{
+ auto tlb_flush(virtual_address address) -> void { asm volatile("invlpg (%0)" ::"r"(address) : "memory"); }
+ auto tlb_flush_all() -> void { flush(PAGE_TABLE_LEVEL_4_ADDRESS); }
+} // namespace teachos::arch::memory::paging