kernel: create JIT instances on a per-process basis

This commit is contained in:
Liam
2023-07-27 23:16:36 -04:00
parent a1c355051e
commit b4bbdfb4bc
24 changed files with 186 additions and 214 deletions

View File

@@ -9,6 +9,7 @@
#include "core/core_timing.h"
#include "core/cpu_manager.h"
#include "core/hle/kernel/k_interrupt_manager.h"
#include "core/hle/kernel/k_process.h"
#include "core/hle/kernel/k_scheduler.h"
#include "core/hle/kernel/k_thread.h"
#include "core/hle/kernel/kernel.h"
@@ -73,13 +74,15 @@ void CpuManager::HandleInterrupt() {
void CpuManager::MultiCoreRunGuestThread() {
// Similar to UserModeThreadStarter in HOS
auto& kernel = system.Kernel();
auto& process = Kernel::GetCurrentProcess(kernel);
kernel.CurrentScheduler()->OnThreadStart();
while (true) {
auto* physical_core = &kernel.CurrentPhysicalCore();
while (!physical_core->IsInterrupted()) {
physical_core->Run();
physical_core = &kernel.CurrentPhysicalCore();
auto* arm_interface = process.GetArmInterface(physical_core->GetCoreIndex());
if (physical_core->Run(*arm_interface)) {
continue;
}
HandleInterrupt();
@@ -95,11 +98,7 @@ void CpuManager::MultiCoreRunIdleThread() {
kernel.CurrentScheduler()->OnThreadStart();
while (true) {
auto& physical_core = kernel.CurrentPhysicalCore();
if (!physical_core.IsInterrupted()) {
physical_core.Idle();
}
kernel.CurrentPhysicalCore().WaitForInterrupt();
HandleInterrupt();
}
}
@@ -110,14 +109,13 @@ void CpuManager::MultiCoreRunIdleThread() {
void CpuManager::SingleCoreRunGuestThread() {
auto& kernel = system.Kernel();
auto& process = Kernel::GetCurrentProcess(kernel);
kernel.CurrentScheduler()->OnThreadStart();
while (true) {
auto* physical_core = &kernel.CurrentPhysicalCore();
if (!physical_core->IsInterrupted()) {
physical_core->Run();
physical_core = &kernel.CurrentPhysicalCore();
}
auto* arm_interface = process.GetArmInterface(physical_core->GetCoreIndex());
physical_core->Run(*arm_interface);
kernel.SetIsPhantomModeForSingleCore(true);
system.CoreTiming().Advance();