diff options
| author | 2023-11-28 14:30:39 -0500 | |
|---|---|---|
| committer | 2023-12-04 10:37:16 -0500 | |
| commit | 45c87c7e6e841c11def43e5ab25160006dab6d77 (patch) | |
| tree | 04a3ea0bd8c07389e17741aa28615e3b32ace2f7 /src/core/cpu_manager.cpp | |
| parent | Merge pull request #12235 from liamwhite/flip-clip (diff) | |
| download | yuzu-45c87c7e6e841c11def43e5ab25160006dab6d77.tar.gz yuzu-45c87c7e6e841c11def43e5ab25160006dab6d77.tar.xz yuzu-45c87c7e6e841c11def43e5ab25160006dab6d77.zip | |
core: refactor emulated cpu core activation
Diffstat (limited to 'src/core/cpu_manager.cpp')
| -rw-r--r-- | src/core/cpu_manager.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp index 151eb3870..7a5c22f78 100644 --- a/src/core/cpu_manager.cpp +++ b/src/core/cpu_manager.cpp | |||
| @@ -73,12 +73,13 @@ void CpuManager::HandleInterrupt() { | |||
| 73 | void CpuManager::MultiCoreRunGuestThread() { | 73 | void CpuManager::MultiCoreRunGuestThread() { |
| 74 | // Similar to UserModeThreadStarter in HOS | 74 | // Similar to UserModeThreadStarter in HOS |
| 75 | auto& kernel = system.Kernel(); | 75 | auto& kernel = system.Kernel(); |
| 76 | auto* thread = Kernel::GetCurrentThreadPointer(kernel); | ||
| 76 | kernel.CurrentScheduler()->OnThreadStart(); | 77 | kernel.CurrentScheduler()->OnThreadStart(); |
| 77 | 78 | ||
| 78 | while (true) { | 79 | while (true) { |
| 79 | auto* physical_core = &kernel.CurrentPhysicalCore(); | 80 | auto* physical_core = &kernel.CurrentPhysicalCore(); |
| 80 | while (!physical_core->IsInterrupted()) { | 81 | while (!physical_core->IsInterrupted()) { |
| 81 | physical_core->Run(); | 82 | physical_core->RunThread(thread); |
| 82 | physical_core = &kernel.CurrentPhysicalCore(); | 83 | physical_core = &kernel.CurrentPhysicalCore(); |
| 83 | } | 84 | } |
| 84 | 85 | ||
| @@ -110,12 +111,13 @@ void CpuManager::MultiCoreRunIdleThread() { | |||
| 110 | 111 | ||
| 111 | void CpuManager::SingleCoreRunGuestThread() { | 112 | void CpuManager::SingleCoreRunGuestThread() { |
| 112 | auto& kernel = system.Kernel(); | 113 | auto& kernel = system.Kernel(); |
| 114 | auto* thread = Kernel::GetCurrentThreadPointer(kernel); | ||
| 113 | kernel.CurrentScheduler()->OnThreadStart(); | 115 | kernel.CurrentScheduler()->OnThreadStart(); |
| 114 | 116 | ||
| 115 | while (true) { | 117 | while (true) { |
| 116 | auto* physical_core = &kernel.CurrentPhysicalCore(); | 118 | auto* physical_core = &kernel.CurrentPhysicalCore(); |
| 117 | if (!physical_core->IsInterrupted()) { | 119 | if (!physical_core->IsInterrupted()) { |
| 118 | physical_core->Run(); | 120 | physical_core->RunThread(thread); |
| 119 | physical_core = &kernel.CurrentPhysicalCore(); | 121 | physical_core = &kernel.CurrentPhysicalCore(); |
| 120 | } | 122 | } |
| 121 | 123 | ||
| @@ -211,8 +213,6 @@ void CpuManager::RunThread(std::stop_token token, std::size_t core) { | |||
| 211 | system.GPU().ObtainContext(); | 213 | system.GPU().ObtainContext(); |
| 212 | } | 214 | } |
| 213 | 215 | ||
| 214 | system.ArmInterface(core).Initialize(); | ||
| 215 | |||
| 216 | auto& kernel = system.Kernel(); | 216 | auto& kernel = system.Kernel(); |
| 217 | auto& scheduler = *kernel.CurrentScheduler(); | 217 | auto& scheduler = *kernel.CurrentScheduler(); |
| 218 | auto* thread = scheduler.GetSchedulerCurrentThread(); | 218 | auto* thread = scheduler.GetSchedulerCurrentThread(); |