PSPSDK 2024-10-31
Loading...
Searching...
No Matches
pspiofilemgr_kernel.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
3 * -----------------------------------------------------------------------
4 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5 *
6 * pspiofilemgr_kernel.h - Interface to the kernel mode library for IoFileMgr.
7 *
8 * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
9 * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
10 * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
11 *
12 */
13
14#ifndef PSPIOFILEMGR_KERNEL_H
15#define PSPIOFILEMGR_KERNEL_H
16
17#include <psptypes.h>
18#include <pspkerneltypes.h>
19#include <pspiofilemgr.h>
20
25#ifdef __cplusplus
26extern "C" {
27#endif
28
32struct PspIoDrv;
33
35typedef struct PspIoDrvArg
36{
38 struct PspIoDrv *drv;
40 void *arg;
42
57
59typedef struct PspIoDrvFuncs
60{
63 int (*IoOpen)(PspIoDrvFileArg *arg, char *file, int flags, SceMode mode);
65 int (*IoRead)(PspIoDrvFileArg *arg, char *data, int len);
66 int (*IoWrite)(PspIoDrvFileArg *arg, const char *data, int len);
68 int (*IoIoctl)(PspIoDrvFileArg *arg, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen);
69 int (*IoRemove)(PspIoDrvFileArg *arg, const char *name);
70 int (*IoMkdir)(PspIoDrvFileArg *arg, const char *name, SceMode mode);
71 int (*IoRmdir)(PspIoDrvFileArg *arg, const char *name);
72 int (*IoDopen)(PspIoDrvFileArg *arg, const char *dirname);
76 int (*IoChstat)(PspIoDrvFileArg *arg, const char *file, SceIoStat *stat, int bits);
77 int (*IoRename)(PspIoDrvFileArg *arg, const char *oldname, const char *newname);
78 int (*IoChdir)(PspIoDrvFileArg *arg, const char *dir);
81 int (*IoDevctl)(PspIoDrvFileArg *arg, const char *devname, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen);
84
85typedef struct PspIoDrv
86{
88 const char *name;
94 const char *name2;
98
115
123int sceIoDelDrv(const char *drv_name);
124
135int sceIoReopen(const char *file, int flags, SceMode mode, SceUID fd);
136
147int sceIoGetThreadCwd(SceUID uid, char *dir, int len);
148
158
161#ifdef __cplusplus
162}
163#endif
164
165#endif /* PSPIOFILEMGR_KERNEL_H */
u32 flags
Definition fixup.c:1
int sceIoGetThreadCwd(SceUID uid, char *dir, int len)
Get the current working directory for a thread.
int sceIoAddDrv(PspIoDrv *drv)
Adds a new IO driver to the system.
int sceIoDelDrv(const char *drv_name)
Deletes a IO driver from the system.
int sceIoReopen(const char *file, int flags, SceMode mode, SceUID fd)
Reopens an existing file descriptor.
int sceIoChangeThreadCwd(SceUID uid, char *dir)
Set the current working directory for a thread.
int SceUID
UIDs are used to describe many different kernel objects.
Definition pspkerneltypes.h:24
SceInt64 SceOff
Definition pspkerneltypes.h:35
int SceMode
Definition pspkerneltypes.h:34
char * name
Definition pspsysmem_kernel.h:4
float x
Definition psptypes.h:0
uint32_t u32
Definition psptypes.h:41
Structure passed to the init and exit functions of the io driver system.
Definition pspiofilemgr_kernel.h:36
void * arg
Pointer to a user defined argument (if written by the driver will preseve across calls.
Definition pspiofilemgr_kernel.h:40
struct PspIoDrv * drv
Pointer to the original driver which was added.
Definition pspiofilemgr_kernel.h:38
Structure passed to the file functions of the io driver system.
Definition pspiofilemgr_kernel.h:45
u32 unk1
Unknown.
Definition pspiofilemgr_kernel.h:47
u32 fs_num
The file system number, e.g.
Definition pspiofilemgr_kernel.h:49
void * arg
Pointer to a user defined argument, this is preserved on a per file basis.
Definition pspiofilemgr_kernel.h:55
PspIoDrvArg * drv
Pointer to the driver structure.
Definition pspiofilemgr_kernel.h:51
u32 unk2
Unknown, again.
Definition pspiofilemgr_kernel.h:53
Structure to maintain the file driver pointers.
Definition pspiofilemgr_kernel.h:60
int(* IoUmount)(PspIoDrvFileArg *arg)
Definition pspiofilemgr_kernel.h:80
int(* IoChdir)(PspIoDrvFileArg *arg, const char *dir)
Definition pspiofilemgr_kernel.h:78
int(* IoExit)(PspIoDrvArg *arg)
Definition pspiofilemgr_kernel.h:62
int(* IoMkdir)(PspIoDrvFileArg *arg, const char *name, SceMode mode)
Definition pspiofilemgr_kernel.h:70
int(* IoGetstat)(PspIoDrvFileArg *arg, const char *file, SceIoStat *stat)
Definition pspiofilemgr_kernel.h:75
int(* IoWrite)(PspIoDrvFileArg *arg, const char *data, int len)
Definition pspiofilemgr_kernel.h:66
int(* IoDclose)(PspIoDrvFileArg *arg)
Definition pspiofilemgr_kernel.h:73
int(* IoUnk21)(PspIoDrvFileArg *arg)
Definition pspiofilemgr_kernel.h:82
int(* IoInit)(PspIoDrvArg *arg)
Definition pspiofilemgr_kernel.h:61
int(* IoMount)(PspIoDrvFileArg *arg)
Definition pspiofilemgr_kernel.h:79
int(* IoChstat)(PspIoDrvFileArg *arg, const char *file, SceIoStat *stat, int bits)
Definition pspiofilemgr_kernel.h:76
int(* IoIoctl)(PspIoDrvFileArg *arg, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen)
Definition pspiofilemgr_kernel.h:68
int(* IoRemove)(PspIoDrvFileArg *arg, const char *name)
Definition pspiofilemgr_kernel.h:69
int(* IoDevctl)(PspIoDrvFileArg *arg, const char *devname, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen)
Definition pspiofilemgr_kernel.h:81
int(* IoRead)(PspIoDrvFileArg *arg, char *data, int len)
Definition pspiofilemgr_kernel.h:65
int(* IoDread)(PspIoDrvFileArg *arg, SceIoDirent *dir)
Definition pspiofilemgr_kernel.h:74
SceOff(* IoLseek)(PspIoDrvFileArg *arg, SceOff ofs, int whence)
Definition pspiofilemgr_kernel.h:67
int(* IoRmdir)(PspIoDrvFileArg *arg, const char *name)
Definition pspiofilemgr_kernel.h:71
int(* IoClose)(PspIoDrvFileArg *arg)
Definition pspiofilemgr_kernel.h:64
int(* IoOpen)(PspIoDrvFileArg *arg, char *file, int flags, SceMode mode)
Definition pspiofilemgr_kernel.h:63
int(* IoDopen)(PspIoDrvFileArg *arg, const char *dirname)
Definition pspiofilemgr_kernel.h:72
int(* IoRename)(PspIoDrvFileArg *arg, const char *oldname, const char *newname)
Definition pspiofilemgr_kernel.h:77
Definition pspiofilemgr_kernel.h:86
PspIoDrvFuncs * funcs
Pointer to a filled out functions table.
Definition pspiofilemgr_kernel.h:96
u32 dev_type
Device type, this 0x10 is for a filesystem driver.
Definition pspiofilemgr_kernel.h:90
const char * name2
This seems to be the same as name but capitalised :/.
Definition pspiofilemgr_kernel.h:94
const char * name
The name of the device to add.
Definition pspiofilemgr_kernel.h:88
u32 unk2
Unknown, set to 0x800.
Definition pspiofilemgr_kernel.h:92
Describes a single directory entry.
Definition pspiofilemgr_dirent.h:24
Structure to hold the status information about a file.
Definition pspiofilemgr_stat.h:102