PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
sifrpc.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) 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 __SIFRPC_H__
18
#define __SIFRPC_H__
19
20
#include <
sifcmd.h
>
21
22
/* Modes for bind() and call() */
24
#define SIF_RPC_M_NOWAIT 0x01
26
#define SIF_RPC_M_NOWBDC 0x02
27
28
#ifdef __cplusplus
29
extern
"C"
{
30
#endif
31
32
typedef
void
*(*SifRpcFunc_t)(
int
fno,
void
*buffer,
int
length);
33
typedef
void (*SifRpcEndFunc_t)(
void
*end_param);
34
35
#ifdef __cplusplus
36
}
37
#endif
38
39
typedef
struct
t_SifRpcPktHeader
40
{
41
struct
t_SifCmdHeader
sifcmd;
42
int
rec_id;
43
void
*pkt_addr;
44
int
rpc_id;
45
}
SifRpcPktHeader_t
;
46
47
typedef
struct
t_SifRpcRendPkt
48
{
49
struct
t_SifCmdHeader
sifcmd;
50
int
rec_id;
/* 04 */
51
void
*pkt_addr;
/* 05 */
52
int
rpc_id;
/* 06 */
53
54
struct
t_SifRpcClientData
*client;
/* 7 */
55
u32 cid;
/* 8 */
56
struct
t_SifRpcServerData
*server;
/* 9 */
57
void
*buff,
/* 10 */
58
*cbuff;
/* 11 */
59
}
SifRpcRendPkt_t
;
60
61
typedef
struct
t_SifRpcOtherDataPkt
62
{
63
struct
t_SifCmdHeader
sifcmd;
64
int
rec_id;
/* 04 */
65
void
*pkt_addr;
/* 05 */
66
int
rpc_id;
/* 06 */
67
68
struct
t_SifRpcReceiveData
*receive;
/* 07 */
69
void
*src;
/* 08 */
70
void
*dest;
/* 09 */
71
int
size;
/* 10 */
72
}
SifRpcOtherDataPkt_t
;
73
74
typedef
struct
t_SifRpcBindPkt
75
{
76
struct
t_SifCmdHeader
sifcmd;
77
int
rec_id;
/* 04 */
78
void
*pkt_addr;
/* 05 */
79
int
rpc_id;
/* 06 */
80
struct
t_SifRpcClientData
*client;
/* 07 */
81
int
sid;
/* 08 */
82
}
SifRpcBindPkt_t
;
83
84
typedef
struct
t_SifRpcCallPkt
85
{
86
struct
t_SifCmdHeader
sifcmd;
87
int
rec_id;
/* 04 */
88
void
*pkt_addr;
/* 05 */
89
int
rpc_id;
/* 06 */
90
struct
t_SifRpcClientData
*client;
/* 07 */
91
int
rpc_number;
/* 08 */
92
int
send_size;
/* 09 */
93
void
*receive;
/* 10 */
94
int
recv_size;
/* 11 */
95
int
rmode;
/* 12 */
96
struct
t_SifRpcServerData
*server;
/* 13 */
97
}
SifRpcCallPkt_t
;
98
99
typedef
struct
t_SifRpcServerData
100
{
101
int
sid;
/* 04 00 */
102
103
SifRpcFunc_t func;
/* 05 01 */
104
void
*buff;
/* 06 02 */
105
int
size;
/* 07 03 */
106
107
SifRpcFunc_t cfunc;
/* 08 04 */
108
void
*cbuff;
/* 09 05 */
109
int
size2;
/* 10 06 */
110
111
struct
t_SifRpcClientData
*client;
/* 11 07 */
112
void
*pkt_addr;
/* 12 08 */
113
int
rpc_number;
/* 13 09 */
114
115
void
*receive;
/* 14 10 */
116
int
rsize;
/* 15 11 */
117
int
rmode;
/* 16 12 */
118
int
rid;
/* 17 13 */
119
120
struct
t_SifRpcServerData
*link;
/* 18 14 */
121
struct
t_SifRpcServerData
*next;
/* 19 15 */
122
struct
t_SifRpcDataQueue
*base;
/* 20 16 */
123
}
SifRpcServerData_t
;
124
125
126
typedef
struct
t_SifRpcHeader
127
{
128
void
*pkt_addr;
/* 04 00 */
129
u32 rpc_id;
/* 05 01 */
130
int
sema_id;
/* 06 02 */
131
u32 mode;
/* 07 03 */
132
}
SifRpcHeader_t
;
133
134
135
typedef
struct
t_SifRpcClientData
136
{
137
struct
t_SifRpcHeader
hdr;
138
u32 command;
/* 04 08 */
139
void
*buff,
/* 05 09 */
140
*cbuff;
/* 06 10 */
141
SifRpcEndFunc_t end_function;
/* 07 11 */
142
void
*end_param;
/* 08 12*/
143
struct
t_SifRpcServerData
*server;
/* 09 13 */
144
}
SifRpcClientData_t
;
145
146
typedef
struct
t_SifRpcReceiveData
147
{
148
struct
t_SifRpcHeader
hdr;
149
void
*src,
/* 04 */
150
*dest;
/* 05 */
151
int
size;
/* 06 */
152
}
SifRpcReceiveData_t
;
153
154
typedef
struct
t_SifRpcDataQueue
155
{
156
int
thread_id,
/* 00 */
157
active;
/* 01 */
158
struct
t_SifRpcServerData
*link,
/* 02 */
159
*start,
/* 03 */
160
*end;
/* 04 */
161
struct
t_SifRpcDataQueue
*next;
/* 05 */
162
}
SifRpcDataQueue_t
;
163
164
#ifdef __cplusplus
165
extern
"C"
{
166
#endif
167
168
void
SifInitRpc(
int
mode);
169
void
SifExitRpc(
void
);
170
171
/* SIF RPC client API */
172
int
SifBindRpc(
SifRpcClientData_t
*client,
int
rpc_number,
int
mode);
173
int
SifCallRpc(
SifRpcClientData_t
*client,
int
rpc_number,
int
mode,
174
void
*send,
int
ssize,
void
*receive,
int
rsize,
175
SifRpcEndFunc_t end_function,
void
*end_param);
176
int
SifRpcGetOtherData(
SifRpcReceiveData_t
*rd,
void
*src,
void
*dest,
177
int
size,
int
mode);
178
179
int
SifCheckStatRpc(
SifRpcClientData_t
*cd);
180
181
/* SIF RPC server API */
182
SifRpcDataQueue_t
*
183
SifSetRpcQueue(
SifRpcDataQueue_t
*q,
int
thread_id);
184
SifRpcDataQueue_t
*
185
SifRemoveRpcQueue(
SifRpcDataQueue_t
*qd);
186
187
SifRpcServerData_t
*
188
SifRegisterRpc(
SifRpcServerData_t
*srv,
189
int
sid, SifRpcFunc_t func,
void
*buff, SifRpcFunc_t cfunc,
190
void
*cbuff,
SifRpcDataQueue_t
*qd);
191
SifRpcServerData_t
*
192
SifRemoveRpc(
SifRpcServerData_t
*sd,
SifRpcDataQueue_t
*queue);
193
194
SifRpcServerData_t
*
195
SifGetNextRequest(
SifRpcDataQueue_t
*qd);
196
197
void
SifExecRequest(
SifRpcServerData_t
*srv);
198
void
SifRpcLoop(
SifRpcDataQueue_t
*q);
199
200
#ifdef __cplusplus
201
}
202
#endif
203
204
#endif
/* __SIFRPC_H__ */
sifcmd.h
t_SifCmdHeader
Definition
sifcmd.h:23
t_SifRpcBindPkt
Definition
sifrpc.h:75
t_SifRpcCallPkt
Definition
sifrpc.h:85
t_SifRpcClientData
Definition
sifrpc.h:136
t_SifRpcDataQueue
Definition
sifrpc.h:155
t_SifRpcHeader
Definition
sifrpc.h:127
t_SifRpcOtherDataPkt
Definition
sifrpc.h:62
t_SifRpcPktHeader
Definition
sifrpc.h:40
t_SifRpcReceiveData
Definition
sifrpc.h:147
t_SifRpcRendPkt
Definition
sifrpc.h:48
t_SifRpcServerData
Definition
sifrpc.h:100
ee
kernel
include
sifrpc.h
Generated on Thu Nov 14 2024 05:25:24 for PS2SDK by
1.9.8