diff options
| author | 2020-11-28 11:54:41 -0800 | |
|---|---|---|
| committer | 2020-12-06 00:03:24 -0800 | |
| commit | d58a609ae43d2a1db296e90cb87dcfa3e4d4e7f3 (patch) | |
| tree | b233d4ab29bd212320a30e91f17571d5bfe25329 /src/core/hle/kernel | |
| parent | hle: kernel: svc: Remove unnecessary hack in svcSleep. (diff) | |
| download | yuzu-d58a609ae43d2a1db296e90cb87dcfa3e4d4e7f3.tar.gz yuzu-d58a609ae43d2a1db296e90cb87dcfa3e4d4e7f3.tar.xz yuzu-d58a609ae43d2a1db296e90cb87dcfa3e4d4e7f3.zip | |
hle: kernel: process: Add schedule count tracking, to be used for yield impl.
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/process.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index f45cb5674..36d8547bd 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h | |||
| @@ -216,6 +216,16 @@ public: | |||
| 216 | total_process_running_time_ticks += ticks; | 216 | total_process_running_time_ticks += ticks; |
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | /// Gets the process schedule count, used for thread yelding | ||
| 220 | constexpr s64 GetScheduledCount() const { | ||
| 221 | return schedule_count; | ||
| 222 | } | ||
| 223 | |||
| 224 | /// Increments the process schedule count, used for thread yielding. | ||
| 225 | constexpr void IncrementScheduledCount() { | ||
| 226 | ++schedule_count; | ||
| 227 | } | ||
| 228 | |||
| 219 | /// Gets 8 bytes of random data for svcGetInfo RandomEntropy | 229 | /// Gets 8 bytes of random data for svcGetInfo RandomEntropy |
| 220 | u64 GetRandomEntropy(std::size_t index) const { | 230 | u64 GetRandomEntropy(std::size_t index) const { |
| 221 | return random_entropy.at(index); | 231 | return random_entropy.at(index); |
| @@ -397,6 +407,9 @@ private: | |||
| 397 | /// Name of this process | 407 | /// Name of this process |
| 398 | std::string name; | 408 | std::string name; |
| 399 | 409 | ||
| 410 | /// Schedule count of this process | ||
| 411 | s64 schedule_count{}; | ||
| 412 | |||
| 400 | /// System context | 413 | /// System context |
| 401 | Core::System& system; | 414 | Core::System& system; |
| 402 | }; | 415 | }; |