From eb8bb7d6c8838270fc3019d1f309edc4f06c7796 Mon Sep 17 00:00:00 2001 From: Elad <18193363+elad335@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:58:43 +0200 Subject: [PATCH] Perf fix --- rpcs3/Emu/Cell/lv2/sys_sync.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_sync.h b/rpcs3/Emu/Cell/lv2/sys_sync.h index ba3b074e66..afc92edd9d 100644 --- a/rpcs3/Emu/Cell/lv2/sys_sync.h +++ b/rpcs3/Emu/Cell/lv2/sys_sync.h @@ -6,6 +6,7 @@ #include "Emu/CPU/CPUThread.h" #include "Emu/Cell/ErrorCodes.h" #include "Emu/Cell/timers.hpp" +#include "Emu/Memory/vm_reservation.h" #include "Emu/IdManager.h" #include "Emu/IPC.h" @@ -66,11 +67,6 @@ struct ppu_non_sleeping_count_t u32 onproc_count; }; -namespace vm -{ - extern u8 g_reservations[65536 / 128 * 64]; -} - // Base class for some kernel objects (shared set of 8192 objects). struct lv2_obj { @@ -458,8 +454,12 @@ public: if (cpu != &g_to_notify) { - if (cpu >= vm::g_reservations && cpu <= vm::g_reservations + (std::size(vm::g_reservations) - 1)) + const auto res_start = vm::reservation_notifier(0).second; + const auto res_end = vm::reservation_notifier(umax).second; + + if (cpu >= res_start && cpu <= res_end) { + // Notify SPU reservation atomic_wait_engine::notify_all(cpu); } else