diff --git a/rpcs3/Emu/SysCalls/FuncList.cpp b/rpcs3/Emu/SysCalls/FuncList.cpp index 0bd28091c4..ee1923c511 100644 --- a/rpcs3/Emu/SysCalls/FuncList.cpp +++ b/rpcs3/Emu/SysCalls/FuncList.cpp @@ -3592,7 +3592,6 @@ s64 SysCalls::DoFunc(const u32 id) case 0x4643ba6e: FUNC_LOG_ERROR("TODO: sys_mmapper_unmap_memory"); case 0x4a071d98: FUNC_LOG_ERROR("TODO: sys_interrupt_thread_disestablish"); case 0x4b2f301a: FUNC_LOG_ERROR("TODO: _sys_tolower"); - case 0x4f7172c9: FUNC_LOG_ERROR("TODO: sys_process_is_stack"); case 0x5267cb35: FUNC_LOG_ERROR("TODO: sys_spinlock_unlock"); case 0x52aadadf: FUNC_LOG_ERROR("TODO: sys_lwcond_signal_to"); case 0x5fdfb2fe: FUNC_LOG_ERROR("TODO: _sys_spu_printf_detach_group"); diff --git a/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp b/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp index 424b0139e1..3ee463cc6b 100644 --- a/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp @@ -22,6 +22,15 @@ s64 sys_process_at_Exitspawn() return 0; } +int sys_process_is_stack(u32 p) +{ + PPCThread* CPU = GetCurrentPPCThread(); + if (p >= CPU->GetStackAddr() && p <= CPU->GetStackAddr() + CPU->GetStackSize()) + return 1; + + return 0; +} + int sys_spu_printf_initialize(int a1, int a2, int a3, int a4, int a5) { sysPrxForUser.Warning("sys_spu_printf_initialize(0x%x, 0x%x, 0x%x, 0x%x, 0x%x)", a1, a2, a3, a4, a5); @@ -62,6 +71,7 @@ void sysPrxForUser_init() sysPrxForUser.AddFunc(0xe6f2c1e7, sys_process_exit); sysPrxForUser.AddFunc(0x2c847572, sys_process_atexitspawn); sysPrxForUser.AddFunc(0x96328741, sys_process_at_Exitspawn); + sysPrxForUser.AddFunc(0x4f7172c9, sys_process_is_stack); sysPrxForUser.AddFunc(0x24a1ea07, sys_ppu_thread_create); sysPrxForUser.AddFunc(0x350d454e, sys_ppu_thread_get_id); diff --git a/rpcs3/Emu/SysCalls/SysCalls.h b/rpcs3/Emu/SysCalls/SysCalls.h index 7dfb90e6cf..e36d8d83b9 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.h +++ b/rpcs3/Emu/SysCalls/SysCalls.h @@ -117,7 +117,6 @@ extern int sys_process_get_number_of_object(u32 object, mem32_t nump); extern int sys_process_get_id(u32 object, mem8_ptr_t buffer, u32 size, mem32_t set_size); extern int sys_process_get_paramsfo(mem8_ptr_t buffer); extern int sys_process_exit(int errorcode); -extern int sys_process_is_stack(u32 addr); //TODO: Is this a lv2 SysCall? If so, where is its number? extern int sys_game_process_exitspawn(u32 path_addr, u32 argv_addr, u32 envp_addr, u32 data, u32 data_size, int prio, u64 flags ); diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Process.cpp b/rpcs3/Emu/SysCalls/lv2/SC_Process.cpp index d65f554032..0fd91cbe8e 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Process.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Process.cpp @@ -245,15 +245,6 @@ int sys_process_get_paramsfo(mem8_ptr_t buffer) return CELL_OK;*/ } -int sys_process_is_stack(u32 p) -{ - PPCThread* CPU = GetCurrentPPCThread(); - if (p >= CPU->GetStackAddr() && p <= CPU->GetStackAddr() + CPU->GetStackSize()) - return 1; - - return 0; -} - /* int SysCalls::lv2ProcessWaitForChild(PPUThread& CPU) {