diff options
| author | 2021-01-24 22:55:08 -0800 | |
|---|---|---|
| committer | 2021-01-28 21:42:27 -0800 | |
| commit | 10738839ad7b9abbcf8ac64c6e58de63a9fbae76 (patch) | |
| tree | 50c525de5000eae32108a13b65f976088513a76b /src/core | |
| parent | hle: kernel: process: Add state lock. (diff) | |
| download | yuzu-10738839ad7b9abbcf8ac64c6e58de63a9fbae76.tar.gz yuzu-10738839ad7b9abbcf8ac64c6e58de63a9fbae76.tar.xz yuzu-10738839ad7b9abbcf8ac64c6e58de63a9fbae76.zip | |
yuzu: debugger: Ignore HLE threads.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/kernel/k_thread.cpp | 15 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_thread.h | 5 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp index f57e98047..45ad589d9 100644 --- a/src/core/hle/kernel/k_thread.cpp +++ b/src/core/hle/kernel/k_thread.cpp | |||
| @@ -101,11 +101,12 @@ ResultCode KThread::Initialize(KThreadFunction func, uintptr_t arg, VAddr user_s | |||
| 101 | UNREACHABLE_MSG("KThread::Initialize: Unknown ThreadType {}", static_cast<u32>(type)); | 101 | UNREACHABLE_MSG("KThread::Initialize: Unknown ThreadType {}", static_cast<u32>(type)); |
| 102 | break; | 102 | break; |
| 103 | } | 103 | } |
| 104 | thread_type_for_debugging = type; | ||
| 104 | 105 | ||
| 105 | // Set the ideal core ID and affinity mask. | 106 | // Set the ideal core ID and affinity mask. |
| 106 | virtual_ideal_core_id = virt_core; | 107 | virtual_ideal_core_id = virt_core; |
| 107 | physical_ideal_core_id = phys_core; | 108 | physical_ideal_core_id = phys_core; |
| 108 | virtual_affinity_mask = (static_cast<u64>(1) << virt_core); | 109 | virtual_affinity_mask = 1ULL << virt_core; |
| 109 | physical_affinity_mask.SetAffinity(phys_core, true); | 110 | physical_affinity_mask.SetAffinity(phys_core, true); |
| 110 | 111 | ||
| 111 | // Set the thread state. | 112 | // Set the thread state. |
| @@ -353,7 +354,7 @@ void KThread::Unpin() { | |||
| 353 | // Enable core migration. | 354 | // Enable core migration. |
| 354 | ASSERT(num_core_migration_disables == 1); | 355 | ASSERT(num_core_migration_disables == 1); |
| 355 | { | 356 | { |
| 356 | --num_core_migration_disables; | 357 | num_core_migration_disables--; |
| 357 | 358 | ||
| 358 | // Restore our original state. | 359 | // Restore our original state. |
| 359 | const KAffinityMask old_mask = physical_affinity_mask; | 360 | const KAffinityMask old_mask = physical_affinity_mask; |
| @@ -494,8 +495,8 @@ ResultCode KThread::SetCoreMask(s32 core_id, u64 v_affinity_mask) { | |||
| 494 | 495 | ||
| 495 | // Update the pinned waiter list. | 496 | // Update the pinned waiter list. |
| 496 | { | 497 | { |
| 497 | bool retry_update = false; | 498 | bool retry_update{}; |
| 498 | bool thread_is_pinned = false; | 499 | bool thread_is_pinned{}; |
| 499 | do { | 500 | do { |
| 500 | // Lock the scheduler. | 501 | // Lock the scheduler. |
| 501 | KScopedSchedulerLock sl{kernel}; | 502 | KScopedSchedulerLock sl{kernel}; |
| @@ -507,7 +508,7 @@ ResultCode KThread::SetCoreMask(s32 core_id, u64 v_affinity_mask) { | |||
| 507 | retry_update = false; | 508 | retry_update = false; |
| 508 | 509 | ||
| 509 | // Check if the thread is currently running. | 510 | // Check if the thread is currently running. |
| 510 | bool thread_is_current = false; | 511 | bool thread_is_current{}; |
| 511 | s32 thread_core; | 512 | s32 thread_core; |
| 512 | for (thread_core = 0; thread_core < static_cast<s32>(Core::Hardware::NUM_CPU_CORES); | 513 | for (thread_core = 0; thread_core < static_cast<s32>(Core::Hardware::NUM_CPU_CORES); |
| 513 | ++thread_core) { | 514 | ++thread_core) { |
| @@ -683,8 +684,8 @@ ResultCode KThread::SetActivity(Svc::ThreadActivity activity) { | |||
| 683 | 684 | ||
| 684 | // If the thread is now paused, update the pinned waiter list. | 685 | // If the thread is now paused, update the pinned waiter list. |
| 685 | if (activity == Svc::ThreadActivity::Paused) { | 686 | if (activity == Svc::ThreadActivity::Paused) { |
| 686 | bool thread_is_pinned = false; | 687 | bool thread_is_pinned{}; |
| 687 | bool thread_is_current; | 688 | bool thread_is_current{}; |
| 688 | do { | 689 | do { |
| 689 | // Lock the scheduler. | 690 | // Lock the scheduler. |
| 690 | KScopedSchedulerLock sl{kernel}; | 691 | KScopedSchedulerLock sl{kernel}; |
diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h index eeddf5a65..c8ac656a4 100644 --- a/src/core/hle/kernel/k_thread.h +++ b/src/core/hle/kernel/k_thread.h | |||
| @@ -534,6 +534,10 @@ public: | |||
| 534 | return wait_reason_for_debugging; | 534 | return wait_reason_for_debugging; |
| 535 | } | 535 | } |
| 536 | 536 | ||
| 537 | [[nodiscard]] ThreadType GetThreadTypeForDebugging() const { | ||
| 538 | return thread_type_for_debugging; | ||
| 539 | } | ||
| 540 | |||
| 537 | void SetWaitObjectsForDebugging(const std::span<KSynchronizationObject*>& objects) { | 541 | void SetWaitObjectsForDebugging(const std::span<KSynchronizationObject*>& objects) { |
| 538 | wait_objects_for_debugging.clear(); | 542 | wait_objects_for_debugging.clear(); |
| 539 | wait_objects_for_debugging.reserve(objects.size()); | 543 | wait_objects_for_debugging.reserve(objects.size()); |
| @@ -721,6 +725,7 @@ private: | |||
| 721 | std::vector<KSynchronizationObject*> wait_objects_for_debugging; | 725 | std::vector<KSynchronizationObject*> wait_objects_for_debugging; |
| 722 | VAddr mutex_wait_address_for_debugging{}; | 726 | VAddr mutex_wait_address_for_debugging{}; |
| 723 | ThreadWaitReasonForDebugging wait_reason_for_debugging{}; | 727 | ThreadWaitReasonForDebugging wait_reason_for_debugging{}; |
| 728 | ThreadType thread_type_for_debugging{}; | ||
| 724 | std::string name; | 729 | std::string name; |
| 725 | 730 | ||
| 726 | public: | 731 | public: |