PS2SDK
PS2 Homebrew Libraries
sifcmd-common.h File Reference
#include <tamtypes.h>
+ Include dependency graph for sifcmd-common.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  t_SifCmdHeader
 
struct  t_SifCmdSRegData
 
struct  t_SifCmdHandlerData
 
struct  t_SifCmdSysHandlerData
 
struct  _iop_reset_pkt
 

Macros

#define SIF_CMD_ID_SYSTEM   0x80000000
 
#define SIF_CMD_CHANGE_SADDR   (SIF_CMD_ID_SYSTEM | 0)
 
#define SIF_CMD_SET_SREG   (SIF_CMD_ID_SYSTEM | 1)
 
#define SIF_CMD_INIT_CMD   (SIF_CMD_ID_SYSTEM | 2)
 
#define SIF_CMD_RESET_CMD   (SIF_CMD_ID_SYSTEM | 3)
 
#define SIF_CMD_RPC_END   (SIF_CMD_ID_SYSTEM | 8)
 
#define SIF_CMD_RPC_BIND   (SIF_CMD_ID_SYSTEM | 9)
 
#define SIF_CMD_RPC_CALL   (SIF_CMD_ID_SYSTEM | 10)
 
#define SIF_CMD_RPC_RDATA   (SIF_CMD_ID_SYSTEM | 12)
 
#define SIF_SREG_RPCINIT   0
 
#define RESET_ARG_MAX   79
 
#define SifInitCmd(...)   sceSifInitCmd(__VA_ARGS__)
 
#define SifExitCmd(...)   sceSifExitCmd(__VA_ARGS__)
 
#define SifGetSreg(...)   sceSifGetSreg(__VA_ARGS__)
 
#define SifSetCmdBuffer(...)   sceSifSetCmdBuffer(__VA_ARGS__)
 
#define SifAddCmdHandler(...)   sceSifAddCmdHandler(__VA_ARGS__)
 
#define SifRemoveCmdHandler(...)   sceSifRemoveCmdHandler(__VA_ARGS__)
 
#define SifSendCmd(...)   sceSifSendCmd(__VA_ARGS__)
 
#define iSifSendCmd(...)   isceSifSendCmd(__VA_ARGS__)
 
#define SifWriteBackDCache(...)   sceSifWriteBackDCache(__VA_ARGS__)
 
#define SIF_CMD_M_INTR   0x01
 
#define SIF_CMD_M_WBDC   0x04
 

Typedefs

typedef struct t_SifCmdHeader SifCmdHeader_t
 
typedef struct t_SifCmdSRegData SifCmdSRegData_t
 
typedef void(* SifCmdHandler_t) (void *data, void *harg)
 
typedef struct t_SifCmdHandlerData SifCmdHandlerData_t
 
typedef struct t_SifCmdSysHandlerData SifCmdSysHandlerData_t
 
typedef struct _iop_reset_pkt SifCmdResetData_t
 

Functions

void sceSifInitCmd (void)
 
void sceSifExitCmd (void)
 
unsigned int sceSifGetSreg (int sreg)
 
void sceSifSetSreg (int sreg, unsigned int value)
 
void sceSifSetCmdBuffer (SifCmdHandlerData_t *db, int size)
 
void sceSifSetSysCmdBuffer (SifCmdSysHandlerData_t *db, int size)
 
void sceSifAddCmdHandler (int cid, SifCmdHandler_t handler, void *harg)
 
void sceSifRemoveCmdHandler (int cid)
 
unsigned int sceSifSendCmd (int cid, void *packet, int packet_size, void *src_extra, void *dest_extra, int size_extra)
 
unsigned int isceSifSendCmd (int cid, void *packet, int packet_size, void *src_extra, void *dest_extra, int size_extra)
 

Detailed Description

Common definitions for SIF CMD.

Definition in file sifcmd-common.h.


Data Structure Documentation

◆ t_SifCmdHeader

struct t_SifCmdHeader

SIF command.

Definition at line 22 of file sifcmd-common.h.

Data Fields
u32 psize: 8

Packet size. Min: 1x16 (header only), max: 7*16

u32 dsize: 24

Payload size

void * dest

Destination address for payload. Can be NULL if there is no payload.

int cid

Function number of function to call.

u32 opt

Can be freely used.

◆ t_SifCmdSRegData

struct t_SifCmdSRegData

Structure for remotely (over the SIF) changing the value of a software register (SREG). There are 32 software registers (0 - 31). Registers 0-7 are used by the system.

Definition at line 54 of file sifcmd-common.h.

+ Collaboration diagram for t_SifCmdSRegData:
Data Fields
SifCmdHeader_t header
int index
unsigned int value

◆ t_SifCmdHandlerData

struct t_SifCmdHandlerData

Definition at line 66 of file sifcmd-common.h.

Data Fields
SifCmdHandler_t handler
void * harg

◆ t_SifCmdSysHandlerData

struct t_SifCmdSysHandlerData

Definition at line 72 of file sifcmd-common.h.

Data Fields
SifCmdHandler_t handler
void * harg
void * unknown08

◆ _iop_reset_pkt

struct _iop_reset_pkt

Definition at line 82 of file sifcmd-common.h.

+ Collaboration diagram for _iop_reset_pkt:
Data Fields
struct t_SifCmdHeader header
int arglen
int mode
char arg[RESET_ARG_MAX+1]

Macro Definition Documentation

◆ SIF_CMD_ID_SYSTEM

#define SIF_CMD_ID_SYSTEM   0x80000000

System functions

Definition at line 37 of file sifcmd-common.h.

◆ SIF_SREG_RPCINIT

#define SIF_SREG_RPCINIT   0

System SREG

Definition at line 49 of file sifcmd-common.h.

◆ RESET_ARG_MAX

#define RESET_ARG_MAX   79

Triggers an IOP reboot

Definition at line 80 of file sifcmd-common.h.

◆ SIF_CMD_M_INTR

#define SIF_CMD_M_INTR   0x01

Called within an interrupt context

Definition at line 134 of file sifcmd-common.h.

◆ SIF_CMD_M_WBDC

#define SIF_CMD_M_WBDC   0x04

Write back D-cache for extended data

Definition at line 136 of file sifcmd-common.h.

Typedef Documentation

◆ SifCmdHeader_t

SIF command.

◆ SifCmdSRegData_t

Structure for remotely (over the SIF) changing the value of a software register (SREG). There are 32 software registers (0 - 31). Registers 0-7 are used by the system.