MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / ppu_load_exec

Function ppu_load_exec

rpcs3/Emu/Cell/PPUModule.cpp:2092–2865  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2090}
2091
2092bool ppu_load_exec(const ppu_exec_object& elf, bool virtual_load, const std::string& elf_path, utils::serial* ar)
2093{
2094 if (elf != elf_error::ok)
2095 {
2096 return false;
2097 }
2098
2099 // Check if it is a standalone executable first
2100 for (const auto& prog : elf.progs)
2101 {
2102 if (prog.p_type == 0x1u /* LOAD */ && prog.p_memsz)
2103 {
2104 using addr_range = utils::address_range;
2105
2106 const addr_range r = addr_range::start_length(static_cast<u32>(prog.p_vaddr), static_cast<u32>(prog.p_memsz));
2107
2108 if ((prog.p_vaddr | prog.p_memsz) > u32{umax} || !r.valid() || !r.inside(addr_range::start_length(0x00000000, 0x30000000)))
2109 {
2110 return false;
2111 }
2112 }
2113 }
2114
2115 init_ppu_functions(ar, false);
2116
2117 // Set for delayed initialization in ppu_initialize()
2118 auto& _main = g_fxo->get<main_ppu_module<lv2_obj>>();
2119
2120 // Access linkage information object
2121 auto& link = g_fxo->get<ppu_linkage_info>();
2122
2123 // TLS information
2124 u32 tls_vaddr = 0;
2125 u32 tls_fsize = 0;
2126 u32 tls_vsize = 0;
2127
2128 // Process information
2129 u32 sdk_version = SYS_PROCESS_PARAM_SDK_VERSION_UNKNOWN;
2130 s32 primary_prio = 1001;
2131 u32 primary_stacksize = SYS_PROCESS_PARAM_STACK_SIZE_MAX;
2132 u32 malloc_pagesize = SYS_PROCESS_PARAM_MALLOC_PAGE_SIZE_1M;
2133 u32 ppc_seg = 0;
2134
2135 // Limit for analysis
2136 u32 end = 0;
2137
2138 // Executable hash
2139 sha1_context sha;
2140 sha1_starts(&sha);
2141
2142 struct on_fatal_error
2143 {
2144 ppu_module<lv2_obj>& _main;
2145 bool errored = true;
2146
2147 ~on_fatal_error()
2148 {
2149 if (!errored)

Callers 3

implMethod · 0.85
LoadMethod · 0.85
ppu_precompileFunction · 0.85

Calls 15

init_ppu_functionsFunction · 0.85
baseFunction · 0.85
size32Function · 0.85
alignUpFunction · 0.85
page_protectFunction · 0.85
ppu_register_rangeFunction · 0.85
ppu_initialize_modulesFunction · 0.85
ppu_load_exportsFunction · 0.85
tieClass · 0.85
ppu_load_importsFunction · 0.85
getFunction · 0.85

Tested by

no test coverage detected