summaryrefslogtreecommitdiffstats
path: root/src/core/cpu_manager.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-03-01 17:14:17 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 17:35:58 +0200
commit1567824d2da8e9b49b433f3d1d753d8ad84e65f9 (patch)
treec9553bb3f1693e430054695737d2f87ba4b58955 /src/core/cpu_manager.cpp
parentCore: Refactor ARM Interface. (diff)
downloadyuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.tar
yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.tar.gz
yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.tar.bz2
yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.tar.lz
yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.tar.xz
yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.tar.zst
yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.zip
Diffstat (limited to 'src/core/cpu_manager.cpp')
-rw-r--r--src/core/cpu_manager.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp
index 2aea95a25..2e9dc9dc3 100644
--- a/src/core/cpu_manager.cpp
+++ b/src/core/cpu_manager.cpp
@@ -129,18 +129,17 @@ void CpuManager::MultiCoreRunGuestThread() {
void CpuManager::MultiCoreRunGuestLoop() {
auto& kernel = system.Kernel();
auto* thread = kernel.CurrentScheduler().GetCurrentThread();
- auto host_context = thread->GetHostContext();
- host_context->SetRewindPoint(std::function<void(void*)>(GuestRewindFunction), this);
- host_context.reset();
while (true) {
- auto& physical_core = kernel.CurrentPhysicalCore();
+ auto* physical_core = &kernel.CurrentPhysicalCore();
+ auto& arm_interface = thread->ArmInterface();
system.EnterDynarmicProfile();
- while (!physical_core.IsInterrupted()) {
- physical_core.Run();
+ while (!physical_core->IsInterrupted()) {
+ arm_interface.Run();
+ physical_core = &kernel.CurrentPhysicalCore();
}
system.ExitDynarmicProfile();
- physical_core.ClearExclusive();
- auto& scheduler = physical_core.Scheduler();
+ arm_interface.ClearExclusiveState();
+ auto& scheduler = kernel.CurrentScheduler();
scheduler.TryDoContextSwitch();
}
}
@@ -150,7 +149,7 @@ void CpuManager::MultiCoreRunIdleThread() {
while (true) {
auto& physical_core = kernel.CurrentPhysicalCore();
physical_core.Idle();
- auto& scheduler = physical_core.Scheduler();
+ auto& scheduler = kernel.CurrentScheduler();
scheduler.TryDoContextSwitch();
}
}
@@ -229,14 +228,13 @@ void CpuManager::SingleCoreRunGuestThread() {
void CpuManager::SingleCoreRunGuestLoop() {
auto& kernel = system.Kernel();
auto* thread = kernel.CurrentScheduler().GetCurrentThread();
- auto host_context = thread->GetHostContext();
- host_context->SetRewindPoint(std::function<void(void*)>(GuestRewindFunction), this);
- host_context.reset();
while (true) {
- auto& physical_core = kernel.CurrentPhysicalCore();
+ auto* physical_core = &kernel.CurrentPhysicalCore();
+ auto& arm_interface = thread->ArmInterface();
system.EnterDynarmicProfile();
- while (!physical_core.IsInterrupted()) {
- physical_core.Run();
+ while (!physical_core->IsInterrupted()) {
+ arm_interface.Run();
+ physical_core = &kernel.CurrentPhysicalCore();
preemption_count++;
if (preemption_count % max_cycle_runs == 0) {
break;
@@ -246,7 +244,7 @@ void CpuManager::SingleCoreRunGuestLoop() {
thread->SetPhantomMode(true);
system.CoreTiming().Advance();
thread->SetPhantomMode(false);
- physical_core.ClearExclusive();
+ arm_interface.ClearExclusiveState();
PreemptSingleCore();
auto& scheduler = kernel.Scheduler(current_core);
scheduler.TryDoContextSwitch();