diff options
Diffstat (limited to 'src/core/hle/kernel/thread.h')
| -rw-r--r-- | src/core/hle/kernel/thread.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 820ea524f..6b66c9a0e 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -114,6 +114,16 @@ enum class ThreadSchedFlags : u32 { | |||
| 114 | KernelInitPauseFlag = 1 << 8, | 114 | KernelInitPauseFlag = 1 << 8, |
| 115 | }; | 115 | }; |
| 116 | 116 | ||
| 117 | enum class ThreadWaitReasonForDebugging : u32 { | ||
| 118 | None, ///< Thread is not waiting | ||
| 119 | Sleep, ///< Thread is waiting due to a SleepThread SVC | ||
| 120 | IPC, ///< Thread is waiting for the reply from an IPC request | ||
| 121 | Synchronization, ///< Thread is waiting due to a WaitSynchronization SVC | ||
| 122 | ConditionVar, ///< Thread is waiting due to a WaitProcessWideKey SVC | ||
| 123 | Arbitration, ///< Thread is waiting due to a SignalToAddress/WaitForAddress SVC | ||
| 124 | Suspended, ///< Thread is waiting due to process suspension | ||
| 125 | }; | ||
| 126 | |||
| 117 | class Thread final : public KSynchronizationObject, public boost::intrusive::list_base_hook<> { | 127 | class Thread final : public KSynchronizationObject, public boost::intrusive::list_base_hook<> { |
| 118 | friend class KScheduler; | 128 | friend class KScheduler; |
| 119 | friend class Process; | 129 | friend class Process; |
| @@ -515,6 +525,14 @@ public: | |||
| 515 | disable_count--; | 525 | disable_count--; |
| 516 | } | 526 | } |
| 517 | 527 | ||
| 528 | void SetWaitReasonForDebugging(ThreadWaitReasonForDebugging reason) { | ||
| 529 | wait_reason_for_debugging = reason; | ||
| 530 | } | ||
| 531 | |||
| 532 | [[nodiscard]] ThreadWaitReasonForDebugging GetWaitReasonForDebugging() const { | ||
| 533 | return wait_reason_for_debugging; | ||
| 534 | } | ||
| 535 | |||
| 518 | void SetWaitObjectsForDebugging(const std::span<KSynchronizationObject*>& objects) { | 536 | void SetWaitObjectsForDebugging(const std::span<KSynchronizationObject*>& objects) { |
| 519 | wait_objects_for_debugging.clear(); | 537 | wait_objects_for_debugging.clear(); |
| 520 | wait_objects_for_debugging.reserve(objects.size()); | 538 | wait_objects_for_debugging.reserve(objects.size()); |
| @@ -708,6 +726,9 @@ private: | |||
| 708 | /// The current mutex wait address. This is used for debugging only. | 726 | /// The current mutex wait address. This is used for debugging only. |
| 709 | VAddr mutex_wait_address_for_debugging{}; | 727 | VAddr mutex_wait_address_for_debugging{}; |
| 710 | 728 | ||
| 729 | /// The reason the thread is waiting. This is used for debugging only. | ||
| 730 | ThreadWaitReasonForDebugging wait_reason_for_debugging{}; | ||
| 731 | |||
| 711 | KSynchronizationObject* signaling_object; | 732 | KSynchronizationObject* signaling_object; |
| 712 | ResultCode signaling_result{RESULT_SUCCESS}; | 733 | ResultCode signaling_result{RESULT_SUCCESS}; |
| 713 | 734 | ||