summaryrefslogtreecommitdiffstats
path: root/src/core/cpu_manager.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-12-13 07:43:25 +0100
committerGitHub <noreply@github.com>2021-12-13 07:43:25 +0100
commit280c77989880e81f622440b157a0ce1b7139847b (patch)
tree49a3ef8127d721dc44effb8315e5db7e796336f4 /src/core/cpu_manager.cpp
parentMerge pull request #7495 from FernandoS27/text-blit-fix-again (diff)
parenthle: kernel k_scheduler: EnableScheduling: Remove redundant GetCurrentThreadPointer calls. (diff)
downloadyuzu-280c77989880e81f622440b157a0ce1b7139847b.tar
yuzu-280c77989880e81f622440b157a0ce1b7139847b.tar.gz
yuzu-280c77989880e81f622440b157a0ce1b7139847b.tar.bz2
yuzu-280c77989880e81f622440b157a0ce1b7139847b.tar.lz
yuzu-280c77989880e81f622440b157a0ce1b7139847b.tar.xz
yuzu-280c77989880e81f622440b157a0ce1b7139847b.tar.zst
yuzu-280c77989880e81f622440b157a0ce1b7139847b.zip
Diffstat (limited to '')
-rw-r--r--src/core/cpu_manager.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp
index 5d43c6e5d..cbcc54891 100644
--- a/src/core/cpu_manager.cpp
+++ b/src/core/cpu_manager.cpp
@@ -117,17 +117,18 @@ void CpuManager::MultiCoreRunGuestLoop() {
physical_core = &kernel.CurrentPhysicalCore();
}
system.ExitDynarmicProfile();
- physical_core->ArmInterface().ClearExclusiveState();
- kernel.CurrentScheduler()->RescheduleCurrentCore();
+ {
+ Kernel::KScopedDisableDispatch dd(kernel);
+ physical_core->ArmInterface().ClearExclusiveState();
+ }
}
}
void CpuManager::MultiCoreRunIdleThread() {
auto& kernel = system.Kernel();
while (true) {
- auto& physical_core = kernel.CurrentPhysicalCore();
- physical_core.Idle();
- kernel.CurrentScheduler()->RescheduleCurrentCore();
+ Kernel::KScopedDisableDispatch dd(kernel);
+ kernel.CurrentPhysicalCore().Idle();
}
}
@@ -135,12 +136,12 @@ void CpuManager::MultiCoreRunSuspendThread() {
auto& kernel = system.Kernel();
kernel.CurrentScheduler()->OnThreadStart();
while (true) {
- auto core = kernel.GetCurrentHostThreadID();
+ auto core = kernel.CurrentPhysicalCoreIndex();
auto& scheduler = *kernel.CurrentScheduler();
Kernel::KThread* current_thread = scheduler.GetCurrentThread();
Common::Fiber::YieldTo(current_thread->GetHostContext(), *core_data[core].host_context);
ASSERT(scheduler.ContextSwitchPending());
- ASSERT(core == kernel.GetCurrentHostThreadID());
+ ASSERT(core == kernel.CurrentPhysicalCoreIndex());
scheduler.RescheduleCurrentCore();
}
}
@@ -346,13 +347,9 @@ void CpuManager::RunThread(std::stop_token stop_token, std::size_t core) {
sc_sync_first_use = false;
}
- // Abort if emulation was killed before the session really starts
- if (!system.IsPoweredOn()) {
- return;
- }
-
+ // Emulation was stopped
if (stop_token.stop_requested()) {
- break;
+ return;
}
auto current_thread = system.Kernel().CurrentScheduler()->GetCurrentThread();