23 #include <sys/fcntl.h>
27 #define NEWLIB_PORT_AWARE
33 static unsigned int sbuff[0x1300] __attribute__((aligned (64)));
34 static int _intr_data[0xC00] __attribute__((aligned(64)));
58 tim.tm_sec = ps2time[1];
59 tim.tm_min = ps2time[2];
60 tim.tm_hour = ps2time[3];
61 tim.tm_mday = ps2time[4];
62 tim.tm_mon = ps2time[5] - 1;
63 tim.tm_year = ((
u16)ps2time[6] | ((
u16)ps2time[7] << 8)) - 1900;
93 stat->st_size = ((off_t)fiostat->
hisize << 32) | (off_t)fiostat->
size;
97 stat->st_blksize = 16*1024;
98 stat->st_blocks = stat->st_size / 512;
126 dir = malloc(
sizeof(DIR));
128 dir->dd_buf = malloc(
sizeof(
struct dirent));
144 de = (
struct dirent *)dir->dd_buf;
152 strncpy(de->d_name, fiode.
name, 255);
160 printf(
"rewinddir not implemented\n");
180 static int _rb_count = 0;
244 memset(&
cd0, 0,
sizeof(
cd0));
272 packet->reqEntries = req_entries;
278 else { rv =
sbuff[0]; }
304 packet->reqEntries = req_entries;
310 else { rv =
sbuff[0]; }
319 int fileXioMount(
const char* mountpoint,
const char* mountstring,
int flag)
330 strncpy(
packet->blockdevice, mountstring,
sizeof(
packet->blockdevice));
337 else { rv =
sbuff[0]; }
362 else { rv =
sbuff[0]; }
389 else { rv =
sbuff[0]; }
415 else { rv =
sbuff[0]; }
440 else { rv =
sbuff[0]; }
465 else { rv =
sbuff[0]; }
491 else { rv =
sbuff[0]; }
517 else { rv =
sbuff[0]; }
547 else { rv =
sbuff[0]; }
572 else { rv =
sbuff[0]; }
587 va_start(alist,
flags);
588 mode = va_arg(alist,
int);
597 strncpy(
packet->pathname, source,
sizeof(
packet->pathname));
603 else { rv =
sbuff[0]; }
628 else { rv =
sbuff[0]; }
669 else { rv =
sbuff[0]; }
690 if((
unsigned int)buf & 0x3F)
692 miss = 64 - ((
unsigned int)buf & 0x3F);
701 packet->unalignedDataLen = miss;
703 memcpy(
packet->unalignedData, buf, miss);
711 else { rv =
sbuff[0]; }
738 else { rv =
sbuff[0]; }
763 packet->offset_lo = (
u32)(offset & 0xffffffff);
764 packet->offset_hi = (
u32)((offset >> 32) & 0xffffffff);
773 rv = rvHI | ret_packet->
pos_lo;
795 strncpy(
packet->pathname, name,
sizeof(
packet->pathname));
805 else { rv =
sbuff[0]; }
825 strncpy(
packet->pathname, name,
sizeof(
packet->pathname));
834 else { rv =
sbuff[0]; }
843 int fileXioFormat(
const char *dev,
const char *blockdev,
const void *args,
int arglen)
856 strncpy(
packet->blockDevice, blockdev,
sizeof(
packet->blockDevice));
865 else { rv =
sbuff[0]; }
885 strncpy(
packet->device, devname,
sizeof(
packet->device));
891 else { rv =
sbuff[0]; }
911 strncpy(
packet->pathname, name,
sizeof(
packet->pathname));
915 else { rv =
sbuff[0]; }
939 else { rv =
sbuff[0]; }
968 else { rv =
sbuff[0]; }
986 int fileXioDevctl(
const char *name,
int cmd,
void *arg,
unsigned int arglen,
void *
buf,
unsigned int buflen)
1019 else { rv =
sbuff[0]; }
1046 else { rv =
sbuff[0]; }
1087 else { rv =
sbuff[0]; }
static void fxio_ctl_intr(void *data_raw)
int fileXioMkdir(const char *pathname, int mode)
static void fileXioRewinddirHelper(DIR *dir)
int fileXioMount(const char *mountpoint, const char *mountstring, int flag)
int fileXioDread(int fd, iox_dirent_t *dirent)
int fileXioRename(const char *source, const char *dest)
int fileXioChdir(const char *pathname)
static void fill_stat(struct stat *stat, const iox_stat_t *fiostat)
static void recv_intr(void *data_raw)
static int fileXioClosedirHelper(DIR *dir)
static struct dirent * fileXioReaddirHelper(DIR *dir)
int fileXioSymlink(const char *source, const char *dest)
static DIR * fileXioOpendirHelper(const char *path)
int fileXioCopyfile(const char *source, const char *dest, int mode)
int fileXioDevctl(const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen)
int fileXioRead(int fd, void *buf, int size)
int fileXioIoctl(int fd, int cmd, void *arg)
int fileXioRmdir(const char *pathname)
static SifRpcClientData_t cd0
static void _fxio_intr(void)
void fileXioSetBlockMode(int blocking)
int fileXioRemove(const char *pathname)
static mode_t iox_to_posix_mode(unsigned int ps2mode)
static int fileXioGetstatHelper(const char *path, struct stat *buf)
int fileXioDclose(int fd)
int fileXioSetRWBufferSize(int size)
static int fileXioCompletionSema
int fileXioDopen(const char *name)
int fileXioSync(const char *devname, int flag)
s64 fileXioLseek64(int fd, s64 offset, int whence)
int fileXioUmount(const char *mountpoint)
int fileXioReadlink(const char *source, char *buf, int buflen)
static unsigned int sbuff[0x1300]
int fileXioIoctl2(int fd, int command, void *arg, unsigned int arglen, void *buf, unsigned int buflen)
static int _intr_data[0xC00]
int fileXioOpen(const char *source, int flags,...)
static int fileXioBlockMode
int fileXioWrite(int fd, const void *buf, int size)
int fileXioGetStat(const char *name, iox_stat_t *stat)
int fileXioGetdir(const char *pathname, struct fileXioDirEntry dirEntry[], unsigned int req_entries)
int fileXioLseek(int fd, int offset, int whence)
int fileXioFormat(const char *dev, const char *blockdev, const void *args, int arglen)
int fileXioWaitAsync(int mode, int *retVal)
static time_t io_to_posix_time(const unsigned char *ps2time)
int fileXioGetDeviceList(struct fileXioDevice deviceEntry[], unsigned int req_entries)
int fileXioChStat(const char *name, iox_stat_t *stat, int mask)
s32 CreateSema(ee_sema_t *sema)
s32 SignalSema(s32 sema_id)
s32 DeleteSema(s32 sema_id)
s32 iSignalSema(s32 sema_id)
static void nopdelay(void)
s32 PollSema(s32 sema_id)
s32 WaitSema(s32 sema_id)
#define IS_UNCACHED_SEG(x)
DIR *(* _ps2sdk_opendir)(const char *path)
int(* _ps2sdk_stat)(const char *path, struct stat *buf)
void(* _ps2sdk_rewinddir)(DIR *dir)
int64_t(* _ps2sdk_lseek64)(int, int64_t, int)
int(* _ps2sdk_closedir)(DIR *dir)
int(* _ps2sdk_lseek)(int, int, int)
int(* _ps2sdk_write)(int, const void *, int)
int(* _ps2sdk_close)(int)
int(* _ps2sdk_ioctl)(int, int, void *)
int(* _ps2sdk_remove)(const char *)
int(* _ps2sdk_rename)(const char *, const char *)
struct dirent *(* _ps2sdk_readdir)(DIR *dir)
int(* _ps2sdk_read)(int, void *, int)
int(* _ps2sdk_mkdir)(const char *, int)
int(* _ps2sdk_rmdir)(const char *)
int(* _ps2sdk_open)(const char *, int,...)
void SifWriteBackDCache(void *ptr, int size)
int SifBindRpc(SifRpcClientData_t *client, int rpc_number, int mode)
int SifCallRpc(SifRpcClientData_t *client, int rpc_number, int mode, void *send, int ssize, void *receive, int rsize, SifRpcEndFunc_t end_function, void *end_param)
struct t_SifRpcServerData * server
struct fileXioDevice * deviceEntry
struct fileXioDirEntry * dirEntry