Core Timing: Rework Core Timing to run all cores evenly.

This commit is contained in:
Fernando Sahmkow 2019-09-09 21:37:29 -04:00 committed by FernandoS27
parent e664c24355
commit 555866f8dc
6 changed files with 89 additions and 38 deletions

View file

@ -85,24 +85,16 @@ void Cpu::RunLoop(bool tight_loop) {
// instead advance to the next event and try to yield to the next thread
if (Kernel::GetCurrentThread() == nullptr) {
LOG_TRACE(Core, "Core-{} idling", core_index);
if (IsMainCore()) {
// TODO(Subv): Only let CoreTiming idle if all 4 cores are idling.
core_timing.Idle();
core_timing.Advance();
}
core_timing.Idle();
core_timing.Advance();
PrepareReschedule();
} else {
if (IsMainCore()) {
core_timing.Advance();
}
if (tight_loop) {
arm_interface->Run();
} else {
arm_interface->Step();
}
core_timing.Advance();
}
Reschedule();