Add ThreadManForKernel and ModuleForKernel

Sample log:https://gist.github.com/sum2012/3bb5deb1a806ef18f5f3
This commit is contained in:
sum2012 2013-08-25 10:48:32 +08:00
parent 99c1ab38d7
commit d017011882
5 changed files with 56 additions and 2 deletions

View File

@ -256,12 +256,14 @@ static const int numModules = sizeof(moduleList)/sizeof(HLEModule);
void RegisterAllModules() {
Register_Kernel_Library();
Register_ThreadManForUser();
Register_ThreadManForKernel();
Register_LoadExecForUser();
Register_UtilsForKernel();
Register_SysMemUserForUser();
Register_InterruptManager();
Register_IoFileMgrForUser();
Register_ModuleMgrForUser();
Register_ModuleMgrForKernel();
Register_StdioForUser();
Register_sceHprm();

View File

@ -636,6 +636,18 @@ int sceKernelReferGlobalProfiler(u32 statusPtr) {
return 0;
}
int ThreadManForKernel_446d8de6(const char *threadName, u32 entry, u32 prio, int stacksize, u32 attr, u32 optionAddr)
{
WARN_LOG(HLE,"Not support this patcher");
return sceKernelCreateThread(threadName, entry, prio, stacksize, attr, optionAddr);
}
int ThreadManForKernel_f475845d(SceUID threadToStartID, int argSize, u32 argBlockPtr)
{
WARN_LOG(HLE,"Not support this patcher");
return sceKernelStartThread(threadToStartID,argSize,argBlockPtr);
}
const HLEFunction ThreadManForUser[] =
{
{0x55C20A00,&WrapI_CUUU<sceKernelCreateEventFlag>, "sceKernelCreateEventFlag"},
@ -820,6 +832,13 @@ const HLEFunction ThreadManForUser[] =
// {0x6E9EA350, _sceKernelReturnFromCallback,"_sceKernelReturnFromCallback"},
};
const HLEFunction ThreadManForKernel[] =
{
{0xceadeb47, 0, "ThreadManForKernel_ceadeb47"},
{0x446d8de6, WrapI_CUUIUU<ThreadManForKernel_446d8de6>, "ThreadManForKernel_446d8de6"},//Not sure right
{0xf475845d, &WrapI_IIU<ThreadManForKernel_f475845d>, "ThreadManForKernel_f475845d"},//Not sure right
};
void Register_ThreadManForUser()
{
RegisterModule("ThreadManForUser", ARRAY_SIZE(ThreadManForUser), ThreadManForUser);
@ -841,8 +860,6 @@ void Register_LoadExecForUser()
RegisterModule("LoadExecForUser", ARRAY_SIZE(LoadExecForUser), LoadExecForUser);
}
const HLEFunction ExceptionManagerForKernel[] =
{
{0x3FB264FC, 0, "sceKernelRegisterExceptionHandler"},
@ -888,3 +905,9 @@ void Register_UtilsForKernel()
{
RegisterModule("UtilsForKernel", ARRAY_SIZE(UtilsForKernel), UtilsForKernel);
}
void Register_ThreadManForKernel()
{
RegisterModule("ThreadManForKernel", ARRAY_SIZE(ThreadManForKernel), ThreadManForKernel);
}

View File

@ -557,5 +557,6 @@ extern KernelStats kernelStats;
extern u32 registeredExitCbId;
void Register_ThreadManForUser();
void Register_ThreadManForKernel();
void Register_LoadExecForUser();
void Register_UtilsForKernel();

View File

@ -1496,6 +1496,18 @@ u32 sceKernelQueryModuleInfo(u32 uid, u32 infoAddr)
return 0;
}
u32 ModuleMgrForKernel_977de386(const char *name, u32 flags, u32 optionAddr)
{
WARN_LOG(HLE,"Not support this patcher");
return sceKernelLoadModule(name, flags, optionAddr);
}
void ModuleMgrForKernel_50f0c1ec(u32 moduleId, u32 argsize, u32 argAddr, u32 returnValueAddr, u32 optionAddr)
{
WARN_LOG(HLE,"Not support this patcher");
sceKernelStartModule(moduleId, argsize, argAddr, returnValueAddr, optionAddr);
}
const HLEFunction ModuleMgrForUser[] =
{
{0x977DE386,&WrapU_CUU<sceKernelLoadModule>,"sceKernelLoadModule"},
@ -1519,7 +1531,22 @@ const HLEFunction ModuleMgrForUser[] =
};
const HLEFunction ModuleMgrForKernel[] =
{
{0x50f0c1ec,&WrapV_UUUUU<ModuleMgrForKernel_50f0c1ec>, "ModuleMgrForKernel_50f0c1ec"},//Not sure right
{0x977de386, &WrapU_CUU<ModuleMgrForKernel_977de386>, "ModuleMgrForKernel_977de386"},//Not sure right
{0xa1a78c58, 0, "ModuleMgrForKernel_a1a78c58"},
};
void Register_ModuleMgrForUser()
{
RegisterModule("ModuleMgrForUser", ARRAY_SIZE(ModuleMgrForUser), ModuleMgrForUser);
}
void Register_ModuleMgrForKernel()
{
RegisterModule("ModuleMgrForKernel", ARRAY_SIZE(ModuleMgrForKernel), ModuleMgrForKernel);
};

View File

@ -29,3 +29,4 @@ bool __KernelLoadExec(const char *filename, u32 paramPtr, std::string *error_str
void __KernelReturnFromModuleFunc();
void Register_ModuleMgrForUser();
void Register_ModuleMgrForKernel();