PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
fileXio.h
Go to the documentation of this file.
1
/*
2
# _____ ___ ____ ___ ____
3
# ____| | ____| | | |____|
4
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5
#-----------------------------------------------------------------------
6
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7
# Licenced under Academic Free License version 2.0
8
# Review ps2sdk README & LICENSE files for further details.
9
*/
10
19
#ifndef __FILEXIO_H__
20
#define __FILEXIO_H__
21
22
#include <
tamtypes.h
>
23
#include <
iox_stat.h
>
24
25
#ifdef _EE
26
#ifndef NEWLIB_PORT_AWARE
27
#error "Using fio/fileXio functions directly in the newlib port will lead to problems."
28
#error "Use posix function calls instead."
29
#endif
30
#endif
31
32
#define FILEXIO_IRX 0xb0b0b00
33
enum
FILEXIO_CMDS {
34
FILEXIO_DOPEN = 0x01,
35
FILEXIO_DREAD,
36
FILEXIO_DCLOSE,
37
FILEXIO_MOUNT,
38
FILEXIO_UMOUNT,
39
FILEXIO_GETDIR,
40
FILEXIO_STOP,
41
FILEXIO_COPYFILE,
42
FILEXIO_OPEN,
43
FILEXIO_CLOSE,
44
FILEXIO_READ,
45
FILEXIO_WRITE,
46
FILEXIO_LSEEK,
47
FILEXIO_IOCTL,
48
FILEXIO_RMDIR,
49
FILEXIO_GETSTAT,
50
FILEXIO_CHSTAT,
51
FILEXIO_FORMAT,
52
FILEXIO_ADDDRV,
53
FILEXIO_DELDRV,
54
FILEXIO_RENAME,
55
FILEXIO_CHDIR,
56
FILEXIO_SYNC,
57
FILEXIO_DEVCTL,
58
FILEXIO_SYMLINK,
59
FILEXIO_READLINK,
60
FILEXIO_IOCTL2,
61
FILEXIO_LSEEK64,
62
FILEXIO_MKDIR,
63
FILEXIO_REMOVE,
64
FILEXIO_GETDEVICELIST,
65
FILEXIO_SETRWBUFFSIZE
66
};
67
69
typedef
struct
70
{
71
int
ssize;
72
int
esize;
73
void
*sbuf;
74
void
*ebuf;
75
u8 sbuffer[64];
76
u8 ebuffer[64];
77
}
rests_pkt
;
// sizeof = 144
78
79
#define FILEXIO_MOUNTFLAG_NORMAL 0
80
#define FILEXIO_MOUNTFLAG_READONLY 1
81
#define FILEXIO_MOUNTFLAG_ROBUST 2
82
83
#define FILEXIO_DIRFLAGS_DIR 0xa0
84
#define FILEXIO_DIRFLAGS_FILE 0x80
85
86
#define CTL_BUF_SIZE 2048
87
#define IOCTL_BUF_SIZE 1024
88
89
#define FILEXIO_MAX_DEVICES 32
90
91
#define FILEXIO_DT_CHAR 0x01
92
#define FILEXIO_DT_CONS 0x02
93
#define FILEXIO_DT_BLOCK 0x04
94
#define FILEXIO_DT_RAW 0x08
95
#define FILEXIO_DT_FS 0x10
97
#define FILEXIO_DT_FSEXT 0x10000000
98
99
struct
fileXioDirEntry
100
{
101
u32 fileSize;
102
u8 fileProperties;
103
char
filename[128 + 1];
104
}
__attribute__
((
aligned
(64)));
105
106
struct
fileXioDevice
107
{
108
char
name[16];
109
unsigned
int
type;
111
unsigned
int
version
;
112
char
desc[128];
113
}
__attribute__
((
aligned
(64)));
114
115
struct
fxio_devlist_packet
116
{
117
struct
fileXioDevice
*deviceEntry;
118
unsigned
int
reqEntries;
119
};
120
121
struct
fxio_getdir_packet
122
{
123
char
pathname[512];
124
struct
fileXioDirEntry
*dirEntry;
125
unsigned
int
reqEntries;
126
};
127
128
struct
fxio_mount_packet
129
{
130
char
blockdevice[512];
131
char
mountpoint[512];
132
int
flags;
133
};
134
135
struct
fxio_unmount_packet
136
{
137
char
mountpoint[512];
138
};
139
140
struct
fxio_copyfile_packet
141
{
142
char
source[512];
143
char
dest[512];
144
int
mode;
145
};
146
147
struct
fxio_mkdir_packet
148
{
149
char
pathname[512];
150
int
mode;
151
};
152
154
struct
fxio_pathsel_packet
155
{
156
char
pathname[512];
157
};
158
160
struct
fxio_rename_packet
161
{
162
char
source[512];
163
char
dest[512];
164
};
165
166
struct
fxio_readlink_packet
167
{
168
char
source[512];
169
void
*buffer;
170
unsigned
int
buflen;
171
};
172
173
struct
fxio_open_packet
174
{
175
char
pathname[512];
176
int
flags, mode;
177
};
178
180
struct
fxio_close_packet
181
{
182
int
fd;
183
};
184
185
struct
fxio_read_packet
186
{
187
int
fd;
188
void
*buffer;
189
int
size;
190
void
*intrData;
191
};
192
193
struct
fxio_write_packet
194
{
195
int
fd;
196
const
void
*buffer;
197
int
size;
198
unsigned
int
unalignedDataLen;
199
unsigned
char
unalignedData[64];
200
};
201
202
struct
fxio_lseek_packet
203
{
204
int
fd;
205
u32 offset;
206
int
whence;
207
};
208
209
struct
fxio_lseek64_packet
210
{
211
int
fd;
212
u32 offset_lo;
213
u32 offset_hi;
214
int
whence;
215
};
216
217
struct
fxio_chstat_packet
218
{
219
char
pathname[512];
220
iox_stat_t
*stat;
221
int
mask;
222
};
223
224
struct
fxio_getstat_packet
225
{
226
char
pathname[512];
227
iox_stat_t
*stat;
228
};
229
230
struct
fxio_format_packet
231
{
232
char
device[128];
233
char
blockDevice[512];
234
char
args[512];
235
int
arglen;
236
};
237
238
struct
fxio_sync_packet
239
{
240
char
device[512];
241
int
flags;
242
};
243
244
struct
fxio_dread_packet
245
{
246
int
fd;
247
iox_dirent_t
*dirent;
248
};
249
250
struct
fxio_devctl_packet
251
{
252
char
name[CTL_BUF_SIZE];
253
u8 arg[CTL_BUF_SIZE];
254
int
cmd;
255
int
arglen;
256
void
*buf;
257
int
buflen;
258
void
*intr_data;
259
};
260
261
struct
fxio_ioctl_packet
262
{
263
int
fd;
264
u8 arg[IOCTL_BUF_SIZE];
265
int
cmd;
266
};
267
268
struct
fxio_ioctl2_packet
269
{
270
int
fd;
271
u8 arg[CTL_BUF_SIZE];
272
int
cmd;
273
int
arglen;
274
void
*buf;
275
int
buflen;
276
void
*intr_data;
277
};
278
279
struct
fxio_ctl_return_pkt
280
{
281
void
*dest;
282
int
len;
283
u8 buf[CTL_BUF_SIZE];
284
int
padding[2];
285
};
286
287
struct
fxio_lseek64_return_pkt
288
{
289
u32 pos_lo, pos_hi;
290
};
291
292
struct
fxio_rwbuff
293
{
294
int
size;
295
};
296
297
#endif
/* __FILEXIO_H__ */
fileXioDevice::version
unsigned int version
Definition
fileXio.h:111
fileXioDevice
Definition
fileXio.h:107
fileXioDirEntry
Definition
fileXio.h:100
fxio_chstat_packet
Definition
fileXio.h:218
fxio_close_packet
Definition
fileXio.h:181
fxio_copyfile_packet
Definition
fileXio.h:141
fxio_ctl_return_pkt
Definition
fileXio.h:280
fxio_devctl_packet
Definition
fileXio.h:251
fxio_devlist_packet
Definition
fileXio.h:116
fxio_dread_packet
Definition
fileXio.h:245
fxio_format_packet
Definition
fileXio.h:231
fxio_getdir_packet
Definition
fileXio.h:122
fxio_getstat_packet
Definition
fileXio.h:225
fxio_ioctl2_packet
Definition
fileXio.h:269
fxio_ioctl_packet
Definition
fileXio.h:262
fxio_lseek64_packet
Definition
fileXio.h:210
fxio_lseek64_return_pkt
Definition
fileXio.h:288
fxio_lseek_packet
Definition
fileXio.h:203
fxio_mkdir_packet
Definition
fileXio.h:148
fxio_mount_packet
Definition
fileXio.h:129
fxio_open_packet
Definition
fileXio.h:174
fxio_pathsel_packet
Definition
fileXio.h:155
fxio_read_packet
Definition
fileXio.h:186
fxio_readlink_packet
Definition
fileXio.h:167
fxio_rename_packet
Definition
fileXio.h:161
fxio_rwbuff
Definition
fileXio.h:293
fxio_sync_packet
Definition
fileXio.h:239
fxio_unmount_packet
Definition
fileXio.h:136
fxio_write_packet
Definition
fileXio.h:194
iox_stat.h
iox_dirent_t
Definition
iox_stat.h:112
iox_stat_t
Definition
iox_stat.h:93
rests_pkt
Definition
fileXio.h:70
__attribute__
Definition
gif_registers.h:39
tamtypes.h
common
include
fileXio.h
Generated on Thu Nov 14 2024 05:25:24 for PS2SDK by
1.9.8