psl1ght
A free SDK for Sony's PS3 console
Data Structures | Macros | Typedefs | Enumerations | Functions
dbg.h File Reference

Debugging management library. More...

#include <ppu-types.h>
#include <sys/thread.h>
#include <sys/event_queue.h>

Go to the source code of this file.

Data Structures

union  sys_dbg_vr_t
 contents of a PPU VR register More...
 
union  sys_dbg_spu_gpr_t
 contents of a SPU GPR register More...
 
struct  _sys_dbg_ppu_thread_context
 PPU thread context. More...
 
struct  _sys_dbg_spu_thread_context
 SPU thread context. More...
 

Macros

#define SYS_DBG_PPU_NUM_GPR   32
 number of PPU GPR registers
 
#define SYS_DBG_PPU_NUM_FPR   32
 number of PPU FPR registers
 
#define SYS_DBG_PPU_NUM_VR   32
 number of PPU VR registers
 
#define SYS_DBG_PPU_VR_WIDTH   16
 size (in bytes) of a PPU VR register
 
#define SYS_DBG_SPU_NUM_GPR   128
 number of SPU GPR registers
 
#define SYS_DBG_SPU_NUM_MFC_CQ_SR   96
 number of SPU MFC/CQ/SR registers
 
#define SYS_DBG_SPU_GPR_WIDTH   16
 size (in bytes) of a SPU GPR register
 
#define SYS_DBG_SPU_NUM_MB   4
 number of SPU inbound MB entries
 

Typedefs

typedef struct _sys_dbg_ppu_thread_context sys_dbg_ppu_thread_context_t
 PPU thread context.
 
typedef struct _sys_dbg_spu_thread_context sys_dbg_spu_thread_context_t
 SPU thread context.
 
typedef void(* dbg_exception_handler_t) (u64 cause, sys_ppu_thread_t tid, u64 dar)
 Function pointer to a PPU exception handler.
 

Enumerations

enum  sys_dbg_ppu_thread_status_t {
  PPU_THREAD_STATUS_IDLE, PPU_THREAD_STATUS_RUNNABLE, PPU_THREAD_STATUS_ONPROC, PPU_THREAD_STATUS_SLEEP,
  PPU_THREAD_STATUS_STOP, PPU_THREAD_STATUS_ZOMBIE, PPU_THREAD_STATUS_DELETED, PPU_THREAD_STATUS_UNKNOWN
}
 Possible statuses for PPU threads.
 
enum  sys_dbg_spu_thread_group_status_t {
  SPU_THREAD_GROUP_STATUS_NOTINITIALIZED, SPU_THREAD_GROUP_STATUS_INITIALIZED, SPU_THREAD_GROUP_STATUS_READY, SPU_THREAD_GROUP_STATUS_WAITING,
  SPU_THREAD_GROUP_STATUS_SUSPENDED, SPU_THREAD_GROUP_STATUS_WAITING_AND_SUSPENDED, SPU_THREAD_GROUP_STATUS_RUNNING, SPU_THREAD_GROUP_STATUS_STOPPED,
  SPU_THREAD_GROUP_STATUS_UNKNOWN
}
 Possible statuses for PPU thread groups.
 

Functions

s32 sysDbgSetStacksizePPUExceptionHandler (size_t stacksize)
 Set stack size of PPU thread exception handler. More...
 
s32 sysDbgGetSPUThreadGroupIds (u32 *group_ids, u64 *num_ids, u64 *num_all_ids)
 Get the list of SPU thread group ids. More...
 
s32 sysDbgGetPPUThreadIds (sys_ppu_thread_t *ids, u64 *num_ids, u64 *num_all_ids)
 Get the list of PPU thread ids. More...
 
s32 sysDbgGetSPUThreadIds (u32 group_id, u32 *thread_ids, u64 *num_ids, u64 *num_all_ids)
 Get the list of SPU thread ids in a SPU thread group. More...
 
s32 sysDbgRegisterPPUExceptionHandler (dbg_exception_handler_t handler, u64 flags)
 Register a PPU exception handler. More...
 
s32 sysDbgGetPPUThreadName (sys_ppu_thread_t id, char *name)
 Get PPU thread name. More...
 
s32 sysDbgGetSPUThreadName (u32 thread_id, char *name)
 Get SPU thread name. More...
 
s32 sysDbgGetPPUThreadStatus (sys_ppu_thread_t id, sys_dbg_ppu_thread_status_t *status)
 Get PPU thread status. More...
 
s32 sysDbgGetGetSPUThreadGroupStatus (u32 group_id, sys_dbg_spu_thread_group_status_t *status)
 Get SPU thread group status. More...
 
s32 sysDbgGetSPUThreadGroupName (u32 group_id, char *name)
 Get SPU thread group name. More...
 
s32 sysDbgFinalizePPUExceptionHandler ()
 
s32 sysDbgReadSPUThreadContext (u32 thread_id, sys_dbg_spu_thread_context_t *context)
 Read a SPU thread context. More...
 
s32 sysDbgInitializePPUExceptionHandler (s32 prio)
 Initialization of the PPU thread exception handler. More...
 
s32 sysDbgReadPPUThreadContext (sys_ppu_thread_t id, sys_dbg_ppu_thread_context_t *context)
 Read a PPU thread context. More...
 
s32 sysDbgUnregisterPPUExceptionHandler ()
 Unregister the PPU thread exception handler. More...
 

Detailed Description

Debugging management library.

Function Documentation

◆ sysDbgFinalizePPUExceptionHandler()

s32 sysDbgFinalizePPUExceptionHandler ( )

Finalize the PPU exception handler.

Returns
zero if no error occured, nonzero otherwise.

◆ sysDbgGetGetSPUThreadGroupStatus()

s32 sysDbgGetGetSPUThreadGroupStatus ( u32  group_id,
sys_dbg_spu_thread_group_status_t status 
)

Get SPU thread group status.

Parameters
group_idSPU thread group id.
statusPointer to storage for the SPU thread group status.
Returns
zero if no error occured, nonzero otherwise.

◆ sysDbgGetPPUThreadIds()

s32 sysDbgGetPPUThreadIds ( sys_ppu_thread_t *  ids,
u64 *  num_ids,
u64 *  num_all_ids 
)

Get the list of PPU thread ids.

Parameters
idsPointer to storage for the PPU thread ids.
[in]num_idsPointer to the number of available elements in ids array.
[out]num_idsNumber of PPU thread ids stored into the array.
num_all_idsPointer to storage for the total number of PPU threads.
Returns
zero if no error occured, nonzero otherwise.

◆ sysDbgGetPPUThreadName()

s32 sysDbgGetPPUThreadName ( sys_ppu_thread_t  id,
char *  name 
)

Get PPU thread name.

Parameters
idPPU thread id.
namePointer to storage for the PPU thread name.
Returns
zero if no error occured, nonzero otherwise.

◆ sysDbgGetPPUThreadStatus()

s32 sysDbgGetPPUThreadStatus ( sys_ppu_thread_t  id,
sys_dbg_ppu_thread_status_t status 
)

Get PPU thread status.

Parameters
idPPU thread id.
statusPointer to storage for the PPU thread status.
Returns
zero if no error occured, nonzero otherwise.

◆ sysDbgGetSPUThreadGroupIds()

s32 sysDbgGetSPUThreadGroupIds ( u32 *  group_ids,
u64 *  num_ids,
u64 *  num_all_ids 
)

Get the list of SPU thread group ids.

Parameters
group_idsPointer to storage for the SPU thread group ids.
[in]num_idsPointer to the number of available elements in group_ids array.
[out]num_idsNumber of SPU thread group ids stored into the array.
num_all_idsPointer to storage for the total number of SPU thread groups.
Returns
zero if no error occured, nonzero otherwise.

◆ sysDbgGetSPUThreadGroupName()

s32 sysDbgGetSPUThreadGroupName ( u32  group_id,
char *  name 
)

Get SPU thread group name.

Parameters
group_idSPU thread group id.
namePointer to storage for the SPU thread group name.
Returns
zero if no error occured, nonzero otherwise.

◆ sysDbgGetSPUThreadIds()

s32 sysDbgGetSPUThreadIds ( u32  group_id,
u32 *  thread_ids,
u64 *  num_ids,
u64 *  num_all_ids 
)

Get the list of SPU thread ids in a SPU thread group.

Parameters
group_idSPU thread group id.
thread_idsPointer to storage for the SPU thread ids.
[in]num_idsPointer to the number of available elements in thread_ids array.
[out]num_idsNumber of SPU thread ids stored into the array.
num_all_idsPointer to storage for the total number of SPU threads in the group.
Returns
zero if no error occured, nonzero otherwise.

◆ sysDbgGetSPUThreadName()

s32 sysDbgGetSPUThreadName ( u32  thread_id,
char *  name 
)

Get SPU thread name.

Parameters
thread_idSPU thread id.
namePointer to storage for the SPU thread name.
Returns
zero if no error occured, nonzero otherwise.

◆ sysDbgInitializePPUExceptionHandler()

s32 sysDbgInitializePPUExceptionHandler ( s32  prio)

Initialization of the PPU thread exception handler.

Parameters
prioPriority of the PPU thread exception handler.
Returns
zero if no error occured, nonzero otherwise.

◆ sysDbgReadPPUThreadContext()

s32 sysDbgReadPPUThreadContext ( sys_ppu_thread_t  id,
sys_dbg_ppu_thread_context_t context 
)

Read a PPU thread context.

Parameters
idPPU thread id.
contextPointer to storage for PPU thread context.
Returns
zero if no error occured, nonzero otherwise.

◆ sysDbgReadSPUThreadContext()

s32 sysDbgReadSPUThreadContext ( u32  thread_id,
sys_dbg_spu_thread_context_t context 
)

Read a SPU thread context.

Parameters
thread_idSPU thread id.
contextPointer to storage for SPU thread context.
Returns
zero if no error occured, nonzero otherwise.

◆ sysDbgRegisterPPUExceptionHandler()

s32 sysDbgRegisterPPUExceptionHandler ( dbg_exception_handler_t  handler,
u64  flags 
)

Register a PPU exception handler.

Parameters
handlerPointer to the exception handler function.
flagsFlags.
Returns
zero if no error occured, nonzero otherwise.

◆ sysDbgSetStacksizePPUExceptionHandler()

s32 sysDbgSetStacksizePPUExceptionHandler ( size_t  stacksize)

Set stack size of PPU thread exception handler.

Parameters
stacksizeNew stack size.
Returns
zero if no error occured, nonzero otherwise.

◆ sysDbgUnregisterPPUExceptionHandler()

s32 sysDbgUnregisterPPUExceptionHandler ( )

Unregister the PPU thread exception handler.

Returns
zero if no error occured, nonzero otherwise.