int sceKernelAllocateVplCB(SceUID uid, u32 size, u32 addrPtr, u32 timeoutPtr) { u32 error, ignore; if (__KernelAllocateVpl(uid, size, addrPtr, error, __FUNCTION__)) { hleCheckCurrentCallbacks(); VPL *vpl = kernelObjects.Get<VPL>(uid, ignore); if (error == SCE_KERNEL_ERROR_NO_MEMORY) { if (vpl) { vpl->nv.numWaitThreads++; SceUID threadID = __KernelGetCurThread(); __KernelVplRemoveThread(vpl, threadID); VplWaitingThread waiting = {threadID, addrPtr}; vpl->waitingThreads.push_back(waiting); } __KernelSetVplTimeout(timeoutPtr); __KernelWaitCurThread(WAITTYPE_VPL, uid, size, timeoutPtr, true, "vpl waited"); } } return error; }
int sceKernelTryAllocateVpl(SceUID uid, u32 size, u32 addrPtr) { u32 error; __KernelAllocateVpl(uid, size, addrPtr, error, __FUNCTION__); return error; }