hle: kernel: multicore: Replace n-JITs impl. with 4 JITs.

This commit is contained in:
bunnei 2020-11-13 11:11:12 -08:00
parent 6750b4d3af
commit 7b642c7781
15 changed files with 124 additions and 72 deletions

View file

@ -113,22 +113,23 @@ void CpuManager::MultiCoreRunGuestThread() {
auto& sched = kernel.CurrentScheduler();
sched.OnThreadStart();
}
auto* thread = kernel.CurrentScheduler().GetCurrentThread();
auto& host_context = thread->GetHostContext();
host_context->SetRewindPoint(GuestRewindFunction, this);
MultiCoreRunGuestLoop();
}
void CpuManager::MultiCoreRunGuestLoop() {
auto& kernel = system.Kernel();
auto* thread = kernel.CurrentScheduler().GetCurrentThread();
while (true) {
auto* physical_core = &kernel.CurrentPhysicalCore();
auto& arm_interface = thread->ArmInterface();
system.EnterDynarmicProfile();
while (!physical_core->IsInterrupted()) {
arm_interface.Run();
physical_core->Run();
physical_core = &kernel.CurrentPhysicalCore();
}
system.ExitDynarmicProfile();
arm_interface.ClearExclusiveState();
auto& scheduler = kernel.CurrentScheduler();
scheduler.TryDoContextSwitch();
}
@ -209,6 +210,9 @@ void CpuManager::SingleCoreRunGuestThread() {
auto& sched = kernel.CurrentScheduler();
sched.OnThreadStart();
}
auto* thread = kernel.CurrentScheduler().GetCurrentThread();
auto& host_context = thread->GetHostContext();
host_context->SetRewindPoint(GuestRewindFunction, this);
SingleCoreRunGuestLoop();
}
@ -217,17 +221,15 @@ void CpuManager::SingleCoreRunGuestLoop() {
auto* thread = kernel.CurrentScheduler().GetCurrentThread();
while (true) {
auto* physical_core = &kernel.CurrentPhysicalCore();
auto& arm_interface = thread->ArmInterface();
system.EnterDynarmicProfile();
if (!physical_core->IsInterrupted()) {
arm_interface.Run();
physical_core->Run();
physical_core = &kernel.CurrentPhysicalCore();
}
system.ExitDynarmicProfile();
thread->SetPhantomMode(true);
system.CoreTiming().Advance();
thread->SetPhantomMode(false);
arm_interface.ClearExclusiveState();
PreemptSingleCore();
auto& scheduler = kernel.Scheduler(current_core);
scheduler.TryDoContextSwitch();