summaryrefslogtreecommitdiff
path: root/Kernel/VM
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/VM')
-rw-r--r--Kernel/VM/InodeVMObject.cpp1
-rw-r--r--Kernel/VM/MemoryManager.cpp10
-rw-r--r--Kernel/VM/Region.cpp22
3 files changed, 16 insertions, 17 deletions
diff --git a/Kernel/VM/InodeVMObject.cpp b/Kernel/VM/InodeVMObject.cpp
index 226675bd47..8d14b4d3c0 100644
--- a/Kernel/VM/InodeVMObject.cpp
+++ b/Kernel/VM/InodeVMObject.cpp
@@ -34,7 +34,6 @@ namespace Kernel {
NonnullRefPtr<InodeVMObject> InodeVMObject::create_with_inode(Inode& inode)
{
size_t size = inode.size();
- InterruptDisabler disabler;
if (inode.vmobject())
return *inode.vmobject();
auto vmobject = adopt(*new InodeVMObject(inode, size));
diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp
index 16424c40fc..5d9c8430a8 100644
--- a/Kernel/VM/MemoryManager.cpp
+++ b/Kernel/VM/MemoryManager.cpp
@@ -280,7 +280,7 @@ Region* MemoryManager::region_from_vaddr(VirtualAddress vaddr)
PageFaultResponse MemoryManager::handle_page_fault(const PageFault& fault)
{
ASSERT_INTERRUPTS_DISABLED();
- ASSERT(current);
+ ASSERT(Thread::current);
#ifdef PAGE_FAULT_DEBUG
dbgprintf("MM: handle_page_fault(%w) at V%p\n", fault.code(), fault.vaddr().get());
#endif
@@ -475,10 +475,10 @@ RefPtr<PhysicalPage> MemoryManager::allocate_supervisor_physical_page()
void MemoryManager::enter_process_paging_scope(Process& process)
{
- ASSERT(current);
+ ASSERT(Thread::current);
InterruptDisabler disabler;
- current->tss().cr3 = process.page_directory().cr3();
+ Thread::current->tss().cr3 = process.page_directory().cr3();
write_cr3(process.page_directory().cr3());
}
@@ -675,7 +675,7 @@ void MemoryManager::dump_kernel_regions()
ProcessPagingScope::ProcessPagingScope(Process& process)
{
- ASSERT(current);
+ ASSERT(Thread::current);
m_previous_cr3 = read_cr3();
MM.enter_process_paging_scope(process);
}
@@ -683,7 +683,7 @@ ProcessPagingScope::ProcessPagingScope(Process& process)
ProcessPagingScope::~ProcessPagingScope()
{
InterruptDisabler disabler;
- current->tss().cr3 = m_previous_cr3;
+ Thread::current->tss().cr3 = m_previous_cr3;
write_cr3(m_previous_cr3);
}
diff --git a/Kernel/VM/Region.cpp b/Kernel/VM/Region.cpp
index ff7afe381c..1db032ec74 100644
--- a/Kernel/VM/Region.cpp
+++ b/Kernel/VM/Region.cpp
@@ -84,15 +84,15 @@ Region::~Region()
NonnullOwnPtr<Region> Region::clone()
{
- ASSERT(current);
+ ASSERT(Process::current);
// FIXME: What should we do for privately mapped InodeVMObjects?
if (m_shared || vmobject().is_inode()) {
ASSERT(!m_stack);
#ifdef MM_DEBUG
dbgprintf("%s<%u> Region::clone(): sharing %s (V%p)\n",
- current->process().name().characters(),
- current->pid(),
+ Process::current->name().characters(),
+ Process::current->pid(),
m_name.characters(),
vaddr().get());
#endif
@@ -105,8 +105,8 @@ NonnullOwnPtr<Region> Region::clone()
#ifdef MM_DEBUG
dbgprintf("%s<%u> Region::clone(): cowing %s (V%p)\n",
- current->process().name().characters(),
- current->pid(),
+ Process::current->name().characters(),
+ Process::current->pid(),
m_name.characters(),
vaddr().get());
#endif
@@ -392,8 +392,8 @@ PageFaultResponse Region::handle_zero_fault(size_t page_index_in_region)
return PageFaultResponse::Continue;
}
- if (current)
- current->did_zero_fault();
+ if (Thread::current)
+ Thread::current->did_zero_fault();
auto physical_page = MM.allocate_user_physical_page(MemoryManager::ShouldZeroFill::Yes);
if (physical_page.is_null()) {
@@ -422,8 +422,8 @@ PageFaultResponse Region::handle_cow_fault(size_t page_index_in_region)
return PageFaultResponse::Continue;
}
- if (current)
- current->did_cow_fault();
+ if (Thread::current)
+ Thread::current->did_cow_fault();
#ifdef PAGE_FAULT_DEBUG
dbgprintf(" >> It's a COW page and it's time to COW!\n");
@@ -471,8 +471,8 @@ PageFaultResponse Region::handle_inode_fault(size_t page_index_in_region)
return PageFaultResponse::Continue;
}
- if (current)
- current->did_inode_fault();
+ if (Thread::current)
+ Thread::current->did_inode_fault();
#ifdef MM_DEBUG
dbgprintf("MM: page_in_from_inode ready to read from inode\n");