summaryrefslogtreecommitdiff
path: root/src/core/cpu_manager.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2020-11-13 11:11:12 -0800
committerGravatar bunnei2020-11-29 01:31:51 -0800
commit7b642c77811dc3887756f5abac5a9710564b098e (patch)
tree09c9d764734db56896f77d986afa6ccd5d2c745d /src/core/cpu_manager.cpp
parentMerge pull request #4998 from Morph1984/bioshock-patch (diff)
downloadyuzu-7b642c77811dc3887756f5abac5a9710564b098e.tar.gz
yuzu-7b642c77811dc3887756f5abac5a9710564b098e.tar.xz
yuzu-7b642c77811dc3887756f5abac5a9710564b098e.zip
hle: kernel: multicore: Replace n-JITs impl. with 4 JITs.
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() {
113 auto& sched = kernel.CurrentScheduler(); 113 auto& sched = kernel.CurrentScheduler();
114 sched.OnThreadStart(); 114 sched.OnThreadStart();
115 } 115 }
116 auto* thread = kernel.CurrentScheduler().GetCurrentThread();
117 auto& host_context = thread->GetHostContext();
118 host_context->SetRewindPoint(GuestRewindFunction, this);
116 MultiCoreRunGuestLoop(); 119 MultiCoreRunGuestLoop();
117} 120}
118 121
119void CpuManager::MultiCoreRunGuestLoop() { 122void CpuManager::MultiCoreRunGuestLoop() {
120 auto& kernel = system.Kernel(); 123 auto& kernel = system.Kernel();
121 auto* thread = kernel.CurrentScheduler().GetCurrentThread(); 124
122 while (true) { 125 while (true) {
123 auto* physical_core = &kernel.CurrentPhysicalCore(); 126 auto* physical_core = &kernel.CurrentPhysicalCore();
124 auto& arm_interface = thread->ArmInterface();
125 system.EnterDynarmicProfile(); 127 system.EnterDynarmicProfile();
126 while (!physical_core->IsInterrupted()) { 128 while (!physical_core->IsInterrupted()) {
127 arm_interface.Run(); 129 physical_core->Run();
128 physical_core = &kernel.CurrentPhysicalCore(); 130 physical_core = &kernel.CurrentPhysicalCore();
129 } 131 }
130 system.ExitDynarmicProfile(); 132 system.ExitDynarmicProfile();
131 arm_interface.ClearExclusiveState();
132 auto& scheduler = kernel.CurrentScheduler(); 133 auto& scheduler = kernel.CurrentScheduler();
133 scheduler.TryDoContextSwitch(); 134 scheduler.TryDoContextSwitch();
134 } 135 }
@@ -209,6 +210,9 @@ void CpuManager::SingleCoreRunGuestThread() {
209 auto& sched = kernel.CurrentScheduler(); 210 auto& sched = kernel.CurrentScheduler();
210 sched.OnThreadStart(); 211 sched.OnThreadStart();
211 } 212 }
213 auto* thread = kernel.CurrentScheduler().GetCurrentThread();
214 auto& host_context = thread->GetHostContext();
215 host_context->SetRewindPoint(GuestRewindFunction, this);
212 SingleCoreRunGuestLoop(); 216 SingleCoreRunGuestLoop();
213} 217}
214 218
@@ -217,17 +221,15 @@ void CpuManager::SingleCoreRunGuestLoop() {
217 auto* thread = kernel.CurrentScheduler().GetCurrentThread(); 221 auto* thread = kernel.CurrentScheduler().GetCurrentThread();
218 while (true) { 222 while (true) {
219 auto* physical_core = &kernel.CurrentPhysicalCore(); 223 auto* physical_core = &kernel.CurrentPhysicalCore();
220 auto& arm_interface = thread->ArmInterface();
221 system.EnterDynarmicProfile(); 224 system.EnterDynarmicProfile();
222 if (!physical_core->IsInterrupted()) { 225 if (!physical_core->IsInterrupted()) {
223 arm_interface.Run(); 226 physical_core->Run();
224 physical_core = &kernel.CurrentPhysicalCore(); 227 physical_core = &kernel.CurrentPhysicalCore();
225 } 228 }
226 system.ExitDynarmicProfile(); 229 system.ExitDynarmicProfile();
227 thread->SetPhantomMode(true); 230 thread->SetPhantomMode(true);
228 system.CoreTiming().Advance(); 231 system.CoreTiming().Advance();
229 thread->SetPhantomMode(false); 232 thread->SetPhantomMode(false);
230 arm_interface.ClearExclusiveState();
231 PreemptSingleCore(); 233 PreemptSingleCore();
232 auto& scheduler = kernel.Scheduler(current_core); 234 auto& scheduler = kernel.Scheduler(current_core);
233 scheduler.TryDoContextSwitch(); 235 scheduler.TryDoContextSwitch();