sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
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
34enum 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
70typedef 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
101{
102 u32 fileSize;
103 u8 fileProperties;
104 char filename[128 + 1];
105} __attribute__((aligned(64)));
106
108{
109 char name[16];
110 unsigned int type;
112 unsigned int version;
113 char desc[128];
114} __attribute__((aligned(64)));
115
117{
118 struct fileXioDevice *deviceEntry;
119 unsigned int reqEntries;
120};
121
123{
124 char pathname[512];
125 struct fileXioDirEntry *dirEntry;
126 unsigned int reqEntries;
127};
128
130{
131 char blockdevice[512];
132 char mountpoint[512];
133 int flags;
134};
135
137{
138 char mountpoint[512];
139};
140
142{
143 char source[512];
144 char dest[512];
145 int mode;
146};
147
149{
150 char pathname[512];
151 int mode;
152};
153
156{
157 char pathname[512];
158};
159
162{
163 char source[512];
164 char dest[512];
165};
166
168{
169 char source[512];
170 void *buffer;
171 unsigned int buflen;
172};
173
175{
176 char pathname[512];
177 int flags, mode;
178};
179
182{
183 int fd;
184};
185
187{
188 int fd;
189 void *buffer;
190 int size;
191 void *intrData;
192};
193
195{
196 int fd;
197 const void *buffer;
198 int size;
199 unsigned int unalignedDataLen;
200 unsigned char unalignedData[64];
201};
202
204{
205 int fd;
206 u32 offset;
207 int whence;
208};
209
211{
212 int fd;
213 u32 offset_lo;
214 u32 offset_hi;
215 int whence;
216};
217
219{
220 char pathname[512];
221 iox_stat_t *stat;
222 int mask;
223};
224
226{
227 char pathname[512];
228 iox_stat_t *stat;
229};
230
232{
233 char device[128];
234 char blockDevice[512];
235 char args[512];
236 int arglen;
237};
238
240{
241 char device[512];
242 int flags;
243};
244
246{
247 int fd;
248 iox_dirent_t *dirent;
249};
250
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
263{
264 int fd;
265 u8 arg[IOCTL_BUF_SIZE];
266 int cmd;
267};
268
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
281{
282 void *dest;
283 int len;
284 u8 buf[CTL_BUF_SIZE];
285 int padding[2];
286};
287
289{
290 u32 pos_lo, pos_hi;
291};
292
294{
295 int size;
296};
297
298#endif /* __FILEXIO_H__ */
unsigned int version
Definition fileXio.h:112