mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-06 00:40:11 +00:00
Check sys_spu_thread_group_create's nsize (#3742)
* Check sys_spu_thread_group_create's nsize * cellSearch callback correction
This commit is contained in:
parent
fb52cbb8b2
commit
58c42ad9c0
@ -3,6 +3,7 @@
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
#include "cellSearch.h"
|
||||
#include "cellSysutil.h"
|
||||
|
||||
logs::channel cellSearch("cellSearch");
|
||||
|
||||
@ -13,7 +14,11 @@ s32 cellSearchInitialize(ppu_thread& ppu, CellSearchMode mode, u32 container, vm
|
||||
// TODO: Store the arguments somewhere so we can use them later.
|
||||
|
||||
//inform callback that search is alive
|
||||
func(ppu, CELL_SEARCH_EVENT_INITIALIZE_RESULT, CELL_OK, vm::null, userData);
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
func(ppu, CELL_SEARCH_EVENT_INITIALIZE_RESULT, CELL_OK, vm::null, userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ error_code sys_spu_thread_group_create(vm::ptr<u32> id, u32 num, s32 prio, vm::p
|
||||
|
||||
// TODO: max num value should be affected by sys_spu_initialize() settings
|
||||
|
||||
if (!num || num > 6 || ((prio < 16 || prio > 255) && attr->type != SYS_SPU_THREAD_GROUP_TYPE_EXCLUSIVE_NON_CONTEXT))
|
||||
if (attr->nsize > 0x80 || !num || num > 6 || ((prio < 16 || prio > 255) && attr->type != SYS_SPU_THREAD_GROUP_TYPE_EXCLUSIVE_NON_CONTEXT))
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
@ -306,7 +306,7 @@ error_code sys_spu_thread_group_create(vm::ptr<u32> id, u32 num, s32 prio, vm::p
|
||||
sys_spu.todo("Unsupported SPU Thread Group type (0x%x)", attr->type);
|
||||
}
|
||||
|
||||
*id = idm::make<lv2_spu_group>(std::string(attr->name.get_ptr(), attr->nsize - 1), num, prio, attr->type, attr->ct);
|
||||
*id = idm::make<lv2_spu_group>(std::string(attr->name.get_ptr(), std::max<u32>(attr->nsize, 1) - 1), num, prio, attr->type, attr->ct);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user