From 14ac70dfbfb6ac5040543d4c1bc17a6f44bbddc4 Mon Sep 17 00:00:00 2001 From: Eladash Date: Mon, 12 Aug 2019 07:31:05 +0300 Subject: [PATCH] Avoid using _sys_ppu_thread_exit in _sys_interrupt_thread_disestablish --- rpcs3/Emu/Cell/lv2/sys_interrupt.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp b/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp index f03d62d149..a218275bb7 100644 --- a/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp @@ -23,18 +23,24 @@ void lv2_int_serv::exec() thread_ctrl::notify(*thread); } +bool interrupt_thread_exit(ppu_thread& ppu) +{ + ppu.state += cpu_flag::exit; + return false; +} + void lv2_int_serv::join() { - // Enqueue _sys_ppu_thread_exit call thread->cmd_list ({ - { ppu_cmd::set_args, 1 }, u64{0}, - { ppu_cmd::set_gpr, 11 }, u64{41}, - { ppu_cmd::opcode, ppu_instructions::SC(0) }, + { ppu_cmd::ptr_call, 0 }, + std::bit_cast(&interrupt_thread_exit) }); thread_ctrl::notify(*thread); (*thread)(); + + idm::remove>(thread->id); } error_code sys_interrupt_tag_destroy(ppu_thread& ppu, u32 intrtag)