Skip to content
Snippets Groups Projects
Commit 69a2003a authored by Lioncash's avatar Lioncash
Browse files

kernel/thread: Update thread processor ID flags

Adds the missing flags to the enum and documents them.
parent 1f4dfb39
No related branches found
No related tags found
No related merge requests found
...@@ -1776,7 +1776,7 @@ static ResultCode SetThreadCoreMask(Core::System& system, Handle thread_handle, ...@@ -1776,7 +1776,7 @@ static ResultCode SetThreadCoreMask(Core::System& system, Handle thread_handle,
if (core == OnlyChangeMask) { if (core == OnlyChangeMask) {
core = thread->GetIdealCore(); core = thread->GetIdealCore();
} else if (core >= Core::NUM_CPU_CORES && core != static_cast<u32>(-1)) { } else if (core >= Core::NUM_CPU_CORES && core != static_cast<u32>(THREADPROCESSORID_DONT_UPDATE)) {
LOG_ERROR(Kernel_SVC, "Invalid core specified, got {}", core); LOG_ERROR(Kernel_SVC, "Invalid core specified, got {}", core);
return ERR_INVALID_PROCESSOR_ID; return ERR_INVALID_PROCESSOR_ID;
} }
......
...@@ -30,12 +30,21 @@ enum ThreadPriority : u32 { ...@@ -30,12 +30,21 @@ enum ThreadPriority : u32 {
}; };
enum ThreadProcessorId : s32 { enum ThreadProcessorId : s32 {
THREADPROCESSORID_IDEAL = -2, ///< Run thread on the ideal core specified by the process. /// Indicates that no particular processor core is preferred.
THREADPROCESSORID_0 = 0, ///< Run thread on core 0 THREADPROCESSORID_DONT_CARE = -1,
THREADPROCESSORID_1 = 1, ///< Run thread on core 1
THREADPROCESSORID_2 = 2, ///< Run thread on core 2 /// Run thread on the ideal core specified by the process.
THREADPROCESSORID_3 = 3, ///< Run thread on core 3 THREADPROCESSORID_IDEAL = -2,
THREADPROCESSORID_MAX = 4, ///< Processor ID must be less than this
/// Indicates that the preferred processor ID shouldn't be updated in
/// a core mask setting operation.
THREADPROCESSORID_DONT_UPDATE = -3,
THREADPROCESSORID_0 = 0, ///< Run thread on core 0
THREADPROCESSORID_1 = 1, ///< Run thread on core 1
THREADPROCESSORID_2 = 2, ///< Run thread on core 2
THREADPROCESSORID_3 = 3, ///< Run thread on core 3
THREADPROCESSORID_MAX = 4, ///< Processor ID must be less than this
/// Allowed CPU mask /// Allowed CPU mask
THREADPROCESSORID_DEFAULT_MASK = (1 << THREADPROCESSORID_0) | (1 << THREADPROCESSORID_1) | THREADPROCESSORID_DEFAULT_MASK = (1 << THREADPROCESSORID_0) | (1 << THREADPROCESSORID_1) |
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment