diff options
| author | 2020-03-10 13:24:52 -0400 | |
|---|---|---|
| committer | 2020-06-27 11:35:59 -0400 | |
| commit | 9bde28d7b100fdcd1cc50c8f2a4b8c74704f5e34 (patch) | |
| tree | 893f13cf4913b1793689d108183ff2038bb88e04 /src | |
| parent | Thread: Release the ARM Interface on exitting. (diff) | |
| download | yuzu-9bde28d7b100fdcd1cc50c8f2a4b8c74704f5e34.tar.gz yuzu-9bde28d7b100fdcd1cc50c8f2a4b8c74704f5e34.tar.xz yuzu-9bde28d7b100fdcd1cc50c8f2a4b8c74704f5e34.zip | |
Scheduler: Correct Reload/Unload
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/kernel/scheduler.cpp | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 3feddd9ad..739205eca 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -149,6 +149,7 @@ struct KernelCore::Impl { | |||
| 149 | 149 | ||
| 150 | for (std::size_t i = 0; i < cores.size(); i++) { | 150 | for (std::size_t i = 0; i < cores.size(); i++) { |
| 151 | cores[i].Shutdown(); | 151 | cores[i].Shutdown(); |
| 152 | schedulers[i].reset(); | ||
| 152 | } | 153 | } |
| 153 | cores.clear(); | 154 | cores.clear(); |
| 154 | 155 | ||
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp index ce7e1986d..43c924fa0 100644 --- a/src/core/hle/kernel/scheduler.cpp +++ b/src/core/hle/kernel/scheduler.cpp | |||
| @@ -625,8 +625,8 @@ void Scheduler::Unload() { | |||
| 625 | thread->SetContinuousOnSVC(false); | 625 | thread->SetContinuousOnSVC(false); |
| 626 | thread->last_running_ticks = system.CoreTiming().GetCPUTicks(); | 626 | thread->last_running_ticks = system.CoreTiming().GetCPUTicks(); |
| 627 | thread->SetIsRunning(false); | 627 | thread->SetIsRunning(false); |
| 628 | if (!thread->IsHLEThread()) { | 628 | if (!thread->IsHLEThread() && !thread->HasExited()) { |
| 629 | auto& cpu_core = system.ArmInterface(core_id); | 629 | Core::ARM_Interface& cpu_core = thread->ArmInterface(); |
| 630 | cpu_core.SaveContext(thread->GetContext32()); | 630 | cpu_core.SaveContext(thread->GetContext32()); |
| 631 | cpu_core.SaveContext(thread->GetContext64()); | 631 | cpu_core.SaveContext(thread->GetContext64()); |
| 632 | // Save the TPIDR_EL0 system register in case it was modified. | 632 | // Save the TPIDR_EL0 system register in case it was modified. |
| @@ -653,11 +653,12 @@ void Scheduler::Reload() { | |||
| 653 | system.Kernel().MakeCurrentProcess(thread_owner_process); | 653 | system.Kernel().MakeCurrentProcess(thread_owner_process); |
| 654 | } | 654 | } |
| 655 | if (!thread->IsHLEThread()) { | 655 | if (!thread->IsHLEThread()) { |
| 656 | auto& cpu_core = system.ArmInterface(core_id); | 656 | Core::ARM_Interface& cpu_core = thread->ArmInterface(); |
| 657 | cpu_core.LoadContext(thread->GetContext32()); | 657 | cpu_core.LoadContext(thread->GetContext32()); |
| 658 | cpu_core.LoadContext(thread->GetContext64()); | 658 | cpu_core.LoadContext(thread->GetContext64()); |
| 659 | cpu_core.SetTlsAddress(thread->GetTLSAddress()); | 659 | cpu_core.SetTlsAddress(thread->GetTLSAddress()); |
| 660 | cpu_core.SetTPIDR_EL0(thread->GetTPIDR_EL0()); | 660 | cpu_core.SetTPIDR_EL0(thread->GetTPIDR_EL0()); |
| 661 | cpu_core.ChangeProcessorId(this->core_id); | ||
| 661 | cpu_core.ClearExclusiveState(); | 662 | cpu_core.ClearExclusiveState(); |
| 662 | } | 663 | } |
| 663 | } | 664 | } |