|
|
|
@ -15,6 +15,7 @@
|
|
|
|
|
#include "core/core.h"
|
|
|
|
|
#include "core/core_timing.h"
|
|
|
|
|
#include "core/core_timing_util.h"
|
|
|
|
|
#include "core/hardware_properties.h"
|
|
|
|
|
#include "core/hle/kernel/errors.h"
|
|
|
|
|
#include "core/hle/kernel/handle_table.h"
|
|
|
|
|
#include "core/hle/kernel/kernel.h"
|
|
|
|
@ -431,7 +432,7 @@ ResultCode Thread::SetCoreAndAffinityMask(s32 new_core, u64 new_affinity_mask) {
|
|
|
|
|
const s32 old_core = processor_id;
|
|
|
|
|
if (processor_id >= 0 && ((affinity_mask >> processor_id) & 1) == 0) {
|
|
|
|
|
if (static_cast<s32>(ideal_core) < 0) {
|
|
|
|
|
processor_id = HighestSetCore(affinity_mask, GlobalScheduler::NUM_CPU_CORES);
|
|
|
|
|
processor_id = HighestSetCore(affinity_mask, Core::Hardware::NUM_CPU_CORES);
|
|
|
|
|
} else {
|
|
|
|
|
processor_id = ideal_core;
|
|
|
|
|
}
|
|
|
|
@ -455,7 +456,7 @@ void Thread::AdjustSchedulingOnStatus(u32 old_flags) {
|
|
|
|
|
scheduler.Unschedule(current_priority, static_cast<u32>(processor_id), this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (u32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) {
|
|
|
|
|
for (u32 core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) {
|
|
|
|
|
if (core != static_cast<u32>(processor_id) && ((affinity_mask >> core) & 1) != 0) {
|
|
|
|
|
scheduler.Unsuggest(current_priority, core, this);
|
|
|
|
|
}
|
|
|
|
@ -466,7 +467,7 @@ void Thread::AdjustSchedulingOnStatus(u32 old_flags) {
|
|
|
|
|
scheduler.Schedule(current_priority, static_cast<u32>(processor_id), this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (u32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) {
|
|
|
|
|
for (u32 core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) {
|
|
|
|
|
if (core != static_cast<u32>(processor_id) && ((affinity_mask >> core) & 1) != 0) {
|
|
|
|
|
scheduler.Suggest(current_priority, core, this);
|
|
|
|
|
}
|
|
|
|
@ -485,7 +486,7 @@ void Thread::AdjustSchedulingOnPriority(u32 old_priority) {
|
|
|
|
|
scheduler.Unschedule(old_priority, static_cast<u32>(processor_id), this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (u32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) {
|
|
|
|
|
for (u32 core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) {
|
|
|
|
|
if (core != static_cast<u32>(processor_id) && ((affinity_mask >> core) & 1) != 0) {
|
|
|
|
|
scheduler.Unsuggest(old_priority, core, this);
|
|
|
|
|
}
|
|
|
|
@ -502,7 +503,7 @@ void Thread::AdjustSchedulingOnPriority(u32 old_priority) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (u32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) {
|
|
|
|
|
for (u32 core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) {
|
|
|
|
|
if (core != static_cast<u32>(processor_id) && ((affinity_mask >> core) & 1) != 0) {
|
|
|
|
|
scheduler.Suggest(current_priority, core, this);
|
|
|
|
|
}
|
|
|
|
@ -518,7 +519,7 @@ void Thread::AdjustSchedulingOnAffinity(u64 old_affinity_mask, s32 old_core) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (u32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) {
|
|
|
|
|
for (u32 core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) {
|
|
|
|
|
if (((old_affinity_mask >> core) & 1) != 0) {
|
|
|
|
|
if (core == static_cast<u32>(old_core)) {
|
|
|
|
|
scheduler.Unschedule(current_priority, core, this);
|
|
|
|
@ -528,7 +529,7 @@ void Thread::AdjustSchedulingOnAffinity(u64 old_affinity_mask, s32 old_core) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (u32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) {
|
|
|
|
|
for (u32 core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) {
|
|
|
|
|
if (((affinity_mask >> core) & 1) != 0) {
|
|
|
|
|
if (core == static_cast<u32>(processor_id)) {
|
|
|
|
|
scheduler.Schedule(current_priority, core, this);
|
|
|
|
|