summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/hle/kernel/thread.cpp6
-rw-r--r--src/core/hle/kernel/thread.h9
2 files changed, 6 insertions, 9 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 3408658e5..aeb20b24b 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -410,7 +410,7 @@ ResultCode Thread::SetCoreAndAffinityMask(s32 new_core, u64 new_affinity_mask) {
410 }; 410 };
411 411
412 const bool use_override = affinity_override_count != 0; 412 const bool use_override = affinity_override_count != 0;
413 if (new_core == static_cast<s32>(CoreFlags::DontChangeIdealCore)) { 413 if (new_core == THREADDONTCHANGE_IDEAL) {
414 new_core = use_override ? ideal_core_override : ideal_core; 414 new_core = use_override ? ideal_core_override : ideal_core;
415 if ((new_affinity_mask & (1ULL << new_core)) == 0) { 415 if ((new_affinity_mask & (1ULL << new_core)) == 0) {
416 return ERR_INVALID_COMBINATION; 416 return ERR_INVALID_COMBINATION;
@@ -452,7 +452,7 @@ void Thread::AdjustSchedulingOnStatus(u32 old_flags) {
452 452
453 for (s32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) { 453 for (s32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) {
454 if (core != processor_id && ((affinity_mask >> core) & 1) != 0) { 454 if (core != processor_id && ((affinity_mask >> core) & 1) != 0) {
455 scheduler.Unsuggest(current_priority, core, this); 455 scheduler.Unsuggest(current_priority, static_cast<u32>(core), this);
456 } 456 }
457 } 457 }
458 } else if (GetSchedulingStatus() == ThreadSchedStatus::Runnable) { 458 } else if (GetSchedulingStatus() == ThreadSchedStatus::Runnable) {
@@ -463,7 +463,7 @@ void Thread::AdjustSchedulingOnStatus(u32 old_flags) {
463 463
464 for (s32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) { 464 for (s32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) {
465 if (core != processor_id && ((affinity_mask >> core) & 1) != 0) { 465 if (core != processor_id && ((affinity_mask >> core) & 1) != 0) {
466 scheduler.Suggest(current_priority, core, this); 466 scheduler.Suggest(current_priority, static_cast<u32>(core), this);
467 } 467 }
468 } 468 }
469 } 469 }
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index e0f3b6204..7ee437e17 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -35,6 +35,9 @@ enum ThreadProcessorId : s32 {
35 /// Run thread on the ideal core specified by the process. 35 /// Run thread on the ideal core specified by the process.
36 THREADPROCESSORID_IDEAL = -2, 36 THREADPROCESSORID_IDEAL = -2,
37 37
38 /// when setting Core and Affiny, keeps the ideal core intact
39 THREADDONTCHANGE_IDEAL = -3,
40
38 /// Indicates that the preferred processor ID shouldn't be updated in 41 /// Indicates that the preferred processor ID shouldn't be updated in
39 /// a core mask setting operation. 42 /// a core mask setting operation.
40 THREADPROCESSORID_DONT_UPDATE = -3, 43 THREADPROCESSORID_DONT_UPDATE = -3,
@@ -95,12 +98,6 @@ enum class ThreadSchedMasks : u32 {
95 ForcePauseMask = 0x0070, 98 ForcePauseMask = 0x0070,
96}; 99};
97 100
98enum class CoreFlags : s32 {
99 IgnoreIdealCore = -1,
100 ProcessIdealCore = -2,
101 DontChangeIdealCore = -3,
102};
103
104class Thread final : public WaitObject { 101class Thread final : public WaitObject {
105public: 102public:
106 using MutexWaitingThreads = std::vector<SharedPtr<Thread>>; 103 using MutexWaitingThreads = std::vector<SharedPtr<Thread>>;