1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +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

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