summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-02-27 16:25:42 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 17:35:19 +0200
commitbd36eaf15d88c3875aba7032fe5124fbb150bd5d (patch)
treea6bad69cf31a39e0286d4cd14d404497ecfb9c42 /src
parentNVFlinger: Lock race condition between CPU, Host Timing, VSync. (diff)
downloadyuzu-bd36eaf15d88c3875aba7032fe5124fbb150bd5d.tar
yuzu-bd36eaf15d88c3875aba7032fe5124fbb150bd5d.tar.gz
yuzu-bd36eaf15d88c3875aba7032fe5124fbb150bd5d.tar.bz2
yuzu-bd36eaf15d88c3875aba7032fe5124fbb150bd5d.tar.lz
yuzu-bd36eaf15d88c3875aba7032fe5124fbb150bd5d.tar.xz
yuzu-bd36eaf15d88c3875aba7032fe5124fbb150bd5d.tar.zst
yuzu-bd36eaf15d88c3875aba7032fe5124fbb150bd5d.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/cpu_manager.cpp11
-rw-r--r--src/core/hle/kernel/svc.cpp9
2 files changed, 10 insertions, 10 deletions
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp
index 241971ff3..904aacd97 100644
--- a/src/core/cpu_manager.cpp
+++ b/src/core/cpu_manager.cpp
@@ -79,12 +79,13 @@ void CpuManager::RunGuestThread() {
sched.OnThreadStart();
}
while (true) {
- auto& physical_core = kernel.CurrentPhysicalCore();
- while (!physical_core.IsInterrupted()) {
- physical_core.Run();
+ auto* physical_core = &kernel.CurrentPhysicalCore();
+ while (!physical_core->IsInterrupted()) {
+ physical_core->Run();
+ physical_core = &kernel.CurrentPhysicalCore();
}
- physical_core.ClearExclusive();
- auto& scheduler = physical_core.Scheduler();
+ physical_core->ClearExclusive();
+ auto& scheduler = physical_core->Scheduler();
scheduler.TryDoContextSwitch();
}
}
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 279fe5888..1e6c60d78 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -2454,11 +2454,6 @@ void Call(Core::System& system, u32 immediate) {
MICROPROFILE_SCOPE(Kernel_SVC);
auto& physical_core = system.CurrentPhysicalCore();
- if (physical_core.IsInterrupted()) {
- auto& sched = physical_core.Scheduler();
- sched.TryDoContextSwitch();
- }
- physical_core.ClearExclusive();
const FunctionDef* info = system.CurrentProcess()->Is64BitProcess() ? GetSVCInfo64(immediate)
: GetSVCInfo32(immediate);
@@ -2471,6 +2466,10 @@ void Call(Core::System& system, u32 immediate) {
} else {
LOG_CRITICAL(Kernel_SVC, "Unknown SVC function 0x{:X}", immediate);
}
+ auto& physical_core_2 = system.CurrentPhysicalCore();
+ if (physical_core.CoreIndex() != physical_core_2.CoreIndex()) {
+ physical_core.Stop();
+ }
}
} // namespace Kernel::Svc