core: Make running_core always match kernel current_cpu (#7159)
This commit is contained in:
parent
63d1830429
commit
e28c2a390c
|
@ -158,7 +158,8 @@ System::ResultStatus System::RunLoop(bool tight_loop) {
|
||||||
for (auto& cpu_core : cpu_cores) {
|
for (auto& cpu_core : cpu_cores) {
|
||||||
if (cpu_core->GetTimer().GetTicks() < global_ticks) {
|
if (cpu_core->GetTimer().GetTicks() < global_ticks) {
|
||||||
s64 delay = global_ticks - cpu_core->GetTimer().GetTicks();
|
s64 delay = global_ticks - cpu_core->GetTimer().GetTicks();
|
||||||
kernel->SetRunningCPU(cpu_core.get());
|
running_core = cpu_core.get();
|
||||||
|
kernel->SetRunningCPU(running_core);
|
||||||
cpu_core->GetTimer().Advance();
|
cpu_core->GetTimer().Advance();
|
||||||
cpu_core->PrepareReschedule();
|
cpu_core->PrepareReschedule();
|
||||||
kernel->GetThreadManager(cpu_core->GetID()).Reschedule();
|
kernel->GetThreadManager(cpu_core->GetID()).Reschedule();
|
||||||
|
@ -199,7 +200,8 @@ System::ResultStatus System::RunLoop(bool tight_loop) {
|
||||||
// TODO: Make special check for idle since we can easily revert the time of idle cores
|
// TODO: Make special check for idle since we can easily revert the time of idle cores
|
||||||
s64 max_slice = Timing::MAX_SLICE_LENGTH;
|
s64 max_slice = Timing::MAX_SLICE_LENGTH;
|
||||||
for (const auto& cpu_core : cpu_cores) {
|
for (const auto& cpu_core : cpu_cores) {
|
||||||
kernel->SetRunningCPU(cpu_core.get());
|
running_core = cpu_core.get();
|
||||||
|
kernel->SetRunningCPU(running_core);
|
||||||
cpu_core->GetTimer().Advance();
|
cpu_core->GetTimer().Advance();
|
||||||
cpu_core->PrepareReschedule();
|
cpu_core->PrepareReschedule();
|
||||||
kernel->GetThreadManager(cpu_core->GetID()).Reschedule();
|
kernel->GetThreadManager(cpu_core->GetID()).Reschedule();
|
||||||
|
|
Loading…
Reference in New Issue