Browse Source
Merge pull request #12025 from liamwhite/kernel-shutdown-deadlock
core: check for thread dpc before eret
pull/15/merge
liamwhite
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
8 additions and
8 deletions
-
src/core/arm/arm_interface.cpp
|
|
|
@ -153,6 +153,14 @@ void ARM_Interface::Run() { |
|
|
|
Kernel::KThread* current_thread{Kernel::GetCurrentThreadPointer(system.Kernel())}; |
|
|
|
HaltReason hr{}; |
|
|
|
|
|
|
|
// If the thread is scheduled for termination, exit the thread.
|
|
|
|
if (current_thread->HasDpc()) { |
|
|
|
if (current_thread->IsTerminationRequested()) { |
|
|
|
current_thread->Exit(); |
|
|
|
UNREACHABLE(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Notify the debugger and go to sleep if a step was performed
|
|
|
|
// and this thread has been scheduled again.
|
|
|
|
if (current_thread->GetStepState() == StepState::StepPerformed) { |
|
|
|
@ -174,14 +182,6 @@ void ARM_Interface::Run() { |
|
|
|
} |
|
|
|
system.ExitCPUProfile(); |
|
|
|
|
|
|
|
// If the thread is scheduled for termination, exit the thread.
|
|
|
|
if (current_thread->HasDpc()) { |
|
|
|
if (current_thread->IsTerminationRequested()) { |
|
|
|
current_thread->Exit(); |
|
|
|
UNREACHABLE(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Notify the debugger and go to sleep if a breakpoint was hit,
|
|
|
|
// or if the thread is unable to continue for any reason.
|
|
|
|
if (True(hr & HaltReason::InstructionBreakpoint) || True(hr & HaltReason::PrefetchAbort)) { |
|
|
|
|