mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #13298 from sum2012/kernel_patch
Fix sceKernelExitThread
This commit is contained in:
commit
6e4e9a2e84
3 changed files with 10 additions and 4 deletions
|
@ -744,7 +744,7 @@ const HLEFunction ThreadManForUser[] =
|
|||
{0X1181E963, &WrapI_U<sceKernelDelaySysClockThreadCB>, "sceKernelDelaySysClockThreadCB", 'i', "P", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED },
|
||||
{0XCEADEB47, &WrapI_U<sceKernelDelayThread>, "sceKernelDelayThread", 'i', "x", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED },
|
||||
{0X68DA9E36, &WrapI_U<sceKernelDelayThreadCB>, "sceKernelDelayThreadCB", 'i', "x", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED },
|
||||
{0XAA73C935, &WrapV_I<sceKernelExitThread>, "sceKernelExitThread", 'v', "i" },
|
||||
{0XAA73C935, &WrapI_I<sceKernelExitThread>, "sceKernelExitThread", 'i', "i" },
|
||||
{0X809CE29B, &WrapV_I<sceKernelExitDeleteThread>, "sceKernelExitDeleteThread", 'v', "i" },
|
||||
{0x94aa61ee, &WrapI_V<sceKernelGetThreadCurrentPriority>, "sceKernelGetThreadCurrentPriority", 'i', "" },
|
||||
{0X293B45B8, &WrapI_V<sceKernelGetThreadId>, "sceKernelGetThreadId", 'i', "", HLE_NOT_IN_INTERRUPT },
|
||||
|
@ -887,7 +887,7 @@ const HLEFunction ThreadManForKernel[] =
|
|||
{0x446D8DE6, &WrapI_CUUIUU<sceKernelCreateThread>, "sceKernelCreateThread", 'i', "sxxixx", HLE_NOT_IN_INTERRUPT | HLE_KERNEL_SYSCALL },
|
||||
{0xF475845D, &WrapI_IIU<sceKernelStartThread>, "sceKernelStartThread", 'i', "iix", HLE_NOT_IN_INTERRUPT | HLE_KERNEL_SYSCALL },
|
||||
{0X9FA03CD3, &WrapI_I<sceKernelDeleteThread>, "sceKernelDeleteThread", 'i', "i", HLE_KERNEL_SYSCALL },
|
||||
{0XAA73C935, &WrapV_I<sceKernelExitThread>, "sceKernelExitThread", 'v', "i", HLE_KERNEL_SYSCALL },
|
||||
{0XAA73C935, &WrapI_I<sceKernelExitThread>, "sceKernelExitThread", 'i', "i", HLE_KERNEL_SYSCALL },
|
||||
{0X809CE29B, &WrapV_I<sceKernelExitDeleteThread>, "sceKernelExitDeleteThread", 'v', "i", HLE_KERNEL_SYSCALL },
|
||||
{0X9944F31F, &WrapI_I<sceKernelSuspendThread>, "sceKernelSuspendThread", 'i', "i", HLE_KERNEL_SYSCALL },
|
||||
{0X75156E8F, &WrapI_I<sceKernelResumeThread>, "sceKernelResumeThread", 'i', "i", HLE_KERNEL_SYSCALL },
|
||||
|
|
|
@ -2148,11 +2148,16 @@ void __KernelReturnFromThread()
|
|||
// The stack will be deallocated when the thread is deleted.
|
||||
}
|
||||
|
||||
void sceKernelExitThread(int exitStatus) {
|
||||
int sceKernelExitThread(int exitStatus) {
|
||||
if (!__KernelIsDispatchEnabled() && sceKernelGetCompiledSdkVersion() > 0x0307FFFF)
|
||||
return hleLogError(SCEKERNEL, SCE_KERNEL_ERROR_CAN_NOT_WAIT);
|
||||
PSPThread *thread = __GetCurrentThread();
|
||||
_dbg_assert_msg_(thread != NULL, "Exited from a NULL thread.");
|
||||
|
||||
INFO_LOG(SCEKERNEL, "sceKernelExitThread(%d)", exitStatus);
|
||||
if (exitStatus < 0) {
|
||||
exitStatus = SCE_KERNEL_ERROR_ILLEGAL_ARGUMENT;
|
||||
}
|
||||
__KernelStopThread(currentThread, exitStatus, "thread exited");
|
||||
|
||||
hleReSchedule("thread exited");
|
||||
|
@ -2161,6 +2166,7 @@ void sceKernelExitThread(int exitStatus) {
|
|||
__KernelThreadTriggerEvent((thread->nt.attr & PSP_THREAD_ATTR_KERNEL) != 0, thread->GetUID(), THREADEVENT_EXIT);
|
||||
|
||||
// The stack will be deallocated when the thread is deleted.
|
||||
return 0;
|
||||
}
|
||||
|
||||
void _sceKernelExitThread(int exitStatus) {
|
||||
|
|
|
@ -41,7 +41,7 @@ void __KernelStopThread(SceUID threadID, int exitStatus, const char *reason);
|
|||
u32 __KernelDeleteThread(SceUID threadID, int exitStatus, const char *reason);
|
||||
int sceKernelDeleteThread(int threadHandle);
|
||||
void sceKernelExitDeleteThread(int exitStatus);
|
||||
void sceKernelExitThread(int exitStatus);
|
||||
int sceKernelExitThread(int exitStatus);
|
||||
void _sceKernelExitThread(int exitStatus);
|
||||
SceUID sceKernelGetThreadId();
|
||||
int sceKernelGetThreadCurrentPriority();
|
||||
|
|
Loading…
Add table
Reference in a new issue