Add _sys_ppu_thread_create and sys_ppu_thread_rename error checks

This commit is contained in:
TGEnigma 2018-04-06 22:57:33 +02:00 committed by Nekotekina
parent 8da78c098c
commit 38cc92ec45

View file

@ -288,6 +288,14 @@ error_code _sys_ppu_thread_create(vm::ptr<u64> thread_id, vm::ptr<ppu_thread_par
sys_ppu_thread.warning("_sys_ppu_thread_create(thread_id=*0x%x, param=*0x%x, arg=0x%llx, unk=0x%llx, prio=%d, stacksize=0x%x, flags=0x%llx, threadname=%s)",
thread_id, param, arg, unk, prio, _stacksz, flags, threadname);
// thread_id is checked for null in stub -> CELL_ENOMEM
// unk is set to 0 in sys_ppu_thread_create stub
if (!param || !param->entry)
{
return CELL_EFAULT;
}
if (prio < 0 || prio > 3071)
{
return CELL_EINVAL;
@ -404,6 +412,11 @@ error_code sys_ppu_thread_rename(u32 thread_id, vm::cptr<char> name)
return CELL_ESRCH;
}
if (!name)
{
return CELL_EFAULT;
}
// thread_ctrl name is not changed (TODO)
thread->ppu_name.assign(name.get_ptr());
return CELL_OK;