From 6523854dd6ac2d202dacb2110bc83b8e61621e9a Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 7 Jul 2022 20:06:46 -0400 Subject: kernel: unlayer CPU interrupt handling --- src/core/debugger/debugger.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/core/debugger') diff --git a/src/core/debugger/debugger.cpp b/src/core/debugger/debugger.cpp index ac64d2f9d..e42bdd17d 100644 --- a/src/core/debugger/debugger.cpp +++ b/src/core/debugger/debugger.cpp @@ -15,6 +15,7 @@ #include "core/debugger/debugger_interface.h" #include "core/debugger/gdbstub.h" #include "core/hle/kernel/global_scheduler_context.h" +#include "core/hle/kernel/k_scheduler.h" template static void AsyncReceiveInto(Readable& r, Buffer& buffer, Callback&& c) { @@ -230,13 +231,12 @@ private: } void PauseEmulation() { + Kernel::KScopedSchedulerLock sl{system.Kernel()}; + // Put all threads to sleep on next scheduler round. for (auto* thread : ThreadList()) { thread->RequestSuspend(Kernel::SuspendType::Debug); } - - // Signal an interrupt so that scheduler will fire. - system.Kernel().InterruptAllPhysicalCores(); } void ResumeEmulation(Kernel::KThread* except = nullptr) { @@ -253,7 +253,8 @@ private: template void MarkResumed(Callback&& cb) { - std::scoped_lock lk{connection_lock}; + Kernel::KScopedSchedulerLock sl{system.Kernel()}; + std::scoped_lock cl{connection_lock}; stopped = false; cb(); } -- cgit v1.2.3