diff options
| author | 2015-03-23 23:55:21 -0400 | |
|---|---|---|
| committer | 2015-04-09 19:05:21 -0400 | |
| commit | 7b9f428b23e1761e7b6c177d2e8eb9219ac6b7f6 (patch) | |
| tree | 597dff81a4b2935daaa7890c932b00cea4d6ae53 /src/core/hle/kernel/thread.h | |
| parent | SVC: Reschedule on svcCreateThread. (diff) | |
| download | yuzu-7b9f428b23e1761e7b6c177d2e8eb9219ac6b7f6.tar.gz yuzu-7b9f428b23e1761e7b6c177d2e8eb9219ac6b7f6.tar.xz yuzu-7b9f428b23e1761e7b6c177d2e8eb9219ac6b7f6.zip | |
Thread: Implement priority boost for starved threads.
SVC: Return correct error code on invalid CreateThread processor ID.
SVC: Assert when creating a thread with an invalid userland priority.
Diffstat (limited to 'src/core/hle/kernel/thread.h')
| -rw-r--r-- | src/core/hle/kernel/thread.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index bde4eecf2..92f2c423b 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -17,16 +17,19 @@ | |||
| 17 | #include "core/hle/kernel/kernel.h" | 17 | #include "core/hle/kernel/kernel.h" |
| 18 | #include "core/hle/result.h" | 18 | #include "core/hle/result.h" |
| 19 | 19 | ||
| 20 | enum ThreadPriority { | 20 | enum ThreadPriority : s32{ |
| 21 | THREADPRIO_HIGHEST = 0x0, ///< Highest thread priority | 21 | THREADPRIO_HIGHEST = 0, ///< Highest thread priority |
| 22 | THREADPRIO_DEFAULT = 0x30, ///< Default thread priority for userland apps | 22 | THREADPRIO_USERLAND_MAX = 24, ///< Highest thread priority for userland apps |
| 23 | THREADPRIO_LOWEST = 0x3F, ///< Lowest thread priority | 23 | THREADPRIO_DEFAULT = 48, ///< Default thread priority for userland apps |
| 24 | THREADPRIO_LOWEST = 63, ///< Lowest thread priority | ||
| 24 | }; | 25 | }; |
| 25 | 26 | ||
| 26 | enum ThreadProcessorId { | 27 | enum ThreadProcessorId : s32 { |
| 27 | THREADPROCESSORID_0 = 0xFFFFFFFE, ///< Enables core appcode | 28 | THREADPROCESSORID_DEFAULT = -2, ///< Run thread on default core specified by exheader |
| 28 | THREADPROCESSORID_1 = 0xFFFFFFFD, ///< Enables core syscore | 29 | THREADPROCESSORID_ALL = -1, ///< Run thread on either core |
| 29 | THREADPROCESSORID_ALL = 0xFFFFFFFC, ///< Enables both cores | 30 | THREADPROCESSORID_0 = 0, ///< Run thread on core 0 (AppCore) |
| 31 | THREADPROCESSORID_1 = 1, ///< Run thread on core 1 (SysCore) | ||
| 32 | THREADPROCESSORID_MAX = 2, ///< Processor ID must be less than this | ||
| 30 | }; | 33 | }; |
| 31 | 34 | ||
| 32 | enum ThreadStatus { | 35 | enum ThreadStatus { |
| @@ -134,8 +137,10 @@ public: | |||
| 134 | u32 entry_point; | 137 | u32 entry_point; |
| 135 | u32 stack_top; | 138 | u32 stack_top; |
| 136 | 139 | ||
| 137 | s32 initial_priority; | 140 | s32 nominal_priority; ///< Nominal thread priority, as set by the emulated application |
| 138 | s32 current_priority; | 141 | s32 current_priority; ///< Current thread priority, can be temporarily changed |
| 142 | |||
| 143 | u64 last_running_ticks; ///< CPU tick when thread was last running | ||
| 139 | 144 | ||
| 140 | s32 processor_id; | 145 | s32 processor_id; |
| 141 | 146 | ||