summaryrefslogtreecommitdiff
path: root/src/core/cpu_manager.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-12-03 15:32:45 -0800
committerGitHub <noreply@github.com>2020-12-03 15:32:45 -0800
commit69aaad9b9684570284efcdb5921e54d0f5983838 (patch)
tree364256228dfcdfc989a597aca2a6c753b173f93a /src/core/cpu_manager.cpp
parent843ef8f2ec8b1645e7aa5eec7fcc8a76f0d3b666 (diff)
parent4b9e1b6586a8a4017b8e3e0fb52457d1e2568066 (diff)
Merge pull request #4996 from bunnei/use-4jits
Kernel: Refactor to use 4-instances of Dynarmic & various cleanups and improvements
Diffstat (limited to 'src/core/cpu_manager.cpp')
-rw-r--r--src/core/cpu_manager.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp
index eeeb6e8df..0cff985e9 100644
--- a/src/core/cpu_manager.cpp
+++ b/src/core/cpu_manager.cpp
@@ -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();