summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2017-07-23 02:37:26 +0200
committerSubv <subv2112@gmail.com>2017-09-15 21:26:15 +0200
commitb178089251200bd0309afcbcb06b43e7c82dc3bc (patch)
tree89b9c4927800dd6f7d2e12f9e025503131cac937
parentKernel/Memory: Changed GetPhysicalPointer so that it doesn't go through the current process' page table to obtain a pointer. (diff)
downloadyuzu-b178089251200bd0309afcbcb06b43e7c82dc3bc.tar
yuzu-b178089251200bd0309afcbcb06b43e7c82dc3bc.tar.gz
yuzu-b178089251200bd0309afcbcb06b43e7c82dc3bc.tar.bz2
yuzu-b178089251200bd0309afcbcb06b43e7c82dc3bc.tar.lz
yuzu-b178089251200bd0309afcbcb06b43e7c82dc3bc.tar.xz
yuzu-b178089251200bd0309afcbcb06b43e7c82dc3bc.tar.zst
yuzu-b178089251200bd0309afcbcb06b43e7c82dc3bc.zip
-rw-r--r--src/core/hle/kernel/thread.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index b7f094f46..f77c39d18 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -171,6 +171,8 @@ static void SwitchContext(Thread* new_thread) {
// Cancel any outstanding wakeup events for this thread
CoreTiming::UnscheduleEvent(ThreadWakeupEventType, new_thread->callback_handle);
+ auto previous_process = Kernel::g_current_process;
+
current_thread = new_thread;
ready_queue.remove(new_thread->current_priority, new_thread);
@@ -179,7 +181,7 @@ static void SwitchContext(Thread* new_thread) {
Core::CPU().LoadContext(new_thread->context);
Core::CPU().SetCP15Register(CP15_THREAD_URO, new_thread->GetTLSAddress());
- if (!previous_thread || previous_thread->owner_process != current_thread->owner_process) {
+ if (previous_process != current_thread->owner_process) {
Kernel::g_current_process = current_thread->owner_process;
Memory::current_page_table = &Kernel::g_current_process->vm_manager.page_table;
// We have switched processes and thus, page tables, clear the instruction cache so we