kernel/process: move current process to kernel instance

Two functional change:
QueryProcessMemory uses the process passed from handle instead current_process
Thread::Stop() uses TLS from owner_process instead of current_process
This commit is contained in:
Weiyi Wang 2018-10-17 15:23:56 -04:00
parent d9342622b0
commit 8fb3d8ff38
19 changed files with 96 additions and 55 deletions

View file

@ -30,7 +30,6 @@ KernelSystem::~KernelSystem() {
g_handle_table.Clear(); // Free all kernel objects
Kernel::ThreadingShutdown();
g_current_process = nullptr;
Kernel::TimersShutdown();
Kernel::MemoryShutdown();
@ -48,4 +47,12 @@ u32 KernelSystem::GenerateObjectID() {
return next_object_id++;
}
SharedPtr<Process> KernelSystem::GetCurrentProcess() const {
return current_process;
}
void KernelSystem::SetCurrentProcess(SharedPtr<Process> process) {
current_process = std::move(process);
}
} // namespace Kernel