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