diff options
author | bunnei <bunneidev@gmail.com> | 2015-04-10 05:05:49 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-04-10 05:05:49 +0200 |
commit | 6f1143885bcc02642b707b51355fe4b6cd5375c7 (patch) | |
tree | fe1307919e7087df41c498b971016ffa931d6594 /src/core/hle/kernel/thread.h | |
parent | Merge pull request #690 from Zaneo/sharedmemory (diff) | |
parent | SVC: Assert on unsupported CreateThread processor ID. (diff) | |
download | yuzu-6f1143885bcc02642b707b51355fe4b6cd5375c7.tar yuzu-6f1143885bcc02642b707b51355fe4b6cd5375c7.tar.gz yuzu-6f1143885bcc02642b707b51355fe4b6cd5375c7.tar.bz2 yuzu-6f1143885bcc02642b707b51355fe4b6cd5375c7.tar.lz yuzu-6f1143885bcc02642b707b51355fe4b6cd5375c7.tar.xz yuzu-6f1143885bcc02642b707b51355fe4b6cd5375c7.tar.zst yuzu-6f1143885bcc02642b707b51355fe4b6cd5375c7.zip |
Diffstat (limited to 'src/core/hle/kernel/thread.h')
-rw-r--r-- | src/core/hle/kernel/thread.h | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index cfd073a70..233bcbdbd 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h @@ -17,17 +17,19 @@ #include "core/hle/kernel/kernel.h" #include "core/hle/result.h" -enum ThreadPriority { - THREADPRIO_HIGHEST = 0, ///< Highest thread priority - THREADPRIO_DEFAULT = 16, ///< Default thread priority for userland apps - THREADPRIO_LOW = 31, ///< Low range of thread priority for userland apps - THREADPRIO_LOWEST = 63, ///< Thread priority max checked by svcCreateThread +enum ThreadPriority : s32{ + THREADPRIO_HIGHEST = 0, ///< Highest thread priority + THREADPRIO_USERLAND_MAX = 24, ///< Highest thread priority for userland apps + THREADPRIO_DEFAULT = 48, ///< Default thread priority for userland apps + THREADPRIO_LOWEST = 63, ///< Lowest thread priority }; -enum ThreadProcessorId { - THREADPROCESSORID_0 = 0xFFFFFFFE, ///< Enables core appcode - THREADPROCESSORID_1 = 0xFFFFFFFD, ///< Enables core syscore - THREADPROCESSORID_ALL = 0xFFFFFFFC, ///< Enables both cores +enum ThreadProcessorId : s32 { + THREADPROCESSORID_DEFAULT = -2, ///< Run thread on default core specified by exheader + THREADPROCESSORID_ALL = -1, ///< Run thread on either core + THREADPROCESSORID_0 = 0, ///< Run thread on core 0 (AppCore) + THREADPROCESSORID_1 = 1, ///< Run thread on core 1 (SysCore) + THREADPROCESSORID_MAX = 2, ///< Processor ID must be less than this }; enum ThreadStatus { @@ -88,6 +90,12 @@ public: void SetPriority(s32 priority); /** + * Temporarily boosts the thread's priority until the next time it is scheduled + * @param priority The new priority + */ + void BoostPriority(s32 priority); + + /** * Gets the thread's thread ID * @return The thread's ID */ @@ -135,8 +143,10 @@ public: u32 entry_point; u32 stack_top; - s32 initial_priority; - s32 current_priority; + s32 nominal_priority; ///< Nominal thread priority, as set by the emulated application + s32 current_priority; ///< Current thread priority, can be temporarily changed + + u64 last_running_ticks; ///< CPU tick when thread was last running s32 processor_id; |