PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
sifcmd.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# (C)2001, Gustavo Scotti (gustavo@scotti.com)
7# (c) 2003 Marcus R. Brown (mrbrown@0xd6.org)
8# Licenced under Academic Free License version 2.0
9# Review ps2sdk README & LICENSE files for further details.
10*/
11
17#ifndef __SIFCMD_H__
18#define __SIFCMD_H__
19
20#include <tamtypes.h>
21
22typedef struct t_SifCmdHeader
23{
25 u32 psize : 8;
27 u32 dsize : 24;
29 void *dest;
31 int cid;
33 u32 opt;
35
37#define SIF_CMD_ID_SYSTEM 0x80000000
38
39#define SIF_CMD_CHANGE_SADDR (SIF_CMD_ID_SYSTEM | 0)
40#define SIF_CMD_SET_SREG (SIF_CMD_ID_SYSTEM | 1)
41#define SIF_CMD_INIT_CMD (SIF_CMD_ID_SYSTEM | 2)
42#define SIF_CMD_RESET_CMD (SIF_CMD_ID_SYSTEM | 3)
43#define SIF_CMD_RPC_END (SIF_CMD_ID_SYSTEM | 8)
44#define SIF_CMD_RPC_BIND (SIF_CMD_ID_SYSTEM | 9)
45#define SIF_CMD_RPC_CALL (SIF_CMD_ID_SYSTEM | 10)
46#define SIF_CMD_RPC_RDATA (SIF_CMD_ID_SYSTEM | 12)
47
49#define SIF_SREG_RPCINIT 0
50
54typedef struct t_SifCmdSRegData
55{
56 SifCmdHeader_t header;
57 int index;
58 unsigned int value;
60
61#ifdef __cplusplus
62extern "C"
63#endif
64 typedef void (*SifCmdHandler_t)(void *data, void *harg);
65
66typedef struct t_SifCmdHandlerData
67{
68 SifCmdHandler_t handler;
69 void *harg;
71
73#define RESET_ARG_MAX 79
74
75typedef struct _iop_reset_pkt
76{
77 struct t_SifCmdHeader header;
78 int arglen;
79 int mode;
80 char arg[RESET_ARG_MAX + 1];
82
83#ifdef __cplusplus
84extern "C" {
85#endif
86
87unsigned int SifSendCmd(int cmd, void *packet, int packet_size, void *src_extra,
88 void *dest_extra, int size_extra);
89unsigned int iSifSendCmd(int cmd, void *packet, int packet_size, void *src_extra,
90 void *dest_extra, int size_extra);
91void SifAddCmdHandler(int pos, SifCmdHandler_t handler, void *harg);
92void SifRemoveCmdHandler(int pos);
93void SifInitCmd(void);
94void SifExitCmd(void);
95SifCmdHandlerData_t *SifSetCmdBuffer(SifCmdHandlerData_t *db, int size);
96int SifGetSreg(int index);
97
98void SifWriteBackDCache(void *ptr, int size); // EE only
99
100// Send mode bits
102#define SIF_CMD_M_INTR 0x01
104#define SIF_CMD_M_WBDC 0x04
105
106#ifdef __cplusplus
107}
108#endif
109
110#endif /* __SIFCMD_H__ */
#define RESET_ARG_MAX
Definition sifcmd.h:73
struct t_SifCmdSRegData SifCmdSRegData_t
void * dest
Definition sifcmd.h:29