SPU: Power consumption reduction when using SPU inaccurate reservations

This commit is contained in:
Eladash 2022-09-12 19:39:08 +03:00 committed by Ivan
parent 92514e33bb
commit cfdc852f03
3 changed files with 55 additions and 1 deletions

View file

@ -5,6 +5,7 @@
#include "Emu/System.h"
#include "Emu/system_config.h"
#include "Emu/Memory/vm_locking.h"
#include "Emu/Memory/vm_reservation.h"
#include "Emu/IdManager.h"
#include "Emu/GDB.h"
#include "Emu/Cell/PPUThread.h"
@ -892,6 +893,14 @@ cpu_thread& cpu_thread::operator=(thread_state)
if (old & cpu_flag::wait && old.none_of(cpu_flag::again + cpu_flag::exit))
{
state.notify_one(cpu_flag::exit);
if (auto thread = try_get<spu_thread>())
{
if (u32 resv = atomic_storage<u32>::load(thread->raddr))
{
vm::reservation_notifier(resv).notify_one();
}
}
}
return *this;