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

@ -21,6 +21,7 @@
#include "core/hle/kernel/thread.h"
#include "core/hle/lock.h"
#include "core/hle/result.h"
#include "core/memory.h"
namespace Kernel {
@ -181,6 +182,7 @@ void KernelCore::AppendNewProcess(SharedPtr<Process> process) {
void KernelCore::MakeCurrentProcess(Process* process) {
impl->current_process = process;
Memory::SetCurrentPageTable(&process->VMManager().page_table);
}
Process* KernelCore::CurrentProcess() {