diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/arm/arm_interface.cpp | 16 | ||||
-rw-r--r-- | src/core/core_timing.cpp | 2 | ||||
-rw-r--r-- | src/core/core_timing.h | 2 | ||||
-rw-r--r-- | src/core/hle/kernel/k_page_table_base.cpp | 4 |
4 files changed, 13 insertions, 11 deletions
diff --git a/src/core/arm/arm_interface.cpp b/src/core/arm/arm_interface.cpp index 5e27dde58..558fba5bd 100644 --- a/src/core/arm/arm_interface.cpp +++ b/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)) { diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index e671b270f..d6b5abc68 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -76,6 +76,7 @@ void CoreTiming::Initialize(std::function<void()>&& on_thread_init_) { } void CoreTiming::ClearPendingEvents() { + std::scoped_lock lock{basic_lock}; event_queue.clear(); } @@ -113,6 +114,7 @@ bool CoreTiming::IsRunning() const { } bool CoreTiming::HasPendingEvents() const { + std::scoped_lock lock{basic_lock}; return !(wait_set && event_queue.empty()); } diff --git a/src/core/core_timing.h b/src/core/core_timing.h index 26a8b93a7..21548f0a9 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h @@ -161,7 +161,7 @@ private: std::shared_ptr<EventType> ev_lost; Common::Event event{}; Common::Event pause_event{}; - std::mutex basic_lock; + mutable std::mutex basic_lock; std::mutex advance_lock; std::unique_ptr<std::jthread> timer_thread; std::atomic<bool> paused{}; diff --git a/src/core/hle/kernel/k_page_table_base.cpp b/src/core/hle/kernel/k_page_table_base.cpp index 6a57ad55c..47dc8fd35 100644 --- a/src/core/hle/kernel/k_page_table_base.cpp +++ b/src/core/hle/kernel/k_page_table_base.cpp @@ -1617,9 +1617,9 @@ void KPageTableBase::RemapPageGroup(PageLinkedList* page_list, KProcessAddress a const KMemoryInfo info = it->GetMemoryInfo(); // Determine the range to map. - KProcessAddress map_address = std::max(info.GetAddress(), GetInteger(start_address)); + KProcessAddress map_address = std::max<u64>(info.GetAddress(), GetInteger(start_address)); const KProcessAddress map_end_address = - std::min(info.GetEndAddress(), GetInteger(end_address)); + std::min<u64>(info.GetEndAddress(), GetInteger(end_address)); ASSERT(map_end_address != map_address); // Determine if we should disable head merge. |