PPUThread::~PPUThread() { if (is_current()) { detach(); } else { join(); } close_stack(); ppu_free_tls(m_id); }
s32 sys_interrupt_thread_disestablish(PPUThread& ppu, u32 ih) { sysPrxForUser.notice("sys_interrupt_thread_disestablish(ih=0x%x)", ih); vm::var<u64> r13; // Call the syscall if (s32 res = _sys_interrupt_thread_disestablish(ppu, ih, r13)) { return res; } // Deallocate TLS ppu_free_tls(vm::cast(*r13, HERE) - 0x7030); return CELL_OK; }
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); }