From 63606634bbee7b0ceecaa48545dfb9c9f56654bf Mon Sep 17 00:00:00 2001 From: sum2012 Date: Mon, 31 Oct 2022 20:17:12 +0800 Subject: [PATCH 1/2] Add InterruptManagerForKernel Find in #16297 --- Core/HLE/HLETables.cpp | 1 + Core/HLE/sceKernelInterrupt.cpp | 28 ++++++++++++++++++++++++++++ Core/HLE/sceKernelInterrupt.h | 1 + 3 files changed, 30 insertions(+) diff --git a/Core/HLE/HLETables.cpp b/Core/HLE/HLETables.cpp index 016a19e5c1..d12f07d0c2 100644 --- a/Core/HLE/HLETables.cpp +++ b/Core/HLE/HLETables.cpp @@ -306,6 +306,7 @@ void RegisterAllModules() { Register_semaphore(); Register_sceDdrdb(); Register_mp4msv(); + Register_InterruptManagerForKernel(); // add new modules here. } diff --git a/Core/HLE/sceKernelInterrupt.cpp b/Core/HLE/sceKernelInterrupt.cpp index 3dadc4dc77..d541ebcd51 100644 --- a/Core/HLE/sceKernelInterrupt.cpp +++ b/Core/HLE/sceKernelInterrupt.cpp @@ -871,3 +871,31 @@ void Register_InterruptManager() { RegisterModule("InterruptManager", ARRAY_SIZE(InterruptManager), InterruptManager); } + + +const HLEFunction InterruptManagerForKernel[] = +{ + {0x092968F4, &WrapI_V, "sceKernelCpuSuspendIntr", 'i', "" ,HLE_KERNEL_SYSCALL }, + {0X5F10D406, &WrapV_U, "sceKernelCpuResumeIntr", 'v', "x" ,HLE_KERNEL_SYSCALL }, + {0X3B84732D, &WrapV_U, "sceKernelCpuResumeIntrWithSync", 'v', "x" ,HLE_KERNEL_SYSCALL }, + {0X47A0B729, &WrapI_I, "sceKernelIsCpuIntrSuspended", 'i', "i" ,HLE_KERNEL_SYSCALL }, + {0xb55249d2, &WrapI_V, "sceKernelIsCpuIntrEnable", 'i', "", HLE_KERNEL_SYSCALL }, + {0XA089ECA4, &WrapU_UUU, "sceKernelMemset", 'x', "xxx" ,HLE_KERNEL_SYSCALL }, + {0XDC692EE3, &WrapI_UI, "sceKernelTryLockLwMutex", 'i', "xi" ,HLE_KERNEL_SYSCALL }, + {0X37431849, &WrapI_UI, "sceKernelTryLockLwMutex_600", 'i', "xi" ,HLE_KERNEL_SYSCALL }, + {0XBEA46419, &WrapI_UIU, "sceKernelLockLwMutex", 'i', "xix", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED ,HLE_KERNEL_SYSCALL}, + {0X1FC64E09, &WrapI_UIU, "sceKernelLockLwMutexCB", 'i', "xix", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED ,HLE_KERNEL_SYSCALL}, + {0X15B6446B, &WrapI_UI, "sceKernelUnlockLwMutex", 'i', "xi" ,HLE_KERNEL_SYSCALL }, + {0XC1734599, &WrapI_UU, "sceKernelReferLwMutexStatus", 'i', "xp" ,HLE_KERNEL_SYSCALL }, + {0X293B45B8, &WrapI_V, "sceKernelGetThreadId", 'i', "" ,HLE_KERNEL_SYSCALL }, + {0XD13BDE95, &WrapI_V, "sceKernelCheckThreadStack", 'i', "" ,HLE_KERNEL_SYSCALL }, + {0X1839852A, &WrapU_UUU, "sceKernelMemcpy", 'x', "xxx" ,HLE_KERNEL_SYSCALL }, + {0XFA835CDE, &WrapI_I, "sceKernelGetTlsAddr", 'i', "i" ,HLE_KERNEL_SYSCALL }, + {0X05572A5F, &WrapV_V, "sceKernelExitGame", 'v', "" ,HLE_KERNEL_SYSCALL }, + {0X4AC57943, &WrapI_I, "sceKernelRegisterExitCallback", 'i', "i" ,HLE_KERNEL_SYSCALL }, +}; + +void Register_InterruptManagerForKernel() +{ + RegisterModule("InterruptManagerForKernel", ARRAY_SIZE(InterruptManagerForKernel), InterruptManagerForKernel); +} diff --git a/Core/HLE/sceKernelInterrupt.h b/Core/HLE/sceKernelInterrupt.h index 3f32e3049b..4111ed360d 100644 --- a/Core/HLE/sceKernelInterrupt.h +++ b/Core/HLE/sceKernelInterrupt.h @@ -152,3 +152,4 @@ void Register_Kernel_Library(); void Register_InterruptManager(); void Register_SysclibForKernel(); +void Register_InterruptManagerForKernel(); From eacdfe524652d48a2d1851bcc494fdffd0332730 Mon Sep 17 00:00:00 2001 From: sum2012 Date: Wed, 2 Nov 2022 15:57:26 +0800 Subject: [PATCH 2/2] Fix --- Core/HLE/sceKernelInterrupt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceKernelInterrupt.cpp b/Core/HLE/sceKernelInterrupt.cpp index d541ebcd51..ba66a6625f 100644 --- a/Core/HLE/sceKernelInterrupt.cpp +++ b/Core/HLE/sceKernelInterrupt.cpp @@ -883,8 +883,8 @@ const HLEFunction InterruptManagerForKernel[] = {0XA089ECA4, &WrapU_UUU, "sceKernelMemset", 'x', "xxx" ,HLE_KERNEL_SYSCALL }, {0XDC692EE3, &WrapI_UI, "sceKernelTryLockLwMutex", 'i', "xi" ,HLE_KERNEL_SYSCALL }, {0X37431849, &WrapI_UI, "sceKernelTryLockLwMutex_600", 'i', "xi" ,HLE_KERNEL_SYSCALL }, - {0XBEA46419, &WrapI_UIU, "sceKernelLockLwMutex", 'i', "xix", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED ,HLE_KERNEL_SYSCALL}, - {0X1FC64E09, &WrapI_UIU, "sceKernelLockLwMutexCB", 'i', "xix", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED ,HLE_KERNEL_SYSCALL}, + {0XBEA46419, &WrapI_UIU, "sceKernelLockLwMutex", 'i', "xix", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED | HLE_KERNEL_SYSCALL}, + {0X1FC64E09, &WrapI_UIU, "sceKernelLockLwMutexCB", 'i', "xix", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED | HLE_KERNEL_SYSCALL}, {0X15B6446B, &WrapI_UI, "sceKernelUnlockLwMutex", 'i', "xi" ,HLE_KERNEL_SYSCALL }, {0XC1734599, &WrapI_UU, "sceKernelReferLwMutexStatus", 'i', "xp" ,HLE_KERNEL_SYSCALL }, {0X293B45B8, &WrapI_V, "sceKernelGetThreadId", 'i', "" ,HLE_KERNEL_SYSCALL },