diff options
Diffstat (limited to 'src/core/cpu_manager.cpp')
| -rw-r--r-- | src/core/cpu_manager.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp index c35438c6f..8f04fb8f5 100644 --- a/src/core/cpu_manager.cpp +++ b/src/core/cpu_manager.cpp | |||
| @@ -111,7 +111,7 @@ void CpuManager::MultiCoreRunGuestThread() { | |||
| 111 | auto& kernel = system.Kernel(); | 111 | auto& kernel = system.Kernel(); |
| 112 | kernel.CurrentScheduler()->OnThreadStart(); | 112 | kernel.CurrentScheduler()->OnThreadStart(); |
| 113 | auto* thread = kernel.CurrentScheduler()->GetCurrentThread(); | 113 | auto* thread = kernel.CurrentScheduler()->GetCurrentThread(); |
| 114 | auto host_context = thread->GetHostContext(); | 114 | auto& host_context = thread->GetHostContext(); |
| 115 | host_context->SetRewindPoint(GuestRewindFunction, this); | 115 | host_context->SetRewindPoint(GuestRewindFunction, this); |
| 116 | MultiCoreRunGuestLoop(); | 116 | MultiCoreRunGuestLoop(); |
| 117 | } | 117 | } |
| @@ -148,8 +148,7 @@ void CpuManager::MultiCoreRunSuspendThread() { | |||
| 148 | auto core = kernel.GetCurrentHostThreadID(); | 148 | auto core = kernel.GetCurrentHostThreadID(); |
| 149 | auto& scheduler = *kernel.CurrentScheduler(); | 149 | auto& scheduler = *kernel.CurrentScheduler(); |
| 150 | Kernel::KThread* current_thread = scheduler.GetCurrentThread(); | 150 | Kernel::KThread* current_thread = scheduler.GetCurrentThread(); |
| 151 | Common::Fiber::YieldTo(current_thread->GetHostContext(), | 151 | Common::Fiber::YieldTo(current_thread->GetHostContext(), core_data[core].host_context); |
| 152 | core_data[core].host_context.get()); | ||
| 153 | ASSERT(scheduler.ContextSwitchPending()); | 152 | ASSERT(scheduler.ContextSwitchPending()); |
| 154 | ASSERT(core == kernel.GetCurrentHostThreadID()); | 153 | ASSERT(core == kernel.GetCurrentHostThreadID()); |
| 155 | scheduler.RescheduleCurrentCore(); | 154 | scheduler.RescheduleCurrentCore(); |
| @@ -202,7 +201,7 @@ void CpuManager::SingleCoreRunGuestThread() { | |||
| 202 | auto& kernel = system.Kernel(); | 201 | auto& kernel = system.Kernel(); |
| 203 | kernel.CurrentScheduler()->OnThreadStart(); | 202 | kernel.CurrentScheduler()->OnThreadStart(); |
| 204 | auto* thread = kernel.CurrentScheduler()->GetCurrentThread(); | 203 | auto* thread = kernel.CurrentScheduler()->GetCurrentThread(); |
| 205 | auto host_context = thread->GetHostContext(); | 204 | auto& host_context = thread->GetHostContext(); |
| 206 | host_context->SetRewindPoint(GuestRewindFunction, this); | 205 | host_context->SetRewindPoint(GuestRewindFunction, this); |
| 207 | SingleCoreRunGuestLoop(); | 206 | SingleCoreRunGuestLoop(); |
| 208 | } | 207 | } |
| @@ -246,7 +245,7 @@ void CpuManager::SingleCoreRunSuspendThread() { | |||
| 246 | auto core = kernel.GetCurrentHostThreadID(); | 245 | auto core = kernel.GetCurrentHostThreadID(); |
| 247 | auto& scheduler = *kernel.CurrentScheduler(); | 246 | auto& scheduler = *kernel.CurrentScheduler(); |
| 248 | Kernel::KThread* current_thread = scheduler.GetCurrentThread(); | 247 | Kernel::KThread* current_thread = scheduler.GetCurrentThread(); |
| 249 | Common::Fiber::YieldTo(current_thread->GetHostContext(), core_data[0].host_context.get()); | 248 | Common::Fiber::YieldTo(current_thread->GetHostContext(), core_data[0].host_context); |
| 250 | ASSERT(scheduler.ContextSwitchPending()); | 249 | ASSERT(scheduler.ContextSwitchPending()); |
| 251 | ASSERT(core == kernel.GetCurrentHostThreadID()); | 250 | ASSERT(core == kernel.GetCurrentHostThreadID()); |
| 252 | scheduler.RescheduleCurrentCore(); | 251 | scheduler.RescheduleCurrentCore(); |
| @@ -364,7 +363,7 @@ void CpuManager::RunThread(std::size_t core) { | |||
| 364 | 363 | ||
| 365 | auto current_thread = system.Kernel().CurrentScheduler()->GetCurrentThread(); | 364 | auto current_thread = system.Kernel().CurrentScheduler()->GetCurrentThread(); |
| 366 | data.is_running = true; | 365 | data.is_running = true; |
| 367 | Common::Fiber::YieldTo(data.host_context.get(), current_thread->GetHostContext()); | 366 | Common::Fiber::YieldTo(data.host_context, current_thread->GetHostContext()); |
| 368 | data.is_running = false; | 367 | data.is_running = false; |
| 369 | data.is_paused = true; | 368 | data.is_paused = true; |
| 370 | data.exit_barrier->Wait(); | 369 | data.exit_barrier->Wait(); |