mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 06:51:26 +12: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
1 changed files with 7 additions and 5 deletions
|
@ -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);
|
const auto thread = idm::get<SPUThread>(id);
|
||||||
|
|
||||||
if (!thread)
|
if (UNLIKELY(!thread))
|
||||||
{
|
{
|
||||||
return CELL_ESRCH;
|
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_ESTAT;
|
||||||
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
error_code sys_spu_thread_group_create(vm::ptr<u32> id, u32 num, s32 prio, vm::ptr<sys_spu_thread_group_attribute> attr)
|
error_code sys_spu_thread_group_create(vm::ptr<u32> id, u32 num, s32 prio, vm::ptr<sys_spu_thread_group_attribute> attr)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue