summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-03-10 18:24:52 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 17:35:59 +0200
commit9bde28d7b100fdcd1cc50c8f2a4b8c74704f5e34 (patch)
tree893f13cf4913b1793689d108183ff2038bb88e04 /src/core/hle/kernel
parentThread: Release the ARM Interface on exitting. (diff)
downloadyuzu-9bde28d7b100fdcd1cc50c8f2a4b8c74704f5e34.tar
yuzu-9bde28d7b100fdcd1cc50c8f2a4b8c74704f5e34.tar.gz
yuzu-9bde28d7b100fdcd1cc50c8f2a4b8c74704f5e34.tar.bz2
yuzu-9bde28d7b100fdcd1cc50c8f2a4b8c74704f5e34.tar.lz
yuzu-9bde28d7b100fdcd1cc50c8f2a4b8c74704f5e34.tar.xz
yuzu-9bde28d7b100fdcd1cc50c8f2a4b8c74704f5e34.tar.zst
yuzu-9bde28d7b100fdcd1cc50c8f2a4b8c74704f5e34.zip
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/kernel.cpp1
-rw-r--r--src/core/hle/kernel/scheduler.cpp7
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 {
for (std::size_t i = 0; i < cores.size(); i++) {
cores[i].Shutdown();
+ schedulers[i].reset();
}
cores.clear();
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() {
thread->SetContinuousOnSVC(false);
thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
thread->SetIsRunning(false);
- if (!thread->IsHLEThread()) {
- auto& cpu_core = system.ArmInterface(core_id);
+ if (!thread->IsHLEThread() && !thread->HasExited()) {
+ Core::ARM_Interface& cpu_core = thread->ArmInterface();
cpu_core.SaveContext(thread->GetContext32());
cpu_core.SaveContext(thread->GetContext64());
// Save the TPIDR_EL0 system register in case it was modified.
@@ -653,11 +653,12 @@ void Scheduler::Reload() {
system.Kernel().MakeCurrentProcess(thread_owner_process);
}
if (!thread->IsHLEThread()) {
- auto& cpu_core = system.ArmInterface(core_id);
+ Core::ARM_Interface& cpu_core = thread->ArmInterface();
cpu_core.LoadContext(thread->GetContext32());
cpu_core.LoadContext(thread->GetContext64());
cpu_core.SetTlsAddress(thread->GetTLSAddress());
cpu_core.SetTPIDR_EL0(thread->GetTPIDR_EL0());
+ cpu_core.ChangeProcessorId(this->core_id);
cpu_core.ClearExclusiveState();
}
}