diff options
| author | 2018-10-25 18:42:50 -0400 | |
|---|---|---|
| committer | 2018-10-26 12:49:11 -0400 | |
| commit | 6594853eb112f265fe2354723160c0d4e1cb761a (patch) | |
| tree | 60e67d4d7f38d8f1fe5bebe01f3ef0d87881c570 /src/core/hle/kernel/thread.h | |
| parent | Merge pull request #1533 from FernandoS27/lmem (diff) | |
| download | yuzu-6594853eb112f265fe2354723160c0d4e1cb761a.tar.gz yuzu-6594853eb112f265fe2354723160c0d4e1cb761a.tar.xz yuzu-6594853eb112f265fe2354723160c0d4e1cb761a.zip | |
svc: Implement svcGetInfo command 0xF0000002
This retrieves:
if (curr_thread == handle_thread) {
result = total_thread_ticks + (hardware_tick_count - last_context_switch_ticks);
} else if (curr_thread == handle_thread && sub_id == current_core_index) {
result = hardware_tick_count - last_context_switch_ticks;
}
Diffstat (limited to 'src/core/hle/kernel/thread.h')
| -rw-r--r-- | src/core/hle/kernel/thread.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index f4d7bd235..4a6e11239 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -258,6 +258,14 @@ public: | |||
| 258 | return last_running_ticks; | 258 | return last_running_ticks; |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | u64 GetTotalCPUTimeTicks() const { | ||
| 262 | return total_cpu_time_ticks; | ||
| 263 | } | ||
| 264 | |||
| 265 | void UpdateCPUTimeTicks(u64 ticks) { | ||
| 266 | total_cpu_time_ticks += ticks; | ||
| 267 | } | ||
| 268 | |||
| 261 | s32 GetProcessorID() const { | 269 | s32 GetProcessorID() const { |
| 262 | return processor_id; | 270 | return processor_id; |
| 263 | } | 271 | } |
| @@ -378,7 +386,8 @@ private: | |||
| 378 | u32 nominal_priority = 0; ///< Nominal thread priority, as set by the emulated application | 386 | u32 nominal_priority = 0; ///< Nominal thread priority, as set by the emulated application |
| 379 | u32 current_priority = 0; ///< Current thread priority, can be temporarily changed | 387 | u32 current_priority = 0; ///< Current thread priority, can be temporarily changed |
| 380 | 388 | ||
| 381 | u64 last_running_ticks = 0; ///< CPU tick when thread was last running | 389 | u64 total_cpu_time_ticks = 0; ///< Total CPU running ticks. |
| 390 | u64 last_running_ticks = 0; ///< CPU tick when thread was last running | ||
| 382 | 391 | ||
| 383 | s32 processor_id = 0; | 392 | s32 processor_id = 0; |
| 384 | 393 | ||