vitasdk
Documentation of the vitasdk

Detailed Description

Exports for Kernel.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceDebugForDriver_stub



Functions

int ksceDebugPutchar (int character)
 
int ksceDebugPrintf (const char *fmt,...)
 Print log. More...
 
int ksceDebugPrintf2 (int flags, const SceKernelDebugMessageContext *ctx, const char *fmt,...)
 Print log with ctx. More...
 
 __attribute__ ((__noreturn__)) void ksceDebugPrintKernelPanic(const SceKernelDebugMessageContext *ctx
 
const void const char int ksceDebugPrintKernelAssertion (int condition, const SceKernelDebugMessageContext *ctx, const void *lr)
 Assertion with ctx. More...
 
int ksceDebugPrintfKernelAssertion (int level, int condition, const SceKernelDebugMessageContext *ctx, const void *lr, const char *fmt,...)
 Assertion with ctx and Print. More...
 
int ksceDebugSetHandlers (int(*func)(int unk, const char *format, const va_list args), void *args)
 
int ksceDebugRegisterPutcharHandler (int(*func)(void *args, char c), void *args)
 
void * ksceDebugGetPutcharHandler (void)
 
int ksceDebugDisableInfoDump (int flag)
 Set kpanic flag. More...
 
int ksceKernelGetMinimumAssertionLevel (void)
 Get current minimum assertion level. More...
 
int ksceKernelSetMinimumAssertionLevel (int level)
 Get current minimum assertion level. More...
 
struct SceKernelDebugEventLog1 __attribute__ ((packed)) SceKernelDebugEventLog1
 
int ksceEventLogGetInfo (void *buf, SceSize buf_size, SceSize *read_blocks)
 Get event log info. More...
 
int ksceKernelGetTtyInfo (char *buf, SceSize buf_size)
 Get tty log info. More...
 

Data Structure Documentation

◆ SceKernelDebugMessageContext

struct SceKernelDebugMessageContext
Data Fields
SceUInt32 hex_value0_hi
SceUInt32 hex_value0_lo
SceUInt32 hex_value1
const char * func
SceSize line
const char * file

◆ SceKernelDebugEventLog1

struct SceKernelDebugEventLog1
Data Fields
int data_0x40
SceUID pid
int budget_type
int data_0x4C 0xA
char titleid[0xC]

◆ SceKernelDebugEventLog2

struct SceKernelDebugEventLog2
Data Fields
int data_0x40 0 or 0x80412118?

◆ SceKernelDebugEventLog3

struct SceKernelDebugEventLog3
Data Fields
int data_0x40 0?
char ip1[0x10]
char ip2[0x10]
char ip3[0x10]
char ip4[0x10]
char ip5[0x10]

◆ SceKernelDebugEventLog

struct SceKernelDebugEventLog
Data Fields
SceSize size struct size(variable size)
int data_0x04 0xA, maybe titleid size
char titleid[0xC] Title id of the process where the event occurred.
int flags Event flags.
SceUID ppid Parent process id.
SceUID data_0x1C Thread id?
int rsvd[4]
SceUInt64 time Time of the event occurred.
int data_0x38
SceSize item_size Event data size.
union SceKernelDebugEventLog __attribute__

◆ SceKernelDebugEventLog.__attribute__

union SceKernelDebugEventLog.__attribute__

Enumeration Type Documentation

◆ SceKernelDebugPrintFlags

Enumerator
SCE_DBG_PRINT_FLAG_NONE 
SCE_DBG_PRINT_FLAG_CORE 
SCE_DBG_PRINT_FLAG_FUNC 
SCE_DBG_PRINT_FLAG_LINE 
SCE_DBG_PRINT_FLAG_FILE 

◆ SceDbgLogLevel

Enumerator
SCE_DBG_LOG_LEVEL_TRACE 
SCE_DBG_LOG_LEVEL_DEBUG 
SCE_DBG_LOG_LEVEL_INFO 
SCE_DBG_LOG_LEVEL_WARNING 
SCE_DBG_LOG_LEVEL_ERROR 
SCE_DBG_NUM_LOG_LEVELS 
SCE_DBG_LOG_LEVEL_TRACE 
SCE_DBG_LOG_LEVEL_DEBUG 
SCE_DBG_LOG_LEVEL_INFO 
SCE_DBG_LOG_LEVEL_WARNING 
SCE_DBG_LOG_LEVEL_ERROR 
SCE_DBG_NUM_LOG_LEVELS 

Function Documentation

◆ ksceDebugPutchar()

int ksceDebugPutchar ( int  character)

◆ ksceDebugPrintf()

int ksceDebugPrintf ( const char *  fmt,
  ... 
)

Print log.

Parameters
[in]fmt- print fmt
Returns
0 on success, < 0 on error.
Note
- log is pass to ksceDebugRegisterPutcharHandler's handler.

◆ ksceDebugPrintf2()

int ksceDebugPrintf2 ( int  flags,
const SceKernelDebugMessageContext ctx,
const char *  fmt,
  ... 
)

Print log with ctx.

Parameters
[in]flags- ctx print flags, see:SceKernelDebugPrintFlags
[in]ctx- debug msg ctx
[in]fmt- print fmt
Returns
0 on success, < 0 on error.
Note
- main log is pass to ksceDebugRegisterPutcharHandler's handler. ctx log is pass to ksceDebugSetHandlers's handler.

◆ __attribute__() [1/2]

__attribute__ ( (__noreturn__)  ) const

◆ ksceDebugPrintKernelAssertion()

const void const char int ksceDebugPrintKernelAssertion ( int  condition,
const SceKernelDebugMessageContext ctx,
const void *  lr 
)

Assertion with ctx.

Parameters
[in]condition- condition
[in]ctx- debug msg ctx
[in]lr- The link register
Returns
0 on success, < 0 on error.

◆ ksceDebugPrintfKernelAssertion()

int ksceDebugPrintfKernelAssertion ( int  level,
int  condition,
const SceKernelDebugMessageContext ctx,
const void *  lr,
const char *  fmt,
  ... 
)

Assertion with ctx and Print.

Parameters
[in]level- print level, see:SceDbgLogLevel
[in]condition- condition
[in]ctx- debug msg ctx
[in]lr- The link register
[in]fmt- print fmt
Returns
0 on success, < 0 on error.

◆ ksceDebugSetHandlers()

int ksceDebugSetHandlers ( int(*)(int unk, const char *format, const va_list args)  func,
void *  args 
)

◆ ksceDebugRegisterPutcharHandler()

int ksceDebugRegisterPutcharHandler ( int(*)(void *args, char c)  func,
void *  args 
)

◆ ksceDebugGetPutcharHandler()

void* ksceDebugGetPutcharHandler ( void  )

◆ ksceDebugDisableInfoDump()

int ksceDebugDisableInfoDump ( int  flag)

Set kpanic flag.

Parameters
[in]flag- If pass not zero to flag, kpanic is not stopped and do smc 0x122.
Returns
previous flag.

◆ ksceKernelGetMinimumAssertionLevel()

int ksceKernelGetMinimumAssertionLevel ( void  )

Get current minimum assertion level.

Returns
current minimum assertion level.

◆ ksceKernelSetMinimumAssertionLevel()

int ksceKernelSetMinimumAssertionLevel ( int  level)

Get current minimum assertion level.

Parameters
[in]level- new minimum assertion level
Returns
previous minimum assertion level.

◆ __attribute__() [2/2]

struct SceKernelDebugEventLog1 __attribute__ ( (packed)  )

◆ ksceEventLogGetInfo()

int ksceEventLogGetInfo ( void *  buf,
SceSize  buf_size,
SceSize read_blocks 
)

Get event log info.

Parameters
[out]buf- The SceKernelDebugEventLog buffer list
[in]buf_size- The buf size
[out]read_blocks- The read event log number
Returns
< 0 on error.

◆ ksceKernelGetTtyInfo()

int ksceKernelGetTtyInfo ( char *  buf,
SceSize  buf_size 
)

Get tty log info.

Parameters
[out]buf- The tty log buffer
[in]buf_size- The buf size
Returns
log length on success, < 0 on error.