mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-16 23:17:29 +00:00
hle: add a missing check in sys_spu
check if exit code exists and the spu is stopped by a stop instruction and optimize the way were getting the exit code
This commit is contained in:
parent
956ae17876
commit
5b5f2d4240
@ -278,16 +278,18 @@ error_code sys_spu_thread_get_exit_status(u32 id, vm::ptr<u32> status)
|
||||
|
||||
const auto thread = idm::get<SPUThread>(id);
|
||||
|
||||
if (!thread)
|
||||
if (UNLIKELY(!thread))
|
||||
{
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
// TODO: check CELL_ESTAT condition
|
||||
if (thread->status & SPU_STATUS_STOPPED_BY_STOP)
|
||||
{
|
||||
*status = thread->ch_out_mbox.get_value();
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
*status = thread->ch_out_mbox.pop(*thread);
|
||||
|
||||
return CELL_OK;
|
||||
return CELL_ESTAT;
|
||||
}
|
||||
|
||||
error_code sys_spu_thread_group_create(vm::ptr<u32> id, u32 num, s32 prio, vm::ptr<sys_spu_thread_group_attribute> attr)
|
||||
|
Loading…
Reference in New Issue
Block a user