Avoid using _sys_ppu_thread_exit in _sys_interrupt_thread_disestablish

This commit is contained in:
Eladash 2019-08-12 07:31:05 +03:00 committed by Ivan
parent 4b82006984
commit 14ac70dfbf
1 changed files with 10 additions and 4 deletions

View File

@ -23,18 +23,24 @@ void lv2_int_serv::exec()
thread_ctrl::notify(*thread); thread_ctrl::notify(*thread);
} }
bool interrupt_thread_exit(ppu_thread& ppu)
{
ppu.state += cpu_flag::exit;
return false;
}
void lv2_int_serv::join() void lv2_int_serv::join()
{ {
// Enqueue _sys_ppu_thread_exit call
thread->cmd_list thread->cmd_list
({ ({
{ ppu_cmd::set_args, 1 }, u64{0}, { ppu_cmd::ptr_call, 0 },
{ ppu_cmd::set_gpr, 11 }, u64{41}, std::bit_cast<u64>(&interrupt_thread_exit)
{ ppu_cmd::opcode, ppu_instructions::SC(0) },
}); });
thread_ctrl::notify(*thread); thread_ctrl::notify(*thread);
(*thread)(); (*thread)();
idm::remove<named_thread<ppu_thread>>(thread->id);
} }
error_code sys_interrupt_tag_destroy(ppu_thread& ppu, u32 intrtag) error_code sys_interrupt_tag_destroy(ppu_thread& ppu, u32 intrtag)