summaryrefslogtreecommitdiff
path: root/Kernel/VM/MemoryManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/VM/MemoryManager.cpp')
-rw-r--r--Kernel/VM/MemoryManager.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp
index a134e72dca..d55243d9b3 100644
--- a/Kernel/VM/MemoryManager.cpp
+++ b/Kernel/VM/MemoryManager.cpp
@@ -682,10 +682,15 @@ void MemoryManager::dump_kernel_regions()
ProcessPagingScope::ProcessPagingScope(Process& process)
{
ASSERT(current);
+ asm("movl %%cr3, %%eax"
+ : "=a"(m_previous_cr3));
MM.enter_process_paging_scope(process);
}
ProcessPagingScope::~ProcessPagingScope()
{
- MM.enter_process_paging_scope(current->process());
+ InterruptDisabler disabler;
+ current->tss().cr3 = m_previous_cr3;
+ asm volatile("movl %%eax, %%cr3" ::"a"(m_previous_cr3)
+ : "memory");
}