early-access version 3786

This commit is contained in:
pineappleEA
2023-08-01 12:33:00 +02:00
parent 04f356bb47
commit 2fafeb5013
25 changed files with 187 additions and 215 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();