mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Kernel: Stop reporting invalid semaphore names.
This commit is contained in:
parent
a000c32820
commit
91bfa3ee49
2 changed files with 12 additions and 20 deletions
|
@ -713,7 +713,7 @@ const HLEFunction ThreadManForUser[] =
|
|||
{0XA66B0120, &WrapU_IU<sceKernelReferEventFlagStatus>, "sceKernelReferEventFlagStatus", 'x', "ix" },
|
||||
|
||||
{0X8FFDF9A2, &WrapI_IIU<sceKernelCancelSema>, "sceKernelCancelSema", 'i', "iix" },
|
||||
{0XD6DA4BA1, &WrapI_CUIIU<sceKernelCreateSema>, "sceKernelCreateSema", 'i', "sxiix" },
|
||||
{0XD6DA4BA1, &WrapI_CUIIU<sceKernelCreateSema>, "sceKernelCreateSema", 'i', "sxiip" },
|
||||
{0X28B6489C, &WrapI_I<sceKernelDeleteSema>, "sceKernelDeleteSema", 'i', "i" },
|
||||
{0X58B1F937, &WrapI_II<sceKernelPollSema>, "sceKernelPollSema", 'i', "ii" },
|
||||
{0XBC6FEBC5, &WrapI_IU<sceKernelReferSemaStatus>, "sceKernelReferSemaStatus", 'i', "ip" },
|
||||
|
@ -899,7 +899,7 @@ const HLEFunction ThreadManForKernel[] =
|
|||
{0X75156E8F, &WrapI_I<sceKernelResumeThread>, "sceKernelResumeThread", 'i', "i", HLE_KERNEL_SYSCALL },
|
||||
{0X94416130, &WrapU_UUUU<sceKernelGetThreadmanIdList>, "sceKernelGetThreadmanIdList", 'x', "xxxx", HLE_KERNEL_SYSCALL },
|
||||
{0x278c0df5, &WrapI_IU<sceKernelWaitThreadEnd>, "sceKernelWaitThreadEnd", 'i', "ix", HLE_KERNEL_SYSCALL },
|
||||
{0xd6da4ba1, &WrapI_CUIIU<sceKernelCreateSema>, "sceKernelCreateSema", 'i', "sxiix", HLE_KERNEL_SYSCALL },
|
||||
{0xd6da4ba1, &WrapI_CUIIU<sceKernelCreateSema>, "sceKernelCreateSema", 'i', "sxiip", HLE_KERNEL_SYSCALL },
|
||||
{0x28b6489c, &WrapI_I<sceKernelDeleteSema>, "sceKernelDeleteSema", 'i', "i", HLE_KERNEL_SYSCALL },
|
||||
{0x3f53e640, &WrapI_II<sceKernelSignalSema>, "sceKernelSignalSema", 'i', "ii", HLE_KERNEL_SYSCALL },
|
||||
{0x4e3a1105, &WrapI_IIU<sceKernelWaitSema>, "sceKernelWaitSema", 'i', "iix", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED | HLE_KERNEL_SYSCALL},
|
||||
|
|
|
@ -203,18 +203,11 @@ int sceKernelCancelSema(SceUID id, int newCount, u32 numWaitThreadsPtr)
|
|||
}
|
||||
}
|
||||
|
||||
int sceKernelCreateSema(const char* name, u32 attr, int initVal, int maxVal, u32 optionPtr)
|
||||
{
|
||||
int sceKernelCreateSema(const char* name, u32 attr, int initVal, int maxVal, u32 optionPtr) {
|
||||
if (!name)
|
||||
{
|
||||
WARN_LOG_REPORT(SCEKERNEL, "%08x=sceKernelCreateSema(): invalid name", SCE_KERNEL_ERROR_ERROR);
|
||||
return SCE_KERNEL_ERROR_ERROR;
|
||||
}
|
||||
return hleLogWarning(SCEKERNEL, SCE_KERNEL_ERROR_ERROR, "invalid name");
|
||||
if (attr >= 0x200)
|
||||
{
|
||||
WARN_LOG_REPORT(SCEKERNEL, "%08x=sceKernelCreateSema(): invalid attr parameter: %08x", SCE_KERNEL_ERROR_ILLEGAL_ATTR, attr);
|
||||
return SCE_KERNEL_ERROR_ILLEGAL_ATTR;
|
||||
}
|
||||
return hleLogWarning(SCEKERNEL, SCE_KERNEL_ERROR_ILLEGAL_ATTR, "invalid attr parameter %08x", attr);
|
||||
|
||||
PSPSemaphore *s = new PSPSemaphore();
|
||||
SceUID id = kernelObjects.Create(s);
|
||||
|
@ -228,18 +221,17 @@ int sceKernelCreateSema(const char* name, u32 attr, int initVal, int maxVal, u32
|
|||
s->ns.maxCount = maxVal;
|
||||
s->ns.numWaitThreads = 0;
|
||||
|
||||
DEBUG_LOG(SCEKERNEL, "%i=sceKernelCreateSema(%s, %08x, %i, %i, %08x)", id, s->ns.name, s->ns.attr, s->ns.initCount, s->ns.maxCount, optionPtr);
|
||||
|
||||
if (optionPtr != 0)
|
||||
{
|
||||
u32 size = Memory::Read_U32(optionPtr);
|
||||
if (size > 4)
|
||||
WARN_LOG_REPORT(SCEKERNEL, "sceKernelCreateSema(%s) unsupported options parameter, size = %d", name, size);
|
||||
// Many games pass garbage into optionPtr, it doesn't have any options.
|
||||
if (optionPtr != 0) {
|
||||
if (!Memory::IsValidRange(optionPtr, 4))
|
||||
hleLogWarning(SCEKERNEL, id, "invalid options parameter");
|
||||
else if (Memory::Read_U32(optionPtr) > 4)
|
||||
hleLogDebug(SCEKERNEL, id, "invalid options parameter size");
|
||||
}
|
||||
if ((attr & ~PSP_SEMA_ATTR_PRIORITY) != 0)
|
||||
WARN_LOG_REPORT(SCEKERNEL, "sceKernelCreateSema(%s) unsupported attr parameter: %08x", name, attr);
|
||||
|
||||
return id;
|
||||
return hleLogSuccessX(SCEKERNEL, id);
|
||||
}
|
||||
|
||||
int sceKernelDeleteSema(SceUID id)
|
||||
|
|
Loading…
Add table
Reference in a new issue