Browse Source

kernel/thread: Update thread processor ID flags

Adds the missing flags to the enum and documents them.
nce_cpp
Lioncash 7 years ago
parent
commit
9f8d31a803
  1. 2
      src/core/hle/kernel/svc.cpp
  2. 11
      src/core/hle/kernel/thread.h

2
src/core/hle/kernel/svc.cpp

@ -1776,7 +1776,7 @@ static ResultCode SetThreadCoreMask(Core::System& system, Handle thread_handle,
if (core == OnlyChangeMask) {
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);
return ERR_INVALID_PROCESSOR_ID;
}

11
src/core/hle/kernel/thread.h

@ -30,7 +30,16 @@ enum ThreadPriority : u32 {
};
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_DONT_CARE = -1,
/// Run thread on the ideal core specified by the process.
THREADPROCESSORID_IDEAL = -2,
/// 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

Loading…
Cancel
Save