Skip to content

Commit

Permalink
Update SceDebugForKernel functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Princess-of-Sleeping committed Nov 11, 2023
1 parent 43b0602 commit 9322a66
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 30 deletions.
12 changes: 6 additions & 6 deletions check_nid_compat/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ const function_entry SceCpuForKernel[] = {
};

const function_entry SceDebugForKernel[] = {
_x(sceDebugDisableInfoDump),
_x(sceDebugGetPutcharHandler),
_x(sceDebugPutchar),
_x(sceDebugRegisterPutcharHandler),
_x(sceDebugSetHandlers),
_x(sceKernelSetMinimumAssertionLevel),
_x(sceKernelDebugPutchar),
_x(sceKernelEnableCrashDump),
_x(sceKernelGetDebugPutcharHandler),
_x(sceKernelRegisterDebugPutcharHandler),
_x(sceKernelRegisterKprintfHandler),
_x(sceKernelSetAssertLevel),
{
.function_name = NULL,
.function = NULL
Expand Down
12 changes: 6 additions & 6 deletions db/360/SceSysmem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ modules:
kernel: true
nid: 0x88C17370
functions:
ksceDebugDisableInfoDump: 0xF857CDD6
ksceDebugGetPutcharHandler: 0xE783518C
ksceDebugPutchar: 0x82D2EDCE
ksceDebugRegisterPutcharHandler: 0xE6115A72
ksceDebugSetHandlers: 0x10067B7B
ksceKernelSetMinimumAssertionLevel: 0xCE9060F1
ksceKernelDebugPutchar: 0x82D2EDCE
ksceKernelEnableCrashDump: 0xF857CDD6
ksceKernelGetDebugPutcharHandler: 0xE783518C
ksceKernelRegisterDebugPutcharHandler: 0xE6115A72
ksceKernelRegisterKprintfHandler: 0x10067B7B
ksceKernelSetAssertLevel: 0xCE9060F1
SceDebugLed:
kernel: false
nid: 0xAE004C0A
Expand Down
12 changes: 6 additions & 6 deletions db/363/SceSysmem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ modules:
kernel: true
nid: 0x13D793B7
functions:
ksceDebugDisableInfoDump: 0xA465A31A
ksceDebugGetPutcharHandler: 0x8D474850
ksceDebugPutchar: 0x2AABAEDA
ksceDebugRegisterPutcharHandler: 0x22546577
ksceDebugSetHandlers: 0x88AD6D0C
ksceKernelSetMinimumAssertionLevel: 0xA0CE3287
ksceKernelDebugPutchar: 0x2AABAEDA
ksceKernelEnableCrashDump: 0xA465A31A
ksceKernelGetDebugPutcharHandler: 0x8D474850
ksceKernelRegisterDebugPutcharHandler: 0x22546577
ksceKernelRegisterKprintfHandler: 0x88AD6D0C
ksceKernelSetAssertLevel: 0xA0CE3287
SceCpuForKernel:
kernel: true
nid: 0xA5195D20
Expand Down
30 changes: 18 additions & 12 deletions include/psp2kern/kernel/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ typedef enum SceKernelAssertLevel {
} SceKernelAssertLevel;


int ksceDebugPutchar(int character);
int ksceKernelDebugPutchar(int character);

/**
* @brief Print log
Expand Down Expand Up @@ -100,7 +100,7 @@ int ksceKernelPrintfLevelWithInfo(SceUInt32 level, SceUInt32 flags, const SceKer
* @return 0 on success, < 0 on error.
*
* @note - main log is pass to ksceDebugRegisterPutcharHandler's handler.
* dbginfo log is pass to ksceDebugSetHandlers's handler.
* dbginfo log is pass to sceKernelRegisterKprintfHandler's handler.
*/
int ksceKernelPrintfWithInfo(SceUInt32 flags, const SceKernelDebugInfo *dbginfo, const char *fmt, ...);

Expand Down Expand Up @@ -210,20 +210,20 @@ void ksceKernelPrintfAssertLevel(SceUInt32 level, SceBool condition, const SceKe
} while(0)


int ksceDebugSetHandlers(int (* func)(int unk, const char *format, const va_list args), void *args);
int ksceKernelRegisterKprintfHandler(int (* handler)(int unk, const char *format, va_list args), void *argp);

int ksceDebugRegisterPutcharHandler(int (* func)(void *args, char c), void *args);
int ksceKernelRegisterDebugPutcharHandler(int (* handler)(void *argp, char c), void *argp);

void *ksceDebugGetPutcharHandler(void);
void *kksceKernelGetDebugPutcharHandler(void);

/**
* @brief Set kpanic flag
* @brief Set CrashDump enable
*
* @param[in] flag - If pass not zero to flag, kpanic is not stopped and do smc 0x122.
* @param[in] enable - pass SCE_TRUE to do reboot on kernel panic or kernel assert failed.
*
* @return previous flag.
*/
int ksceDebugDisableInfoDump(int flag);
int ksceKernelEnableCrashDump(SceBool enable);

/**
* @brief Get current minimum assertion level
Expand All @@ -233,13 +233,13 @@ int ksceDebugDisableInfoDump(int flag);
int ksceKernelGetAssertLevel(void);

/**
* @brief Get current minimum assertion level
* @brief Get current assert level
*
* @param[in] level - new minimum assertion level
* @param[in] level - new assert level
*
* @return previous minimum assertion level.
* @return previous assert level.
*/
int ksceKernelSetMinimumAssertionLevel(int level);
SceUInt32 ksceKernelSetAssertLevel(SceUInt32 level);

// process
typedef struct SceKernelDebugEventLog1 { // size is 0x1C
Expand Down Expand Up @@ -318,6 +318,12 @@ int ksceKernelGetTtyInfo(char *buf, SceSize buf_size);
#define ksceDebugPrintKernelAssertion ksceKernelAssert
#define ksceDebugPrintfKernelAssertion ksceKernelPrintfAssertLevel
#define ksceKernelGetMinimumAssertionLevel ksceKernelGetAssertLevel
#define ksceDebugPutchar ksceKernelDebugPutchar
#define ksceDebugSetHandlers ksceKernelRegisterKprintfHandler
#define ksceDebugRegisterPutcharHandler ksceKernelRegisterDebugPutcharHandler
#define ksceDebugGetPutcharHandler ksceKernelGetDebugPutcharHandler
#define ksceDebugDisableInfoDump ksceKernelEnableCrashDump
#define ksceKernelSetMinimumAssertionLevel ksceKernelSetAssertLevel


#ifdef __cplusplus
Expand Down

0 comments on commit 9322a66

Please sign in to comment.