diff options
| author | 2018-12-03 12:25:27 -0500 | |
|---|---|---|
| committer | 2018-12-04 01:23:50 -0500 | |
| commit | 3e75175d0242090902e4b383086e3f5ac6cf3f73 (patch) | |
| tree | c6ff5eb9787f21284a5748ad210c866d32e04bcd /src/core/hle/kernel/thread.h | |
| parent | Merge pull request #1852 from VPeruS/fix-format-string (diff) | |
| download | yuzu-3e75175d0242090902e4b383086e3f5ac6cf3f73.tar.gz yuzu-3e75175d0242090902e4b383086e3f5ac6cf3f73.tar.xz yuzu-3e75175d0242090902e4b383086e3f5ac6cf3f73.zip | |
svc: Implement SetThreadActivity (thread suspension)
Diffstat (limited to 'src/core/hle/kernel/thread.h')
| -rw-r--r-- | src/core/hle/kernel/thread.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index d384d50db..268bf845b 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -44,6 +44,7 @@ enum ThreadProcessorId : s32 { | |||
| 44 | enum class ThreadStatus { | 44 | enum class ThreadStatus { |
| 45 | Running, ///< Currently running | 45 | Running, ///< Currently running |
| 46 | Ready, ///< Ready to run | 46 | Ready, ///< Ready to run |
| 47 | Paused, ///< Paused by SetThreadActivity or debug | ||
| 47 | WaitHLEEvent, ///< Waiting for hle event to finish | 48 | WaitHLEEvent, ///< Waiting for hle event to finish |
| 48 | WaitSleep, ///< Waiting due to a SleepThread SVC | 49 | WaitSleep, ///< Waiting due to a SleepThread SVC |
| 49 | WaitIPC, ///< Waiting for the reply from an IPC request | 50 | WaitIPC, ///< Waiting for the reply from an IPC request |
| @@ -60,6 +61,11 @@ enum class ThreadWakeupReason { | |||
| 60 | Timeout // The thread was woken up due to a wait timeout. | 61 | Timeout // The thread was woken up due to a wait timeout. |
| 61 | }; | 62 | }; |
| 62 | 63 | ||
| 64 | enum class ThreadActivity : u32 { | ||
| 65 | Normal = 0, | ||
| 66 | Paused = 1, | ||
| 67 | }; | ||
| 68 | |||
| 63 | class Thread final : public WaitObject { | 69 | class Thread final : public WaitObject { |
| 64 | public: | 70 | public: |
| 65 | using TLSMemory = std::vector<u8>; | 71 | using TLSMemory = std::vector<u8>; |
| @@ -370,6 +376,12 @@ public: | |||
| 370 | return affinity_mask; | 376 | return affinity_mask; |
| 371 | } | 377 | } |
| 372 | 378 | ||
| 379 | ThreadActivity GetActivity() const { | ||
| 380 | return activity; | ||
| 381 | } | ||
| 382 | |||
| 383 | void SetActivity(ThreadActivity value); | ||
| 384 | |||
| 373 | private: | 385 | private: |
| 374 | explicit Thread(KernelCore& kernel); | 386 | explicit Thread(KernelCore& kernel); |
| 375 | ~Thread() override; | 387 | ~Thread() override; |
| @@ -438,6 +450,8 @@ private: | |||
| 438 | TLSMemoryPtr tls_memory = std::make_shared<TLSMemory>(); | 450 | TLSMemoryPtr tls_memory = std::make_shared<TLSMemory>(); |
| 439 | 451 | ||
| 440 | std::string name; | 452 | std::string name; |
| 453 | |||
| 454 | ThreadActivity activity = ThreadActivity::Normal; | ||
| 441 | }; | 455 | }; |
| 442 | 456 | ||
| 443 | /** | 457 | /** |