yuzu-emu
/
yuzu
Archived
1
0
Fork 0

threading: Reschedule only on cores that are necessary.

This commit is contained in:
bunnei 2018-05-05 23:54:43 -04:00
parent d6e3cd9a17
commit 8aa5d25f82
4 changed files with 10 additions and 3 deletions

View File

@ -141,6 +141,11 @@ ARM_Interface& System::ArmInterface(size_t core_index) {
return cpu_cores[core_index]->ArmInterface(); return cpu_cores[core_index]->ArmInterface();
} }
Cpu& System::CpuCore(size_t core_index) {
ASSERT(core_index < NUM_CPU_CORES);
return *cpu_cores[core_index];
}
System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
NGLOG_DEBUG(HW_Memory, "initialized OK"); NGLOG_DEBUG(HW_Memory, "initialized OK");

View File

@ -114,6 +114,8 @@ public:
ARM_Interface& ArmInterface(size_t core_index); ARM_Interface& ArmInterface(size_t core_index);
Cpu& CpuCore(size_t core_index);
Tegra::GPU& GPU() { Tegra::GPU& GPU() {
return *gpu_core; return *gpu_core;
} }

View File

@ -625,7 +625,7 @@ static ResultCode WaitProcessWideKeyAtomic(VAddr mutex_addr, VAddr condition_var
// Note: Deliberately don't attempt to inherit the lock owner's priority. // Note: Deliberately don't attempt to inherit the lock owner's priority.
Core::System::GetInstance().PrepareReschedule(); Core::System::GetInstance().CpuCore(current_thread->processor_id).PrepareReschedule();
return RESULT_SUCCESS; return RESULT_SUCCESS;
} }
@ -678,7 +678,7 @@ static ResultCode SignalProcessWideKey(VAddr condition_variable_addr, s32 target
owner->AddMutexWaiter(thread); owner->AddMutexWaiter(thread);
Core::System::GetInstance().PrepareReschedule(); Core::System::GetInstance().CpuCore(thread->processor_id).PrepareReschedule();
} }
++processed; ++processed;

View File

@ -189,7 +189,7 @@ void Thread::ResumeFromWait() {
status = THREADSTATUS_READY; status = THREADSTATUS_READY;
scheduler->ScheduleThread(this, current_priority); scheduler->ScheduleThread(this, current_priority);
Core::System::GetInstance().PrepareReschedule(); Core::System::GetInstance().CpuCore(processor_id).PrepareReschedule();
} }
/** /**