|
|
@ -63,14 +63,8 @@ void KScheduler::EnableScheduling(KernelCore& kernel, u64 cores_needing_scheduli
|
|
|
|
auto* scheduler{kernel.CurrentScheduler()};
|
|
|
|
auto* scheduler{kernel.CurrentScheduler()};
|
|
|
|
|
|
|
|
|
|
|
|
if (!scheduler || kernel.IsPhantomModeForSingleCore()) {
|
|
|
|
if (!scheduler || kernel.IsPhantomModeForSingleCore()) {
|
|
|
|
// HACK: we cannot schedule from this thread, it is not a core thread
|
|
|
|
KScheduler::RescheduleCores(kernel, cores_needing_scheduling);
|
|
|
|
RescheduleCores(kernel, cores_needing_scheduling);
|
|
|
|
KScheduler::RescheduleCurrentHLEThread(kernel);
|
|
|
|
if (GetCurrentThread(kernel).GetDisableDispatchCount() == 1) {
|
|
|
|
|
|
|
|
// Special case to ensure dummy threads that are waiting block
|
|
|
|
|
|
|
|
GetCurrentThread(kernel).IfDummyThreadTryWait();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
GetCurrentThread(kernel).EnableDispatch();
|
|
|
|
|
|
|
|
ASSERT(GetCurrentThread(kernel).GetState() != ThreadState::Waiting);
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -83,6 +77,17 @@ void KScheduler::EnableScheduling(KernelCore& kernel, u64 cores_needing_scheduli
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KScheduler::RescheduleCurrentHLEThread(KernelCore& kernel) {
|
|
|
|
|
|
|
|
// HACK: we cannot schedule from this thread, it is not a core thread
|
|
|
|
|
|
|
|
ASSERT(GetCurrentThread(kernel).GetDisableDispatchCount() == 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Special case to ensure dummy threads that are waiting block
|
|
|
|
|
|
|
|
GetCurrentThread(kernel).IfDummyThreadTryWait();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASSERT(GetCurrentThread(kernel).GetState() != ThreadState::Waiting);
|
|
|
|
|
|
|
|
GetCurrentThread(kernel).EnableDispatch();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
u64 KScheduler::UpdateHighestPriorityThreads(KernelCore& kernel) {
|
|
|
|
u64 KScheduler::UpdateHighestPriorityThreads(KernelCore& kernel) {
|
|
|
|
if (IsSchedulerUpdateNeeded(kernel)) {
|
|
|
|
if (IsSchedulerUpdateNeeded(kernel)) {
|
|
|
|
return UpdateHighestPriorityThreadsImpl(kernel);
|
|
|
|
return UpdateHighestPriorityThreadsImpl(kernel);
|
|
|
|