|
|
@ -117,17 +117,18 @@ void CpuManager::MultiCoreRunGuestLoop() {
|
|
|
|
physical_core = &kernel.CurrentPhysicalCore();
|
|
|
|
physical_core = &kernel.CurrentPhysicalCore();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
system.ExitDynarmicProfile();
|
|
|
|
system.ExitDynarmicProfile();
|
|
|
|
physical_core->ArmInterface().ClearExclusiveState();
|
|
|
|
{
|
|
|
|
kernel.CurrentScheduler()->RescheduleCurrentCore();
|
|
|
|
Kernel::KScopedDisableDispatch dd(kernel);
|
|
|
|
|
|
|
|
physical_core->ArmInterface().ClearExclusiveState();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CpuManager::MultiCoreRunIdleThread() {
|
|
|
|
void CpuManager::MultiCoreRunIdleThread() {
|
|
|
|
auto& kernel = system.Kernel();
|
|
|
|
auto& kernel = system.Kernel();
|
|
|
|
while (true) {
|
|
|
|
while (true) {
|
|
|
|
auto& physical_core = kernel.CurrentPhysicalCore();
|
|
|
|
Kernel::KScopedDisableDispatch dd(kernel);
|
|
|
|
physical_core.Idle();
|
|
|
|
kernel.CurrentPhysicalCore().Idle();
|
|
|
|
kernel.CurrentScheduler()->RescheduleCurrentCore();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -135,12 +136,12 @@ void CpuManager::MultiCoreRunSuspendThread() {
|
|
|
|
auto& kernel = system.Kernel();
|
|
|
|
auto& kernel = system.Kernel();
|
|
|
|
kernel.CurrentScheduler()->OnThreadStart();
|
|
|
|
kernel.CurrentScheduler()->OnThreadStart();
|
|
|
|
while (true) {
|
|
|
|
while (true) {
|
|
|
|
auto core = kernel.GetCurrentHostThreadID();
|
|
|
|
auto core = kernel.CurrentPhysicalCoreIndex();
|
|
|
|
auto& scheduler = *kernel.CurrentScheduler();
|
|
|
|
auto& scheduler = *kernel.CurrentScheduler();
|
|
|
|
Kernel::KThread* current_thread = scheduler.GetCurrentThread();
|
|
|
|
Kernel::KThread* current_thread = scheduler.GetCurrentThread();
|
|
|
|
Common::Fiber::YieldTo(current_thread->GetHostContext(), *core_data[core].host_context);
|
|
|
|
Common::Fiber::YieldTo(current_thread->GetHostContext(), *core_data[core].host_context);
|
|
|
|
ASSERT(scheduler.ContextSwitchPending());
|
|
|
|
ASSERT(scheduler.ContextSwitchPending());
|
|
|
|
ASSERT(core == kernel.GetCurrentHostThreadID());
|
|
|
|
ASSERT(core == kernel.CurrentPhysicalCoreIndex());
|
|
|
|
scheduler.RescheduleCurrentCore();
|
|
|
|
scheduler.RescheduleCurrentCore();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|