diff options
Diffstat (limited to 'Kernel/VM/PageDirectory.cpp')
-rw-r--r-- | Kernel/VM/PageDirectory.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Kernel/VM/PageDirectory.cpp b/Kernel/VM/PageDirectory.cpp new file mode 100644 index 0000000000..d5c10c189a --- /dev/null +++ b/Kernel/VM/PageDirectory.cpp @@ -0,0 +1,32 @@ +#include <Kernel/VM/PageDirectory.h> +#include <Kernel/VM/MemoryManager.h> +#include <Kernel/Process.h> +#include <Kernel/Thread.h> + +PageDirectory::PageDirectory(PhysicalAddress paddr) +{ + m_directory_page = PhysicalPage::create_eternal(paddr, true); +} + +PageDirectory::PageDirectory() +{ + MM.populate_page_directory(*this); +} + +PageDirectory::~PageDirectory() +{ +#ifdef MM_DEBUG + dbgprintf("MM: ~PageDirectory K%x\n", this); +#endif +} + +void PageDirectory::flush(LinearAddress laddr) +{ +#ifdef MM_DEBUG + dbgprintf("MM: Flush page L%x\n", laddr.get()); +#endif + if (!current) + return; + if (¤t->process().page_directory() == this) + MM.flush_tlb(laddr); +} |