From 617d21fa84ea2a4a8e93ec774a492b82d0639f04 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Fri, 23 Apr 2021 21:16:00 +0200 Subject: [PATCH] sys_prx: more constants --- rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp | 2 +- rpcs3/Emu/Cell/Modules/sysPrxForUser.h | 5 +++++ rpcs3/Emu/Cell/lv2/sys_prx.h | 28 ++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp b/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp index d1d69a764a..0b6a78d6b7 100644 --- a/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp +++ b/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp @@ -73,7 +73,7 @@ error_code sys_get_random_number(vm::ptr addr, u64 size) { sysPrxForUser.warning("sys_get_random_number(addr=*0x%x, size=%d)", addr, size); - if (size > 0x1000) + if (size > RANDOM_NUMBER_MAX_SIZE) { return CELL_EINVAL; } diff --git a/rpcs3/Emu/Cell/Modules/sysPrxForUser.h b/rpcs3/Emu/Cell/Modules/sysPrxForUser.h index 27b87af6d6..8870277d55 100644 --- a/rpcs3/Emu/Cell/Modules/sysPrxForUser.h +++ b/rpcs3/Emu/Cell/Modules/sysPrxForUser.h @@ -3,6 +3,11 @@ #include "Emu/Memory/vm_ptr.h" #include "Emu/Cell/ErrorCodes.h" +enum +{ + RANDOM_NUMBER_MAX_SIZE = 4096 +}; + using spu_printf_cb_t = vm::ptr; // Aux diff --git a/rpcs3/Emu/Cell/lv2/sys_prx.h b/rpcs3/Emu/Cell/lv2/sys_prx.h index 73a76dbac4..cedfda76ed 100644 --- a/rpcs3/Emu/Cell/lv2/sys_prx.h +++ b/rpcs3/Emu/Cell/lv2/sys_prx.h @@ -32,6 +32,12 @@ enum CellPrxError : u32 CELL_PRX_ERROR_UNDEFINED_SYMBOL = 0x80011904, // References undefined symbols CELL_PRX_ERROR_UNSUPPORTED_RELOCATION_TYPE = 0x80011905, // Uses unsupported relocation type CELL_PRX_ERROR_ELF_IS_REGISTERED = 0x80011910, // Fixed ELF is already registered + CELL_PRX_ERROR_NO_EXIT_ENTRY = 0x80011911, +}; + +enum +{ + SYS_PRX_MODULE_FILENAME_SIZE = 512 }; struct sys_prx_get_module_id_by_name_option_t @@ -147,6 +153,12 @@ enum : u32 { SYS_PRX_RESIDENT = 0, SYS_PRX_NO_RESIDENT = 1, + + SYS_PRX_START_OK = 0, + + SYS_PRX_STOP_SUCCESS = 0, + SYS_PRX_STOP_OK = 0, + SYS_PRX_STOP_FAILED = 1 }; // Unofficial names for PRX state @@ -185,6 +197,22 @@ enum : u64 SYS_PRX_LOAD_MODULE_FLAGS_INVALIDMASK = ~SYS_PRX_LOAD_MODULE_FLAGS_FIXEDADDR, }; +// PPC +enum +{ + SYS_PRX_R_PPC_ADDR32 = 1, + SYS_PRX_R_PPC_ADDR16_LO = 4, + SYS_PRX_R_PPC_ADDR16_HI = 5, + SYS_PRX_R_PPC_ADDR16_HA = 6, + + SYS_PRX_R_PPC64_ADDR32 = SYS_PRX_R_PPC_ADDR32, + SYS_PRX_R_PPC64_ADDR16_LO = SYS_PRX_R_PPC_ADDR16_LO, + SYS_PRX_R_PPC64_ADDR16_HI = SYS_PRX_R_PPC_ADDR16_HI, + SYS_PRX_R_PPC64_ADDR16_HA = SYS_PRX_R_PPC_ADDR16_HA, + SYS_PRX_R_PPC64_ADDR64 = 38, + SYS_PRX_VARLINK_TERMINATE32 = 0x00000000 +}; + // SysCalls error_code sys_prx_get_ppu_guid(ppu_thread& ppu);