diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/thread.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 18b696f72..5fb95dada 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -14,7 +14,6 @@ #include "core/arm/skyeye_common/armstate.h" #include "core/core.h" #include "core/core_timing.h" -#include "core/hle/hle.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/memory.h" #include "core/hle/kernel/mutex.h" @@ -188,7 +187,7 @@ static void SwitchContext(Thread* new_thread) { // Save context for previous thread if (previous_thread) { previous_thread->last_running_ticks = CoreTiming::GetTicks(); - Core::g_app_core->SaveContext(previous_thread->context); + Core::CPU().SaveContext(previous_thread->context); if (previous_thread->status == THREADSTATUS_RUNNING) { // This is only the case when a reschedule is triggered without the current thread @@ -214,8 +213,8 @@ static void SwitchContext(Thread* new_thread) { // Restores thread to its nominal priority if it has been temporarily changed new_thread->current_priority = new_thread->nominal_priority; - Core::g_app_core->LoadContext(new_thread->context); - Core::g_app_core->SetCP15Register(CP15_THREAD_URO, new_thread->GetTLSAddress()); + Core::CPU().LoadContext(new_thread->context); + Core::CPU().SetCP15Register(CP15_THREAD_URO, new_thread->GetTLSAddress()); } else { current_thread = nullptr; } @@ -330,7 +329,7 @@ void Thread::ResumeFromWait() { ready_queue.push_back(current_priority, this); status = THREADSTATUS_READY; - HLE::Reschedule(__func__); + Core::System::GetInstance().PrepareReschedule(); } /** @@ -385,9 +384,9 @@ std::tuple<u32, u32, bool> GetFreeThreadLocalSlot(std::vector<std::bitset<8>>& t * @param entry_point Address of entry point for execution * @param arg User argument for thread */ -static void ResetThreadContext(Core::ThreadContext& context, u32 stack_top, u32 entry_point, - u32 arg) { - memset(&context, 0, sizeof(Core::ThreadContext)); +static void ResetThreadContext(ARM_Interface::ThreadContext& context, u32 stack_top, + u32 entry_point, u32 arg) { + memset(&context, 0, sizeof(ARM_Interface::ThreadContext)); context.cpu_registers[0] = arg; context.pc = entry_point; @@ -545,8 +544,6 @@ void Reschedule() { Thread* cur = GetCurrentThread(); Thread* next = PopNextReadyThread(); - HLE::DoneRescheduling(); - if (cur && next) { LOG_TRACE(Kernel, "context switch %u -> %u", cur->GetObjectId(), next->GetObjectId()); } else if (cur) { |