Skip to content

Commit

Permalink
Merge pull request #13006 from sum2012/kernel_minor3
Browse files Browse the repository at this point in the history
Wrap some SysMemForKernel and sceKernelUnloadModule
  • Loading branch information
hrydgard committed Jun 7, 2020
2 parents 15fa337 + e8bd231 commit fe1807b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Core/HLE/sceKernelHeap.cpp
Expand Up @@ -87,6 +87,9 @@ const HLEFunction SysMemForKernel[] = {
{ 0X636C953B, &WrapI_II<sceKernelAllocHeapMemory>, "sceKernelAllocHeapMemory", 'x', "ii" },
{ 0XC9805775, &WrapI_I<sceKernelDeleteHeap>, "sceKernelDeleteHeap", 'i', "i" },
{ 0X1C1FBFE7, &WrapI_IIIC<sceKernelCreateHeap>, "sceKernelCreateHeap", 'i', "iixs" },
{ 0X237DBD4F, &WrapI_ICIUU<sceKernelAllocPartitionMemory>, "sceKernelAllocPartitionMemory", 'i', "isixx",HLE_KERNEL_SYSCALL },
{ 0XB6D61D02, &WrapI_I<sceKernelFreePartitionMemory>, "sceKernelFreePartitionMemory", 'i', "i",HLE_KERNEL_SYSCALL },
{ 0X9D9A5BA1, &WrapU_I<sceKernelGetBlockHeadAddr>, "sceKernelGetBlockHeadAddr", 'x', "i",HLE_KERNEL_SYSCALL },
};

void Register_SysMemForKernel() {
Expand Down
6 changes: 3 additions & 3 deletions Core/HLE/sceKernelMemory.cpp
Expand Up @@ -969,7 +969,7 @@ static u32 sceKernelTotalFreeMemSize()
return retVal;
}

static int sceKernelAllocPartitionMemory(int partition, const char *name, int type, u32 size, u32 addr)
int sceKernelAllocPartitionMemory(int partition, const char *name, int type, u32 size, u32 addr)
{
if (name == NULL)
{
Expand Down Expand Up @@ -1019,14 +1019,14 @@ static int sceKernelAllocPartitionMemory(int partition, const char *name, int ty
return uid;
}

static int sceKernelFreePartitionMemory(SceUID id)
int sceKernelFreePartitionMemory(SceUID id)
{
DEBUG_LOG(SCEKERNEL,"sceKernelFreePartitionMemory(%d)",id);

return kernelObjects.Destroy<PartitionMemoryBlock>(id);
}

static u32 sceKernelGetBlockHeadAddr(SceUID id)
u32 sceKernelGetBlockHeadAddr(SceUID id)
{
u32 error;
PartitionMemoryBlock *block = kernelObjects.Get<PartitionMemoryBlock>(id, error);
Expand Down
4 changes: 4 additions & 0 deletions Core/HLE/sceKernelMemory.h
Expand Up @@ -67,3 +67,7 @@ int sceKernelFreeTlspl(SceUID uid);
int sceKernelReferTlsplStatus(SceUID uid, u32 infoPtr);

void Register_SysMemUserForUser();

int sceKernelAllocPartitionMemory(int partition, const char *name, int type, u32 size, u32 addr);
int sceKernelFreePartitionMemory(SceUID id);
u32 sceKernelGetBlockHeadAddr(SceUID id);
1 change: 1 addition & 0 deletions Core/HLE/sceKernelModule.cpp
Expand Up @@ -2546,6 +2546,7 @@ const HLEFunction ModuleMgrForKernel[] =
{0xA1A78C58, &WrapU_CUU<sceKernelLoadModuleForLoadExecVSHDisc>, "sceKernelLoadModuleForLoadExecVSHDisc", 'x', "sxx", HLE_KERNEL_SYSCALL }, //fix for tiger x dragon
{0x748CBED9, &WrapU_UU<sceKernelQueryModuleInfo>, "sceKernelQueryModuleInfo", 'x', "xx", HLE_KERNEL_SYSCALL },
{0x644395E2, &WrapU_UUU<sceKernelGetModuleIdList>, "sceKernelGetModuleIdList", 'x', "xxx", HLE_KERNEL_SYSCALL },
{0X2E0911AA, &WrapU_U<sceKernelUnloadModule>, "sceKernelUnloadModule", 'x', "x" , HLE_KERNEL_SYSCALL },
};

void Register_ModuleMgrForUser()
Expand Down

0 comments on commit fe1807b

Please sign in to comment.