src/modulemgr: Fixed more errors.

This commit is contained in:
Felix-Dev 2016-10-21 09:18:52 +02:00
parent ffab36c001
commit b40b31e3a6
8 changed files with 1944 additions and 1820 deletions

View File

@ -41,9 +41,65 @@ static inline void dbg_puts()
#endif
/* Fills the framebuffer with the (r, g, b) color */
static inline void dbg_fbfill(u8 r, u8 g, u8 b) {
//static inline void dbg_fbfill(u8 r, u8 g, u8 b) {
// u32 i;
// for (i = 0; i < 480 * 272 * 2; i++)
// *(int*)(0x44000000 + i * 4) = r | (g << 8) | (b << 16);
//}
/* Fills the framebuffer with the (r, g, b) color */
static inline void dbg_fbfillCount(u32 count, u8 r, u8 g, u8 b) {
u32 i;
for (i = 0; i < 480 * 272 * 2; i++)
for (i = 0 + count * 20; i < 0 + count * 20 + 20; i++)
*(int*)(0x44000000 + i * 4) = r | (g << 8) | (b << 16);
for (i = 480 + count * 20; i < 480 + count * 20 + 20; i++)
*(int*)(0x44000000 + i * 4) = r | (g << 8) | (b << 16);
}
/* Fills the framebuffer with the (r, g, b) color */
static inline void dbg_fbfill(u8 r, u8 g, u8 b) {
u32 i;
for (i = 0; i < 20; i++)
*(int*)(0x44000000 + i * 4) = r | (g << 8) | (b << 16);
for (i = 480; i < 480 + 20; i++)
*(int*)(0x44000000 + i * 4) = r | (g << 8) | (b << 16);
}
static inline void dbg_fbfill2(u8 r, u8 g, u8 b) {
u32 i;
for (i = 20; i < 40 * 1; i++)
*(int*)(0x44000000 + i * 4) = r | (g << 8) | (b << 16);
for (i = 480 + 20; i < 480 + 20 + 20; i++)
*(int*)(0x44000000 + i * 4) = r | (g << 8) | (b << 16);
}
static inline void dbg_fbfill3(u8 r, u8 g, u8 b) {
u32 i;
for (i = 40; i < 60 * 1; i++)
*(int*)(0x44000000 + i * 4) = r | (g << 8) | (b << 16);
for (i = 480 + 40; i < 480 + 40 + 20; i++)
*(int*)(0x44000000 + i * 4) = r | (g << 8) | (b << 16);
}
static inline void dbg_fbfill4(u8 r, u8 g, u8 b) {
u32 i;
for (i = 60; i < 80 * 1; i++)
*(int*)(0x44000000 + i * 4) = r | (g << 8) | (b << 16);
for (i = 480 + 60; i < 480 + 60 + 20; i++)
*(int*)(0x44000000 + i * 4) = r | (g << 8) | (b << 16);
}
static inline void dbg_fbfill5(u8 r, u8 g, u8 b) {
u32 i;
for (i = 80; i < 100 * 1; i++)
*(int*)(0x44000000 + i * 4) = r | (g << 8) | (b << 16);
for (i = 480 + 80; i < 480 + 80 + 20; i++)
*(int*)(0x44000000 + i * 4) = r | (g << 8) | (b << 16);
}

View File

@ -682,8 +682,7 @@ enum ModuleMgrMcbStatus {
MCB_STATUS_STARTING = 4,
MCB_STATUS_STARTED = 5,
MCB_STATUS_STOPPING = 6,
MCB_STATUS_STOPPED = 7,
MCB_STATUS_UNLOADED = 8
MCB_STATUS_STOPPED = 7
};
/** The SceModule structure represents a loaded module in memory. */

View File

@ -2,7 +2,9 @@
# See the file COPYING for copying permission.
TARGET = modulemgr
OBJS = dbg.o chunk.o init.o loadModule.o modulemgr.o override.o queryModule.o rebootModule.o start-stopModule.o
OBJS = chunk.o init.o loadModule.o modulemgr.o override.o queryModule.o rebootModule.o start-stopModule.o
DEBUG = 0
LIBS = -lSysMemForKernel -lKDebugForKernel -lInterruptManagerForKernel -lUtilsForKernel \
-lSysclibForKernel -lThreadManForKernel -lIoFileMgrForKernel -lLoadCoreForKernel

View File

@ -150,7 +150,7 @@ char *sceKernelInitFileName(void)
u32 sceKernelSetInitCallback(SceKernelBootCallbackFunction bootCBFunc, u32 flag, s32 *pStatus)
{
s32 result;
SceBootCallback *curBootCallback;
SceBootCallback *pCurBootCallback;
if (flag < 4) { //0x00004F64
if (g_init.bootCallbacks1 == NULL) { //0x00004F78
@ -159,8 +159,8 @@ u32 sceKernelSetInitCallback(SceKernelBootCallbackFunction bootCBFunc, u32 flag,
*pStatus = result;
return SCE_ERROR_OK;
}
curBootCallback = g_init.curBootCallback1; //0x00004F80
curBootCallback->bootCBFunc = (flag & 0x3) + bootCBFunc; //0x00004F90
pCurBootCallback = g_init.curBootCallback1; //0x00004F80
pCurBootCallback->bootCBFunc = (flag & 0x3) + bootCBFunc; //0x00004F90
g_init.curBootCallback1 += 1; //0x00004FA0
g_init.curBootCallback1->bootCBFunc = NULL; //0x00004FA8
} else {
@ -170,12 +170,12 @@ u32 sceKernelSetInitCallback(SceKernelBootCallbackFunction bootCBFunc, u32 flag,
*pStatus = result;
return SCE_ERROR_OK;
}
curBootCallback = g_init.curBootCallback2; //0x00004FF4
curBootCallback->bootCBFunc = (flag & 0x3) + bootCBFunc; //0x00005004
pCurBootCallback = g_init.curBootCallback2; //0x00004FF4
pCurBootCallback->bootCBFunc = (flag & 0x3) + bootCBFunc; //0x00005004
g_init.curBootCallback2 += 1; //0x00005010
g_init.curBootCallback2->bootCBFunc = NULL; //0x00004FA8
}
curBootCallback->gp = sceKernelGetModuleGPByAddressForKernel((u32)bootCBFunc); //0x00004F8C & 0x00004FA4
pCurBootCallback->gp = sceKernelGetModuleGPByAddressForKernel((u32)bootCBFunc); //0x00004F8C & 0x00004FA4
return SCE_BOOT_CALLBACK_FUNCTION_QUEUED;
}

View File

@ -2588,6 +2588,7 @@ SceUID sceKernelLoadModuleBufferBootInitBtcnf(SceSize size, void *base, s32 flag
}
_setupForLoadModuleBuffer(&modParams, SCE_EXEC_FILE_APITYPE_MODULE_BUFFER_BOOT_INIT_BTCNF, base, size, 1); // 0x0000595C
status = _loadModuleByBufferID(&modParams, pOption); // 0x00005968
pspSetK1(oldK1);

File diff suppressed because it is too large Load Diff

View File

@ -78,6 +78,9 @@ enum ModuleMgrExecModes {
extern SceModuleManagerCB g_ModuleManager;
// DEBUG
//extern int c;
s32 ClearFreePartitionMemory(s32 partitionId);
s32 _CheckUserModulePartition(SceUID memoryPartitionId);
s32 _start_exe_thread(SceModuleMgrParam *pModParams);

View File

@ -6,6 +6,8 @@
#include <modulemgr_kernel.h>
#include <modulemgr_options.h>
#include <iofilemgr_kernel.h>
#include "loadModuleChecks_inline.h"
#include "modulemgr_int.h"
@ -22,8 +24,6 @@ s32 sceKernelStartModule(SceUID modId, SceSize args, const void *argp, s32 *pMod
s32 status;
SceModuleMgrParam modParams;
dbg_fbfill(1, 255, 1);
oldK1 = pspShiftK1();
if (sceKernelIsIntrContext()) { //0x00003DA4
@ -68,10 +68,8 @@ s32 sceKernelStartModule(SceUID modId, SceSize args, const void *argp, s32 *pMod
modParams.threadPriority = SCE_KERNEL_INVALID_PRIORITY;
modParams.threadAttr = SCE_KERNEL_TH_DEFAULT_ATTR;
}
status = _start_exe_thread(&modParams); //0x00003F04
//UOFW: It doesn't return to here....
//dbg_fbfill(1, 1, 255);
status = _start_exe_thread(&modParams); //0x00003F04
pspSetK1(oldK1);
return status;