1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:17:35 +00:00

Kernel: Replace "current" with Thread::current and Process::current

Suggested by Sergey. The currently running Thread and Process are now
Thread::current and Process::current respectively. :^)
This commit is contained in:
Andreas Kling 2020-02-17 15:04:27 +01:00
parent 4f4af24b9d
commit 48f7c28a5c
37 changed files with 257 additions and 252 deletions

View file

@ -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");