diff options
| author | 2022-08-07 17:48:55 -0700 | |
|---|---|---|
| committer | 2022-08-07 17:48:55 -0700 | |
| commit | 01bb5d5c4d10424145739e4dd50c0a92547ca240 (patch) | |
| tree | 403f5ae1f6ea1d4555a40dbea0f2c44183292aba /src/core/debugger/debugger.cpp | |
| parent | Merge pull request #8240 from liamwhite/count-cycles (diff) | |
| parent | kernel: unlayer CPU interrupt handling (diff) | |
| download | yuzu-01bb5d5c4d10424145739e4dd50c0a92547ca240.tar.gz yuzu-01bb5d5c4d10424145739e4dd50c0a92547ca240.tar.xz yuzu-01bb5d5c4d10424145739e4dd50c0a92547ca240.zip | |
Merge pull request #8637 from liamwhite/bad-interrupts
kernel: unlayer CPU interrupt handling
Diffstat (limited to 'src/core/debugger/debugger.cpp')
| -rw-r--r-- | src/core/debugger/debugger.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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 @@ | |||
| 15 | #include "core/debugger/debugger_interface.h" | 15 | #include "core/debugger/debugger_interface.h" |
| 16 | #include "core/debugger/gdbstub.h" | 16 | #include "core/debugger/gdbstub.h" |
| 17 | #include "core/hle/kernel/global_scheduler_context.h" | 17 | #include "core/hle/kernel/global_scheduler_context.h" |
| 18 | #include "core/hle/kernel/k_scheduler.h" | ||
| 18 | 19 | ||
| 19 | template <typename Readable, typename Buffer, typename Callback> | 20 | template <typename Readable, typename Buffer, typename Callback> |
| 20 | static void AsyncReceiveInto(Readable& r, Buffer& buffer, Callback&& c) { | 21 | static void AsyncReceiveInto(Readable& r, Buffer& buffer, Callback&& c) { |
| @@ -230,13 +231,12 @@ private: | |||
| 230 | } | 231 | } |
| 231 | 232 | ||
| 232 | void PauseEmulation() { | 233 | void PauseEmulation() { |
| 234 | Kernel::KScopedSchedulerLock sl{system.Kernel()}; | ||
| 235 | |||
| 233 | // Put all threads to sleep on next scheduler round. | 236 | // Put all threads to sleep on next scheduler round. |
| 234 | for (auto* thread : ThreadList()) { | 237 | for (auto* thread : ThreadList()) { |
| 235 | thread->RequestSuspend(Kernel::SuspendType::Debug); | 238 | thread->RequestSuspend(Kernel::SuspendType::Debug); |
| 236 | } | 239 | } |
| 237 | |||
| 238 | // Signal an interrupt so that scheduler will fire. | ||
| 239 | system.Kernel().InterruptAllPhysicalCores(); | ||
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | void ResumeEmulation(Kernel::KThread* except = nullptr) { | 242 | void ResumeEmulation(Kernel::KThread* except = nullptr) { |
| @@ -253,7 +253,8 @@ private: | |||
| 253 | 253 | ||
| 254 | template <typename Callback> | 254 | template <typename Callback> |
| 255 | void MarkResumed(Callback&& cb) { | 255 | void MarkResumed(Callback&& cb) { |
| 256 | std::scoped_lock lk{connection_lock}; | 256 | Kernel::KScopedSchedulerLock sl{system.Kernel()}; |
| 257 | std::scoped_lock cl{connection_lock}; | ||
| 257 | stopped = false; | 258 | stopped = false; |
| 258 | cb(); | 259 | cb(); |
| 259 | } | 260 | } |