diff options
author | bunnei <bunneidev@gmail.com> | 2021-01-10 23:29:02 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-01-11 23:23:17 +0100 |
commit | 03dfc8d8e74910d447b755e00848a623ec65cd93 (patch) | |
tree | 56a80760bd0ba8ecd85dc8d9f09fb9e2068c91d4 /src/core/hle/kernel/thread.h | |
parent | yuzu: debugger: wait_tree: Handle unknown ThreadState. (diff) | |
download | yuzu-03dfc8d8e74910d447b755e00848a623ec65cd93.tar yuzu-03dfc8d8e74910d447b755e00848a623ec65cd93.tar.gz yuzu-03dfc8d8e74910d447b755e00848a623ec65cd93.tar.bz2 yuzu-03dfc8d8e74910d447b755e00848a623ec65cd93.tar.lz yuzu-03dfc8d8e74910d447b755e00848a623ec65cd93.tar.xz yuzu-03dfc8d8e74910d447b755e00848a623ec65cd93.tar.zst yuzu-03dfc8d8e74910d447b755e00848a623ec65cd93.zip |
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 { KernelInitPauseFlag = 1 << 8, }; +enum class ThreadWaitReasonForDebugging : u32 { + None, ///< Thread is not waiting + Sleep, ///< Thread is waiting due to a SleepThread SVC + IPC, ///< Thread is waiting for the reply from an IPC request + Synchronization, ///< Thread is waiting due to a WaitSynchronization SVC + ConditionVar, ///< Thread is waiting due to a WaitProcessWideKey SVC + Arbitration, ///< Thread is waiting due to a SignalToAddress/WaitForAddress SVC + Suspended, ///< Thread is waiting due to process suspension +}; + class Thread final : public KSynchronizationObject, public boost::intrusive::list_base_hook<> { friend class KScheduler; friend class Process; @@ -515,6 +525,14 @@ public: disable_count--; } + void SetWaitReasonForDebugging(ThreadWaitReasonForDebugging reason) { + wait_reason_for_debugging = reason; + } + + [[nodiscard]] ThreadWaitReasonForDebugging GetWaitReasonForDebugging() const { + return wait_reason_for_debugging; + } + void SetWaitObjectsForDebugging(const std::span<KSynchronizationObject*>& objects) { wait_objects_for_debugging.clear(); wait_objects_for_debugging.reserve(objects.size()); @@ -708,6 +726,9 @@ private: /// The current mutex wait address. This is used for debugging only. VAddr mutex_wait_address_for_debugging{}; + /// The reason the thread is waiting. This is used for debugging only. + ThreadWaitReasonForDebugging wait_reason_for_debugging{}; + KSynchronizationObject* signaling_object; ResultCode signaling_result{RESULT_SUCCESS}; |