| 398 | extern void signal_system_cache_can_stay(); |
| 399 | |
| 400 | void _sys_process_exit(ppu_thread &ppu, s32 status, u32 arg2, u32 arg3) { |
| 401 | ppu.state += cpu_flag::wait; |
| 402 | |
| 403 | sys_process.warning("_sys_process_exit(status=%d, arg2=0x%x, arg3=0x%x)", |
| 404 | status, arg2, arg3); |
| 405 | |
| 406 | Emu.CallFromMainThread([]() { |
| 407 | sys_process.success("Process finished"); |
| 408 | signal_system_cache_can_stay(); |
| 409 | Emu.Kill(); |
| 410 | }); |
| 411 | |
| 412 | // Wait for GUI thread |
| 413 | while (auto state = +ppu.state) { |
| 414 | if (is_stopped(state)) { |
| 415 | break; |
| 416 | } |
| 417 | |
| 418 | ppu.state.wait(state); |
| 419 | } |
| 420 | } |
| 421 | |
| 422 | void _sys_process_exit2(ppu_thread &ppu, s32 status, |
| 423 | vm::ptr<sys_exit2_param> arg, u32 arg_size, u32 arg4) { |
no test coverage detected