PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
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(...)
 
#define SifExitCmd(...)
 
#define SifGetSreg(...)
 
#define SifSetCmdBuffer(...)
 
#define SifAddCmdHandler(...)
 
#define SifRemoveCmdHandler(...)
 
#define SifSendCmd(...)
 
#define iSifSendCmd(...)
 
#define SifWriteBackDCache(...)
 
#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_CMD_CHANGE_SADDR

#define SIF_CMD_CHANGE_SADDR   (SIF_CMD_ID_SYSTEM | 0)

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

◆ SIF_CMD_SET_SREG

#define SIF_CMD_SET_SREG   (SIF_CMD_ID_SYSTEM | 1)

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

◆ SIF_CMD_INIT_CMD

#define SIF_CMD_INIT_CMD   (SIF_CMD_ID_SYSTEM | 2)

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

◆ SIF_CMD_RESET_CMD

#define SIF_CMD_RESET_CMD   (SIF_CMD_ID_SYSTEM | 3)

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

◆ SIF_CMD_RPC_END

#define SIF_CMD_RPC_END   (SIF_CMD_ID_SYSTEM | 8)

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

◆ SIF_CMD_RPC_BIND

#define SIF_CMD_RPC_BIND   (SIF_CMD_ID_SYSTEM | 9)

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

◆ SIF_CMD_RPC_CALL

#define SIF_CMD_RPC_CALL   (SIF_CMD_ID_SYSTEM | 10)

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

◆ SIF_CMD_RPC_RDATA

#define SIF_CMD_RPC_RDATA   (SIF_CMD_ID_SYSTEM | 12)

Definition at line 46 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.

◆ SifInitCmd

#define SifInitCmd ( ...)
Value:
sceSifInitCmd(__VA_ARGS__)

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

◆ SifExitCmd

#define SifExitCmd ( ...)
Value:
sceSifExitCmd(__VA_ARGS__)

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

◆ SifGetSreg

#define SifGetSreg ( ...)
Value:
sceSifGetSreg(__VA_ARGS__)

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

◆ SifSetCmdBuffer

#define SifSetCmdBuffer ( ...)
Value:
sceSifSetCmdBuffer(__VA_ARGS__)

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

◆ SifAddCmdHandler

#define SifAddCmdHandler ( ...)
Value:
sceSifAddCmdHandler(__VA_ARGS__)

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

◆ SifRemoveCmdHandler

#define SifRemoveCmdHandler ( ...)
Value:
sceSifRemoveCmdHandler(__VA_ARGS__)

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

◆ SifSendCmd

#define SifSendCmd ( ...)
Value:
sceSifSendCmd(__VA_ARGS__)

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

◆ iSifSendCmd

#define iSifSendCmd ( ...)
Value:
isceSifSendCmd(__VA_ARGS__)

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

◆ SifWriteBackDCache

#define SifWriteBackDCache ( ...)
Value:
sceSifWriteBackDCache(__VA_ARGS__)

Definition at line 130 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.

◆ SifCmdHandler_t

typedef void(* SifCmdHandler_t) (void *data, void *harg)

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

Function Documentation

◆ sceSifInitCmd()

void sceSifInitCmd ( void )
extern

Definition at line 170 of file sifcmd.c.

◆ sceSifExitCmd()

void sceSifExitCmd ( void )
extern

Definition at line 176 of file sifcmd.c.

◆ sceSifGetSreg()

unsigned int sceSifGetSreg ( int sreg)
extern

Definition at line 60 of file sifcmd.c.

◆ sceSifSetSreg()

void sceSifSetSreg ( int sreg,
unsigned int value )
extern

Definition at line 65 of file sifcmd.c.

◆ sceSifSetCmdBuffer()

void sceSifSetCmdBuffer ( SifCmdHandlerData_t * db,
int size )
extern

Definition at line 184 of file sifcmd.c.

◆ sceSifSetSysCmdBuffer()

void sceSifSetSysCmdBuffer ( SifCmdSysHandlerData_t * db,
int size )
extern

Definition at line 190 of file sifcmd.c.

◆ sceSifAddCmdHandler()

void sceSifAddCmdHandler ( int cid,
SifCmdHandler_t handler,
void * harg )
extern

Definition at line 196 of file sifcmd.c.

◆ sceSifRemoveCmdHandler()

void sceSifRemoveCmdHandler ( int cid)
extern

Definition at line 210 of file sifcmd.c.

◆ sceSifSendCmd()

unsigned int sceSifSendCmd ( int cid,
void * packet,
int packet_size,
void * src_extra,
void * dest_extra,
int size_extra )
extern

Definition at line 292 of file sifcmd.c.

◆ isceSifSendCmd()

unsigned int isceSifSendCmd ( int cid,
void * packet,
int packet_size,
void * src_extra,
void * dest_extra,
int size_extra )
extern

Definition at line 319 of file sifcmd.c.