kernel: Handle page table switching within MakeCurrentProcess()

Centralizes the page table switching to one spot, rather than making
calling code deal with it everywhere.
This commit is contained in:
Lioncash 2019-04-07 01:10:44 -04:00
parent 864280fabc
commit e779686a76
4 changed files with 3 additions and 6 deletions

View file

@ -101,7 +101,6 @@ void Scheduler::SwitchContext(Thread* new_thread) {
auto* const thread_owner_process = current_thread->GetOwnerProcess();
if (previous_process != thread_owner_process) {
system.Kernel().MakeCurrentProcess(thread_owner_process);
Memory::SetCurrentPageTable(&thread_owner_process->VMManager().page_table);
}
cpu_core.LoadContext(new_thread->GetContext());