3
0
Fork 0
forked from suyu/suyu

SingleCore: Correct ticks reset to be on preemption.

This commit is contained in:
Fernando Sahmkow 2020-04-02 13:24:39 -04:00
parent 48fa3b7a0f
commit bece52cd81

View file

@ -227,7 +227,6 @@ void CpuManager::SingleCoreRunGuestLoop() {
auto& arm_interface = thread->ArmInterface(); auto& arm_interface = thread->ArmInterface();
system.EnterDynarmicProfile(); system.EnterDynarmicProfile();
if (!physical_core->IsInterrupted()) { if (!physical_core->IsInterrupted()) {
system.CoreTiming().ResetTicks();
arm_interface.Run(); arm_interface.Run();
physical_core = &kernel.CurrentPhysicalCore(); physical_core = &kernel.CurrentPhysicalCore();
} }
@ -285,6 +284,7 @@ void CpuManager::PreemptSingleCore(bool from_running_enviroment) {
current_thread->SetPhantomMode(false); current_thread->SetPhantomMode(false);
} }
current_core.store((current_core + 1) % Core::Hardware::NUM_CPU_CORES); current_core.store((current_core + 1) % Core::Hardware::NUM_CPU_CORES);
system.CoreTiming().ResetTicks();
scheduler.Unload(); scheduler.Unload();
auto& next_scheduler = system.Kernel().Scheduler(current_core); auto& next_scheduler = system.Kernel().Scheduler(current_core);
Common::Fiber::YieldTo(current_thread->GetHostContext(), next_scheduler.ControlContext()); Common::Fiber::YieldTo(current_thread->GetHostContext(), next_scheduler.ControlContext());