PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
sifcmd.c File Reference
#include <tamtypes.h>
#include <kernel.h>
#include <sifcmd.h>
+ Include dependency graph for sifcmd.c:

Go to the source code of this file.

Data Structures

struct  cmd_data
 

Macros

#define CMD_PACKET_MAX   128
 
#define CMD_PACKET_DATA_MAX   112
 
#define SYS_CMD_HANDLER_MAX   32
 
#define DMAC_COMM_STAT   0x1000e010
 
#define DMAC_SIF0_CHCR   0x1000c000
 
#define CHCR_STR   0x100
 
#define STAT_SIF0   0x20
 

Functions

struct cmd_data __attribute__ ((aligned(64)))
 
unsigned int _SifSendCmd (int cid, int mode, void *pkt, int pktsize, void *src, void *dest, int size)
 
int _SifCmdIntHandler (int channel)
 

Variables

void * pktbuf
 
void * unused
 
void * iopbuf
 
SifCmdSysHandlerData_tsys_cmd_handlers
 
u32 nr_sys_handlers
 
SifCmdHandlerData_tusr_cmd_handlers
 
u32 nr_usr_handlers
 
int * sregs
 
int _iop_reboot_count
 
struct cmd_data _sif_cmd_data
 

Detailed Description

EE SIF commands MRB: This file now contains the SIF routines included with libpsware. Bug reports welcome.

Definition in file sifcmd.c.


Data Structure Documentation

◆ cmd_data

struct cmd_data

Even though I'm reluctant to do this, I've made this structure binary compatible with the SCE libs and ps2lib. In all implementations, a pointer to this data is stored in SIF register 0x80000001. Each routine that relies on this data can then use the data referenced from that register, so that even if a SIF library is initialized after this one, we should still work exactly as expected.

Definition at line 39 of file sifcmd.c.

+ Collaboration diagram for cmd_data:
Data Fields
void * pktbuf

Command packet received from the IOP

void * unused
void * iopbuf

Address of IOP SIF DMA receive address

SifCmdSysHandlerData_t * sys_cmd_handlers
u32 nr_sys_handlers
SifCmdHandlerData_t * usr_cmd_handlers
u32 nr_usr_handlers
int * sregs

Macro Definition Documentation

◆ CMD_PACKET_MAX

#define CMD_PACKET_MAX   128

Definition at line 23 of file sifcmd.c.

◆ CMD_PACKET_DATA_MAX

#define CMD_PACKET_DATA_MAX   112

Definition at line 24 of file sifcmd.c.

◆ SYS_CMD_HANDLER_MAX

#define SYS_CMD_HANDLER_MAX   32

Definition at line 25 of file sifcmd.c.

◆ DMAC_COMM_STAT

#define DMAC_COMM_STAT   0x1000e010

Definition at line 28 of file sifcmd.c.

◆ DMAC_SIF0_CHCR

#define DMAC_SIF0_CHCR   0x1000c000

Definition at line 29 of file sifcmd.c.

◆ CHCR_STR

#define CHCR_STR   0x100

Definition at line 30 of file sifcmd.c.

◆ STAT_SIF0

#define STAT_SIF0   0x20

Definition at line 31 of file sifcmd.c.

Variable Documentation

◆ pktbuf

void* pktbuf

Command packet received from the IOP

Definition at line 1 of file sifcmd.c.

◆ unused

void* unused

Definition at line 2 of file sifcmd.c.

◆ iopbuf

void* iopbuf

Address of IOP SIF DMA receive address

Definition at line 4 of file sifcmd.c.

◆ sys_cmd_handlers

SifCmdSysHandlerData_t* sys_cmd_handlers

Definition at line 5 of file sifcmd.c.

◆ nr_sys_handlers

u32 nr_sys_handlers

Definition at line 6 of file sifcmd.c.

◆ usr_cmd_handlers

SifCmdHandlerData_t* usr_cmd_handlers

Definition at line 7 of file sifcmd.c.

◆ nr_usr_handlers

u32 nr_usr_handlers

Definition at line 8 of file sifcmd.c.

◆ sregs

int* sregs

Definition at line 9 of file sifcmd.c.