/*********************************************************************** * start thread ***********************************************************************/ int32_t vsh_menu_start(uint64_t arg) { sys_ppu_thread_create(&vsh_menu_tid, vsh_menu_thread, 0, 3000, 0x4000, 1, THREAD_NAME); _sys_ppu_thread_exit(0); return SYS_PRX_RESIDENT; }
int testplugin_start(uint64_t arg) { sys_ppu_thread_create(&thread_id, testplugin_thread, 0, 3000, 0x2000, SYS_PPU_THREAD_CREATE_JOINABLE, THREAD_NAME); // Exit thread using directly the syscall and not the user mode library or we will crash _sys_ppu_thread_exit(0); return SYS_PRX_RESIDENT; }
void sys_ppu_thread_exit(PPUThread& CPU, u64 val) { sysPrxForUser.Log("sys_ppu_thread_exit(val=0x%llx)", val); // (call registered atexit functions) // (deallocate TLS) // ... // call the syscall _sys_ppu_thread_exit(CPU, val); }
int testplugin_stop(void) { sys_ppu_thread_t t; uint64_t exit_code; sys_ppu_thread_create(&t, testplugin_stop_thread, 0, 0, 0x2000, SYS_PPU_THREAD_CREATE_JOINABLE, STOP_THREAD_NAME); sys_ppu_thread_join(t, &exit_code); finalize_module(); _sys_ppu_thread_exit(0); return SYS_PRX_STOP_OK; }
int vsh_menu_stop(void) { sys_ppu_thread_t t; uint64_t exit_code; sys_ppu_thread_create(&t, vsh_menu_stop_thread, 0, 0, 0x2000, 1, STOP_THREAD_NAME); sys_ppu_thread_join(t, &exit_code); finalize_module(); _sys_ppu_thread_exit(0); return SYS_PRX_STOP_OK; }
int art_stop(void) { //if (userCodes) // _free(userCodes); finalize_module(); exitThread = 1; while (exitThread) { sys_timer_usleep(1668); sys_ppu_thread_yield(); } _sys_ppu_thread_exit(0); return SYS_PRX_STOP_OK; }
void sys_ppu_thread_exit(PPUThread& ppu, u64 val) { sysPrxForUser.Log("sys_ppu_thread_exit(val=0x%llx)", val); // (call registered atexit functions) // (deallocate TLS) // ... if (ppu.hle_code == 0xaff080a4) { // Change sys_ppu_thread_exit code to the syscall code ppu.hle_code = ~41; } // Call the syscall return _sys_ppu_thread_exit(ppu, val); }
void sys_ppu_thread_exit(ppu_thread& ppu, u64 val) { sysPrxForUser.trace("sys_ppu_thread_exit(val=0x%llx)", val); // (call registered atexit functions) // ... // Deallocate TLS ppu_free_tls(vm::cast(ppu.gpr[13], HERE) - 0x7030); if (ppu.gpr[3] == val) { // Change sys_ppu_thread_exit code to the syscall code (hack) ppu.gpr[11] = 41; } // Call the syscall return _sys_ppu_thread_exit(ppu, val); }
int art_start(uint64_t arg) { sys_ppu_thread_create(&thread_id, art_thread, NULL, -0x1d8, 0x8000, SYS_PPU_THREAD_CREATE_JOINABLE, THREAD_NAME); _sys_ppu_thread_exit(0); return SYS_PRX_RESIDENT; }