mirror of
				https://git.zaroz.cloud/nintendo-back-up/yuzu/yuzu-mainline.git
				synced 2025-03-21 01:53:15 +00:00 
			
		
		
		
	Scheduler: Correct Reload/Unload
This commit is contained in:
		
							parent
							
								
									5974e3ea33
								
							
						
					
					
						commit
						9bde28d7b1
					
				@ -149,6 +149,7 @@ struct KernelCore::Impl {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        for (std::size_t i = 0; i < cores.size(); i++) {
 | 
					        for (std::size_t i = 0; i < cores.size(); i++) {
 | 
				
			||||||
            cores[i].Shutdown();
 | 
					            cores[i].Shutdown();
 | 
				
			||||||
 | 
					            schedulers[i].reset();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        cores.clear();
 | 
					        cores.clear();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -625,8 +625,8 @@ void Scheduler::Unload() {
 | 
				
			|||||||
        thread->SetContinuousOnSVC(false);
 | 
					        thread->SetContinuousOnSVC(false);
 | 
				
			||||||
        thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
 | 
					        thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
 | 
				
			||||||
        thread->SetIsRunning(false);
 | 
					        thread->SetIsRunning(false);
 | 
				
			||||||
        if (!thread->IsHLEThread()) {
 | 
					        if (!thread->IsHLEThread() && !thread->HasExited()) {
 | 
				
			||||||
            auto& cpu_core = system.ArmInterface(core_id);
 | 
					            Core::ARM_Interface& cpu_core = thread->ArmInterface();
 | 
				
			||||||
            cpu_core.SaveContext(thread->GetContext32());
 | 
					            cpu_core.SaveContext(thread->GetContext32());
 | 
				
			||||||
            cpu_core.SaveContext(thread->GetContext64());
 | 
					            cpu_core.SaveContext(thread->GetContext64());
 | 
				
			||||||
            // Save the TPIDR_EL0 system register in case it was modified.
 | 
					            // Save the TPIDR_EL0 system register in case it was modified.
 | 
				
			||||||
@ -653,11 +653,12 @@ void Scheduler::Reload() {
 | 
				
			|||||||
            system.Kernel().MakeCurrentProcess(thread_owner_process);
 | 
					            system.Kernel().MakeCurrentProcess(thread_owner_process);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (!thread->IsHLEThread()) {
 | 
					        if (!thread->IsHLEThread()) {
 | 
				
			||||||
            auto& cpu_core = system.ArmInterface(core_id);
 | 
					            Core::ARM_Interface& cpu_core = thread->ArmInterface();
 | 
				
			||||||
            cpu_core.LoadContext(thread->GetContext32());
 | 
					            cpu_core.LoadContext(thread->GetContext32());
 | 
				
			||||||
            cpu_core.LoadContext(thread->GetContext64());
 | 
					            cpu_core.LoadContext(thread->GetContext64());
 | 
				
			||||||
            cpu_core.SetTlsAddress(thread->GetTLSAddress());
 | 
					            cpu_core.SetTlsAddress(thread->GetTLSAddress());
 | 
				
			||||||
            cpu_core.SetTPIDR_EL0(thread->GetTPIDR_EL0());
 | 
					            cpu_core.SetTPIDR_EL0(thread->GetTPIDR_EL0());
 | 
				
			||||||
 | 
					            cpu_core.ChangeProcessorId(this->core_id);
 | 
				
			||||||
            cpu_core.ClearExclusiveState();
 | 
					            cpu_core.ClearExclusiveState();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user