summaryrefslogtreecommitdiff
path: root/src/core/cpu_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/cpu_manager.cpp')
-rw-r--r--src/core/cpu_manager.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp
index 494850992..ff2fe8ead 100644
--- a/src/core/cpu_manager.cpp
+++ b/src/core/cpu_manager.cpp
@@ -78,10 +78,10 @@ void CpuManager::RunGuestThread() {
78 } 78 }
79 while (true) { 79 while (true) {
80 auto& physical_core = kernel.CurrentPhysicalCore(); 80 auto& physical_core = kernel.CurrentPhysicalCore();
81 LOG_CRITICAL(Core_ARM, "Running Guest Thread"); 81 if (!physical_core.IsInterrupted()) {
82 physical_core.Idle(); 82 physical_core.Idle();
83 LOG_CRITICAL(Core_ARM, "Leaving Guest Thread"); 83 //physical_core.Run();
84 // physical_core.Run(); 84 }
85 auto& scheduler = physical_core.Scheduler(); 85 auto& scheduler = physical_core.Scheduler();
86 scheduler.TryDoContextSwitch(); 86 scheduler.TryDoContextSwitch();
87 } 87 }
@@ -91,7 +91,6 @@ void CpuManager::RunIdleThread() {
91 auto& kernel = system.Kernel(); 91 auto& kernel = system.Kernel();
92 while (true) { 92 while (true) {
93 auto& physical_core = kernel.CurrentPhysicalCore(); 93 auto& physical_core = kernel.CurrentPhysicalCore();
94 LOG_CRITICAL(Core_ARM, "Running Idle Thread");
95 physical_core.Idle(); 94 physical_core.Idle();
96 auto& scheduler = physical_core.Scheduler(); 95 auto& scheduler = physical_core.Scheduler();
97 scheduler.TryDoContextSwitch(); 96 scheduler.TryDoContextSwitch();
@@ -99,7 +98,6 @@ void CpuManager::RunIdleThread() {
99} 98}
100 99
101void CpuManager::RunSuspendThread() { 100void CpuManager::RunSuspendThread() {
102 LOG_CRITICAL(Core_ARM, "Suspending Thread Entered");
103 auto& kernel = system.Kernel(); 101 auto& kernel = system.Kernel();
104 { 102 {
105 auto& sched = kernel.CurrentScheduler(); 103 auto& sched = kernel.CurrentScheduler();
@@ -109,9 +107,7 @@ void CpuManager::RunSuspendThread() {
109 auto core = kernel.GetCurrentHostThreadID(); 107 auto core = kernel.GetCurrentHostThreadID();
110 auto& scheduler = kernel.CurrentScheduler(); 108 auto& scheduler = kernel.CurrentScheduler();
111 Kernel::Thread* current_thread = scheduler.GetCurrentThread(); 109 Kernel::Thread* current_thread = scheduler.GetCurrentThread();
112 LOG_CRITICAL(Core_ARM, "Suspending Core {}", core);
113 Common::Fiber::YieldTo(current_thread->GetHostContext(), core_data[core].host_context); 110 Common::Fiber::YieldTo(current_thread->GetHostContext(), core_data[core].host_context);
114 LOG_CRITICAL(Core_ARM, "Unsuspending Core {}", core);
115 ASSERT(scheduler.ContextSwitchPending()); 111 ASSERT(scheduler.ContextSwitchPending());
116 ASSERT(core == kernel.GetCurrentHostThreadID()); 112 ASSERT(core == kernel.GetCurrentHostThreadID());
117 scheduler.TryDoContextSwitch(); 113 scheduler.TryDoContextSwitch();