diff --git a/rpcs3/Emu/Cell/lv2/sys_sync.h b/rpcs3/Emu/Cell/lv2/sys_sync.h index 3233213613..bd09d26a61 100644 --- a/rpcs3/Emu/Cell/lv2/sys_sync.h +++ b/rpcs3/Emu/Cell/lv2/sys_sync.h @@ -60,6 +60,11 @@ enum enum ppu_thread_status : u32; +namespace vm +{ + extern u8 g_reservations[65536 / 128 * 64]; +} + // Base class for some kernel objects (shared set of 8192 objects). struct lv2_obj { @@ -432,9 +437,15 @@ public: if (cpu != &g_to_notify) { - // Note: by the time of notification the thread could have been deallocated which is why the direct function is used - // TODO: Pass a narrower mask - atomic_wait_engine::notify_one(cpu); + if (cpu >= vm::g_reservations && cpu <= vm::g_reservations + (std::size(vm::g_reservations) - 1)) + { + atomic_wait_engine::notify_all(cpu); + } + else + { + // Note: by the time of notification the thread could have been deallocated which is why the direct function is used + atomic_wait_engine::notify_one(cpu); + } } } diff --git a/rpcs3/Emu/Memory/vm.h b/rpcs3/Emu/Memory/vm.h index 34e3bbe032..f008c9aee9 100644 --- a/rpcs3/Emu/Memory/vm.h +++ b/rpcs3/Emu/Memory/vm.h @@ -22,7 +22,7 @@ namespace vm extern u8* const g_exec_addr; extern u8* const g_stat_addr; extern u8* const g_free_addr; - extern u8 g_reservations[]; + extern u8 g_reservations[65536 / 128 * 64]; struct writer_lock;