From b8220ec12f72a6db0b7e2e14365b8142225c05b9 Mon Sep 17 00:00:00 2001 From: Eladash Date: Thu, 21 Nov 2019 23:29:29 +0200 Subject: [PATCH] Stub sys_spu_thread_group_log --- rpcs3/Emu/Cell/lv2/lv2.cpp | 2 +- rpcs3/Emu/Cell/lv2/sys_spu.cpp | 37 ++++++++++++++++++++++++++++++++++ rpcs3/Emu/Cell/lv2/sys_spu.h | 8 ++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/lv2/lv2.cpp b/rpcs3/Emu/Cell/lv2/lv2.cpp index 127c66c8aa..7708887393 100644 --- a/rpcs3/Emu/Cell/lv2/lv2.cpp +++ b/rpcs3/Emu/Cell/lv2/lv2.cpp @@ -298,7 +298,7 @@ const std::array s_ppu_syscall_table BIND_FUNC(sys_spu_thread_group_connect_event_all_threads), //251 (0x0FB) BIND_FUNC(sys_spu_thread_group_disconnect_event_all_threads), //252 (0x0FC) null_func,//BIND_FUNC(sys_spu_thread_group...) //253 (0x0FD) - null_func,//BIND_FUNC(sys_spu_thread_group_log) //254 (0x0FE) + BIND_FUNC(sys_spu_thread_group_log), //254 (0x0FE) uns_func, uns_func, uns_func, uns_func, uns_func, //255-259 UNS diff --git a/rpcs3/Emu/Cell/lv2/sys_spu.cpp b/rpcs3/Emu/Cell/lv2/sys_spu.cpp index 8004b1651f..3028ca94c1 100644 --- a/rpcs3/Emu/Cell/lv2/sys_spu.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_spu.cpp @@ -1376,6 +1376,43 @@ error_code sys_spu_thread_group_disconnect_event_all_threads(ppu_thread& ppu, u3 return CELL_OK; } +error_code sys_spu_thread_group_log(ppu_thread& ppu, s32 command, vm::ptr stat) +{ + vm::temporary_unlock(ppu); + + sys_spu.warning("sys_spu_thread_group_log(command=0x%x, stat=*0x%x)", command, stat); + + struct spu_group_log_state_t + { + atomic_t state = SYS_SPU_THREAD_GROUP_LOG_ON; + }; + + const auto state = g_fxo->get(); + + switch (command) + { + case SYS_SPU_THREAD_GROUP_LOG_GET_STATUS: + { + if (!stat) + { + return CELL_EFAULT; + } + + *stat = state->state; + break; + } + case SYS_SPU_THREAD_GROUP_LOG_ON: + case SYS_SPU_THREAD_GROUP_LOG_OFF: + { + state->state.release(command); + break; + } + default: return CELL_EINVAL; + } + + return CELL_OK; +} + error_code sys_spu_thread_recover_page_fault(ppu_thread& ppu, u32 id) { vm::temporary_unlock(ppu); diff --git a/rpcs3/Emu/Cell/lv2/sys_spu.h b/rpcs3/Emu/Cell/lv2/sys_spu.h index 3704d5e8d8..1edb65c856 100644 --- a/rpcs3/Emu/Cell/lv2/sys_spu.h +++ b/rpcs3/Emu/Cell/lv2/sys_spu.h @@ -39,6 +39,13 @@ enum : u64 SYS_SPU_THREAD_GROUP_EVENT_SYSTEM_MODULE_KEY = 0xFFFFFFFF53505504ull, }; +enum +{ + SYS_SPU_THREAD_GROUP_LOG_ON = 0x0, + SYS_SPU_THREAD_GROUP_LOG_OFF = 0x1, + SYS_SPU_THREAD_GROUP_LOG_GET_STATUS = 0x2, +}; + enum : u32 { SPU_THREAD_GROUP_STATUS_NOT_INITIALIZED, @@ -322,6 +329,7 @@ error_code sys_spu_thread_group_connect_event(ppu_thread&, u32 id, u32 eq, u32 e error_code sys_spu_thread_group_disconnect_event(ppu_thread&, u32 id, u32 et); error_code sys_spu_thread_group_connect_event_all_threads(ppu_thread&, u32 id, u32 eq_id, u64 req, vm::ptr spup); error_code sys_spu_thread_group_disconnect_event_all_threads(ppu_thread&, u32 id, u8 spup); +error_code sys_spu_thread_group_log(ppu_thread&, s32 command, vm::ptr stat); error_code sys_spu_thread_write_ls(ppu_thread&, u32 id, u32 address, u64 value, u32 type); error_code sys_spu_thread_read_ls(ppu_thread&, u32 id, u32 address, vm::ptr value, u32 type); error_code sys_spu_thread_write_spu_mb(ppu_thread&, u32 id, u32 value);