summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/scheduler.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-03-01 17:14:17 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 17:35:58 +0200
commit1567824d2da8e9b49b433f3d1d753d8ad84e65f9 (patch)
treec9553bb3f1693e430054695737d2f87ba4b58955 /src/core/hle/kernel/scheduler.cpp
parentCore: Refactor ARM Interface. (diff)
downloadyuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.tar
yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.tar.gz
yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.tar.bz2
yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.tar.lz
yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.tar.xz
yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.tar.zst
yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.zip
Diffstat (limited to 'src/core/hle/kernel/scheduler.cpp')
-rw-r--r--src/core/hle/kernel/scheduler.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp
index 8d56b49ce..a5083ae7c 100644
--- a/src/core/hle/kernel/scheduler.cpp
+++ b/src/core/hle/kernel/scheduler.cpp
@@ -681,15 +681,16 @@ void Scheduler::SwitchContextStep2() {
new_thread->SetWasRunning(false);
auto* const thread_owner_process = current_thread->GetOwnerProcess();
- if (previous_process != thread_owner_process && thread_owner_process != nullptr) {
+ if (thread_owner_process != nullptr) {
system.Kernel().MakeCurrentProcess(thread_owner_process);
}
if (!new_thread->IsHLEThread()) {
- auto& cpu_core = system.ArmInterface(core_id);
+ Core::ARM_Interface& cpu_core = new_thread->ArmInterface();
cpu_core.LoadContext(new_thread->GetContext32());
cpu_core.LoadContext(new_thread->GetContext64());
cpu_core.SetTlsAddress(new_thread->GetTLSAddress());
cpu_core.SetTPIDR_EL0(new_thread->GetTPIDR_EL0());
+ cpu_core.ChangeProcessorId(this->core_id);
cpu_core.ClearExclusiveState();
}
}
@@ -722,18 +723,15 @@ void Scheduler::SwitchContext() {
}
previous_thread->SetContinuousOnSVC(false);
previous_thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
+ previous_thread->SetIsRunning(false);
if (!previous_thread->IsHLEThread()) {
- auto& cpu_core = system.ArmInterface(core_id);
+ Core::ARM_Interface& cpu_core = previous_thread->ArmInterface();
cpu_core.SaveContext(previous_thread->GetContext32());
cpu_core.SaveContext(previous_thread->GetContext64());
// Save the TPIDR_EL0 system register in case it was modified.
previous_thread->SetTPIDR_EL0(cpu_core.GetTPIDR_EL0());
cpu_core.ClearExclusiveState();
}
- if (previous_thread->GetStatus() == ThreadStatus::Running) {
- previous_thread->SetStatus(ThreadStatus::Ready);
- }
- previous_thread->SetIsRunning(false);
previous_thread->context_guard.unlock();
}