From 304999dfebea595ea4a21082ed2ef9ea3f3d907f Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 26 Aug 2014 23:58:03 -0400 Subject: Threading: Fix thread starting to execute first instruction correctly. --- src/core/hle/kernel/thread.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/core/hle/kernel') diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 554ec9756..8bd9ca1a1 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -117,6 +117,11 @@ void ResetThread(Thread* t, u32 arg, s32 lowest_priority) { t->context.sp = t->stack_top; t->context.cpsr = 0x1F; // Usermode + // TODO(bunnei): This instructs the CPU core to start the execution as if it is "resuming" a + // thread. This is somewhat Sky-Eye specific, and should be re-architected in the future to be + // agnostic of the CPU core. + t->context.mode = 8; + if (t->current_priority < lowest_priority) { t->current_priority = t->initial_priority; } -- cgit v1.2.3