32#ifndef IOMANX_OLD_NAME_COMPATIBILITY
34#define IOMANX_OLD_NAME_COMPATIBILITY 1
36#define IOMANX_OLD_NAME_COMPATIBILITY 0
41#ifndef IOMANX_OLD_NAME_ADDDELDRV
43#define IOMANX_OLD_NAME_ADDDELDRV 1
45#define IOMANX_OLD_NAME_ADDDELDRV 0
49#if IOMANX_OLD_NAME_COMPATIBILITY
50#if IOMANX_OLD_NAME_ADDDELDRV
51#define iomanX_AddDrv AddDrv
52#define iomanX_DelDrv DelDrv
59#define IOP_DT_CHAR 0x01
60#define IOP_DT_CONS 0x02
61#define IOP_DT_BLOCK 0x04
62#define IOP_DT_RAW 0x08
64#ifndef IOMAN_NO_EXTENDED
66#define IOP_DT_FSEXT 0x10000000
89#define IOMANX_RETURN_VALUE_IMPL(val) \
90 static inline int my_iomanx_retval_##val##_int(void) {return -val;} \
91 static inline signed long long my_iomanx_retval_##val##_s64(void) {return -val;}
92#define IOMANX_RETURN_VALUE(val) ((void*)&my_iomanx_retval_##val##_int)
93#define IOMANX_RETURN_VALUE_S64(val) ((void*)&my_iomanx_retval_##val##_s64)
114#ifndef IOMAN_NO_EXTENDED
122 int (*devctl)(
iomanX_iop_file_t *,
const char *, int,
void *,
unsigned int,
void *,
unsigned int);
125 int (*ioctl2)(
iomanX_iop_file_t *, int,
void *,
unsigned int,
void *,
unsigned int);
131extern int iomanX_open(
const char *name,
int flags, ...);
132extern int iomanX_close(
int fd);
133extern int iomanX_read(
int fd,
void *ptr,
int size);
134extern int iomanX_write(
int fd,
void *ptr,
int size);
135extern int iomanX_lseek(
int fd,
int offset,
int mode);
137extern int iomanX_ioctl(
int fd,
int cmd,
void *param);
138extern int iomanX_remove(
const char *name);
140extern int iomanX_mkdir(
const char *path,
int mode);
141extern int iomanX_rmdir(
const char *path);
142extern int iomanX_dopen(
const char *path);
143extern int iomanX_dclose(
int fd);
146extern int iomanX_getstat(
const char *name,
iox_stat_t *stat);
147extern int iomanX_chstat(
const char *name,
iox_stat_t *stat,
unsigned int statmask);
150extern int iomanX_format(
const char *dev,
const char *blockdev,
void *arg,
int arglen);
152#ifndef IOMAN_NO_EXTENDED
154extern int iomanX_rename(
const char *old,
const char *
new);
155extern int iomanX_chdir(
const char *name);
156extern int iomanX_sync(
const char *dev,
int flag);
157extern int iomanX_mount(
const char *fsname,
const char *devname,
int flag,
void *arg,
int arglen);
158extern int iomanX_umount(
const char *fsname);
159extern s64 iomanX_lseek64(
int fd, s64 offset,
int whence);
160extern int iomanX_devctl(
const char *name,
int cmd,
void *arg,
unsigned int arglen,
void *buf,
unsigned int buflen);
161extern int iomanX_symlink(
const char *old,
const char *
new);
162extern int iomanX_readlink(
const char *path,
char *buf,
unsigned int buflen);
163extern int iomanX_ioctl2(
int fd,
int cmd,
void *arg,
unsigned int arglen,
void *buf,
unsigned int buflen);
167extern int iomanX_DelDrv(
const char *name);
169extern void iomanX_StdioInit(
int mode);
172#define iomanX_IMPORTS_start DECLARE_IMPORT_TABLE(iomanx, 1, 1)
173#define iomanX_IMPORTS_end END_IMPORT_TABLE
175#define I_iomanX_GetDeviceList DECLARE_IMPORT(3, iomanX_GetDeviceList)
176#define I_iomanX_open DECLARE_IMPORT(4, iomanX_open)
177#define I_iomanX_close DECLARE_IMPORT(5, iomanX_close)
178#define I_iomanX_read DECLARE_IMPORT(6, iomanX_read)
179#define I_iomanX_write DECLARE_IMPORT(7, iomanX_write)
180#define I_iomanX_lseek DECLARE_IMPORT(8, iomanX_lseek)
181#define I_iomanX_ioctl DECLARE_IMPORT(9, iomanX_ioctl)
182#define I_iomanX_remove DECLARE_IMPORT(10, iomanX_remove)
183#define I_iomanX_mkdir DECLARE_IMPORT(11, iomanX_mkdir)
184#define I_iomanX_rmdir DECLARE_IMPORT(12, iomanX_rmdir)
185#define I_iomanX_dopen DECLARE_IMPORT(13, iomanX_dopen)
186#define I_iomanX_dclose DECLARE_IMPORT(14, iomanX_dclose)
187#define I_iomanX_dread DECLARE_IMPORT(15, iomanX_dread)
188#define I_iomanX_getstat DECLARE_IMPORT(16, iomanX_getstat)
189#define I_iomanX_chstat DECLARE_IMPORT(17, iomanX_chstat)
190#define I_iomanX_format DECLARE_IMPORT(18, iomanX_format)
191#define I_iomanX_rename DECLARE_IMPORT(25, iomanX_rename)
192#define I_iomanX_chdir DECLARE_IMPORT(26, iomanX_chdir)
193#define I_iomanX_sync DECLARE_IMPORT(27, iomanX_sync)
194#define I_iomanX_mount DECLARE_IMPORT(28, iomanX_mount)
195#define I_iomanX_umount DECLARE_IMPORT(29, iomanX_umount)
196#define I_iomanX_lseek64 DECLARE_IMPORT(30, iomanX_lseek64)
197#define I_iomanX_devctl DECLARE_IMPORT(31, iomanX_devctl)
198#define I_iomanX_symlink DECLARE_IMPORT(32, iomanX_symlink)
199#define I_iomanX_readlink DECLARE_IMPORT(33, iomanX_readlink)
200#define I_iomanX_ioctl2 DECLARE_IMPORT(34, iomanX_ioctl2)
201#if IOMANX_OLD_NAME_ADDDELDRV
202#define I_AddDrv DECLARE_IMPORT(20, AddDrv)
203#define I_DelDrv DECLARE_IMPORT(21, DelDrv)
205#define I_iomanX_AddDrv DECLARE_IMPORT(20, iomanX_AddDrv)
206#define I_iomanX_DelDrv DECLARE_IMPORT(21, iomanX_DelDrv)
208#define I_iomanX_StdioInit DECLARE_IMPORT(23, iomanX_StdioInit)
211#if IOMANX_OLD_NAME_COMPATIBILITY
219 return iomanX_GetDeviceList();
222static inline int open(
const char *name,
int flags, ...)
227 va_start(alist, flags);
228 mode = va_arg(alist,
int);
231 return iomanX_open(name, flags, mode);
233static inline int close(
int fd)
235 return iomanX_close(fd);
237static inline int read(
int fd,
void *ptr,
int size)
239 return iomanX_read(fd, ptr, size);
241static inline int write(
int fd,
void *ptr,
int size)
243 return iomanX_write(fd, ptr, size);
245static inline int lseek(
int fd,
int offset,
int mode)
247 return iomanX_lseek(fd, offset, mode);
250static inline int ioctl(
int fd,
int cmd,
void *param)
252 return iomanX_ioctl(fd, cmd, param);
254static inline int remove(
const char *name)
256 return iomanX_remove(name);
259static inline int mkdir(
const char *path,
int mode)
261 return iomanX_mkdir(path, mode);
263static inline int rmdir(
const char *path)
265 return iomanX_rmdir(path);
267static inline int dopen(
const char *path)
269 return iomanX_dopen(path);
271static inline int dclose(
int fd)
273 return iomanX_dclose(fd);
277 return iomanX_dread(fd, buf);
280static inline int getstat(
const char *name,
iox_stat_t *stat)
282 return iomanX_getstat(name, stat);
284static inline int chstat(
const char *name,
iox_stat_t *stat,
unsigned int statmask)
286 return iomanX_chstat(name, stat, statmask);
290static inline int format(
const char *dev,
const char *blockdev,
void *arg,
int arglen)
295#ifndef IOMAN_NO_EXTENDED
297static inline int rename(
const char *old,
const char *
new)
299 return iomanX_rename(old,
new);
301static inline int chdir(
const char *name)
303 return iomanX_chdir(name);
305static inline int sync(
const char *dev,
int flag)
307 return iomanX_sync(dev, flag);
309static inline int mount(
const char *fsname,
const char *devname,
int flag,
void *arg,
int arglen)
311 return iomanX_mount(fsname, devname, flag, arg, arglen);
313static inline int umount(
const char *fsname)
315 return iomanX_umount(fsname);
317static inline s64 lseek64(
int fd, s64 offset,
int whence)
319 return iomanX_lseek64(fd, offset, whence);
321static inline int devctl(
const char *name,
int cmd,
void *arg,
unsigned int arglen,
void *buf,
unsigned int buflen)
323 return iomanX_devctl(name, cmd, arg, arglen, buf, buflen);
325static inline int symlink(
const char *old,
const char *
new)
327 return iomanX_symlink(old,
new);
329static inline int readlink(
const char *path,
char *buf,
unsigned int buflen)
331 return iomanX_readlink(path, buf, buflen);
333static inline int ioctl2(
int fd,
int cmd,
void *arg,
unsigned int arglen,
void *buf,
unsigned int buflen)
335 return iomanX_ioctl2(fd, cmd, arg, arglen, buf, buflen);
339#if !IOMANX_OLD_NAME_ADDDELDRV
342 return iomanX_AddDrv(device);
344static inline int DelDrv(
const char *name)
346 return iomanX_DelDrv(name);
350static inline void StdioInit(
int mode)
352 return iomanX_StdioInit(mode);
356#define I_GetDeviceList I_iomanX_GetDeviceList
357#define I_open I_iomanX_open
358#define I_close I_iomanX_close
359#define I_read I_iomanX_read
360#define I_write I_iomanX_write
361#define I_lseek I_iomanX_lseek
362#define I_ioctl I_iomanX_ioctl
363#define I_remove I_iomanX_remove
364#define I_mkdir I_iomanX_mkdir
365#define I_rmdir I_iomanX_rmdir
366#define I_dopen I_iomanX_dopen
367#define I_dclose I_iomanX_dclose
368#define I_dread I_iomanX_dread
369#define I_getstat I_iomanX_getstat
370#define I_chstat I_iomanX_chstat
371#define I_format I_iomanX_format
372#define I_rename I_iomanX_rename
373#define I_chdir I_iomanX_chdir
374#define I_sync I_iomanX_sync
375#define I_mount I_iomanX_mount
376#define I_umount I_iomanX_umount
377#define I_lseek64 I_iomanX_lseek64
378#define I_devctl I_iomanX_devctl
379#define I_symlink I_iomanX_symlink
380#define I_readlink I_iomanX_readlink
381#define I_ioctl2 I_iomanX_ioctl2
382#if !IOMANX_OLD_NAME_ADDDELDRV
383#define I_AddDrv I_iomanX_AddDrv
384#define I_DelDrv I_iomanX_DelDrv
386#define I_StdioInit I_iomanX_StdioInit
struct _iop_file iop_file_t
int iomanX_format(const char *dev, const char *blockdev, void *arg, int arglen)
struct _iomanX_iop_file iomanX_iop_file_t
struct _iomanX_iop_device * device