diff options
Diffstat (limited to 'src/core/cpu_manager.cpp')
| -rw-r--r-- | src/core/cpu_manager.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp index 77efcabf0..e2c4f0e07 100644 --- a/src/core/cpu_manager.cpp +++ b/src/core/cpu_manager.cpp | |||
| @@ -118,17 +118,18 @@ void CpuManager::MultiCoreRunGuestLoop() { | |||
| 118 | physical_core = &kernel.CurrentPhysicalCore(); | 118 | physical_core = &kernel.CurrentPhysicalCore(); |
| 119 | } | 119 | } |
| 120 | system.ExitDynarmicProfile(); | 120 | system.ExitDynarmicProfile(); |
| 121 | physical_core->ArmInterface().ClearExclusiveState(); | 121 | { |
| 122 | kernel.CurrentScheduler()->RescheduleCurrentCore(); | 122 | Kernel::KScopedDisableDispatch dd(kernel); |
| 123 | physical_core->ArmInterface().ClearExclusiveState(); | ||
| 124 | } | ||
| 123 | } | 125 | } |
| 124 | } | 126 | } |
| 125 | 127 | ||
| 126 | void CpuManager::MultiCoreRunIdleThread() { | 128 | void CpuManager::MultiCoreRunIdleThread() { |
| 127 | auto& kernel = system.Kernel(); | 129 | auto& kernel = system.Kernel(); |
| 128 | while (true) { | 130 | while (true) { |
| 129 | auto& physical_core = kernel.CurrentPhysicalCore(); | 131 | Kernel::KScopedDisableDispatch dd(kernel); |
| 130 | physical_core.Idle(); | 132 | kernel.CurrentPhysicalCore().Idle(); |
| 131 | kernel.CurrentScheduler()->RescheduleCurrentCore(); | ||
| 132 | } | 133 | } |
| 133 | } | 134 | } |
| 134 | 135 | ||
| @@ -136,12 +137,12 @@ void CpuManager::MultiCoreRunSuspendThread() { | |||
| 136 | auto& kernel = system.Kernel(); | 137 | auto& kernel = system.Kernel(); |
| 137 | kernel.CurrentScheduler()->OnThreadStart(); | 138 | kernel.CurrentScheduler()->OnThreadStart(); |
| 138 | while (true) { | 139 | while (true) { |
| 139 | auto core = kernel.GetCurrentHostThreadID(); | 140 | auto core = kernel.CurrentPhysicalCoreIndex(); |
| 140 | auto& scheduler = *kernel.CurrentScheduler(); | 141 | auto& scheduler = *kernel.CurrentScheduler(); |
| 141 | Kernel::KThread* current_thread = scheduler.GetCurrentThread(); | 142 | Kernel::KThread* current_thread = scheduler.GetCurrentThread(); |
| 142 | Common::Fiber::YieldTo(current_thread->GetHostContext(), *core_data[core].host_context); | 143 | Common::Fiber::YieldTo(current_thread->GetHostContext(), *core_data[core].host_context); |
| 143 | ASSERT(scheduler.ContextSwitchPending()); | 144 | ASSERT(scheduler.ContextSwitchPending()); |
| 144 | ASSERT(core == kernel.GetCurrentHostThreadID()); | 145 | ASSERT(core == kernel.CurrentPhysicalCoreIndex()); |
| 145 | scheduler.RescheduleCurrentCore(); | 146 | scheduler.RescheduleCurrentCore(); |
| 146 | } | 147 | } |
| 147 | } | 148 | } |