vitasdk
Documentation of the vitasdk
iofilemgr.h
Go to the documentation of this file.
1
6#ifndef _PSP2KERN_KERNEL_IOFILEMGR_H_
7#define _PSP2KERN_KERNEL_IOFILEMGR_H_
8
10#include <psp2kern/types.h>
11#include <psp2kern/io/fcntl.h>
12#include <psp2kern/io/devctl.h>
13#include <psp2kern/io/stat.h>
14#include <psp2kern/io/dirent.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
25
36int ksceIoGetGUIDFdListForDebugger(int vis_level, SceIoFdInfo *dst, SceSize max_size, SceSize *res_size);
37
38#define ksceIoGetGUIDFdList ksceIoGetGUIDFdListForDebugger
39
50int ksceIoGetPUIDFdListForDebugger(int vis_level, SceIoFdInfo *dst, SceSize max_size, SceSize *res_size);
51
52#define ksceIoGetPUIDFdList ksceIoGetPUIDFdListForDebugger
53
54typedef struct SceIofileInfo { // size is 0x828
55 char path[0x400];
56 char path2[0x400];
65 int data_0x820; // maybe media type
69
80
93int ksceIoMount(int id, const char *path, int permission, int a4, int a5, int a6);
94
105int ksceIoUmount(int id, int a2, int a3, int a4);
106
116
117typedef struct SceVfsMount SceVfsMount;
118typedef struct SceVfsMountData SceVfsMountData;
119typedef struct SceVfsVnode SceVfsVnode;
120
130
135
150VITASDK_BUILD_ASSERT_EQ(0x34, SceIoMount); // size is from FW 3.60
151
192VITASDK_BUILD_ASSERT_EQ(0x54C, SceIoMountInfo); // size is from FW 3.60
193
195typedef int (SceIoPathMappingFunc)(const char *path, ScePID pid, char *mapped_path, SceSize mapped_path_size);
196
203VITASDK_BUILD_ASSERT_EQ(0x10, SceVfsChstatArgs); // size is from FW 3.60
204
210VITASDK_BUILD_ASSERT_EQ(0xC, SceVfsChstatByFdArgs); // size is from FW 3.60
211
215VITASDK_BUILD_ASSERT_EQ(0x4, SceVfsCloseArgs); // size is from FW 3.60
216
225VITASDK_BUILD_ASSERT_EQ(0x18, SceVfsIoctlArgs); // size is from FW 3.60
226
227typedef struct SceVfsOpenArgs {
228 const char *filename;
229 int flags;
232VITASDK_BUILD_ASSERT_EQ(0xC, SceVfsOpenArgs); // size is from FW 3.60
233
241VITASDK_BUILD_ASSERT_EQ(0x18, SceVfsPreadArgs); // size is from FW 3.60
242
250VITASDK_BUILD_ASSERT_EQ(0x18, SceVfsPwriteArgs); // size is from FW 3.60
251
257VITASDK_BUILD_ASSERT_EQ(0xC, SceVfsReadArgs); // size is from FW 3.60
258
264VITASDK_BUILD_ASSERT_EQ(0xC, SceVfsWriteArgs); // size is from FW 3.60
265
279VITASDK_BUILD_ASSERT_EQ(0x1C, SceIoErrorEventInfo); // size is from FW 3.60
280
282int ksceIoChstatForVshbridge(const char *name, const SceIoStat *stat, unsigned int cbit);
283
286
297SceUID ksceIoCreateErrorEvent(int vsh_mount_id, SceUInt32 event_bits, SceIoErrorEventInfo *event_info);
298
308SceUID ksceIoCreateMountEvent(int vsh_mount_id, SceUInt32 event_bits);
309
312
315
318
334int ksceIoGetMediaType(ScePID pid, const char *path, int ignored, SceUInt32 *media_type);
335
338
340int ksceIoGetstatForVshbridge(const char *name, SceIoStat *stat);
341
343int ksceIoIoctl(SceUID fd, int cmd, const void *argp, SceSize arglen, void *bufp, SceSize buflen);
344
346SceUID ksceIoOpenForPid(ScePID pid, const char *filename, int flags, SceMode mode);
347
355
358
360SceUID vfsAllocateFileDummy(int flags, SceBool is_dir, const char *name);
361
364
367
370
380
388int vfsGetMntList(SceIoMount *mounts, SceSize capacity, SceSize *count);
389
392
395
398
401
404
407
408#ifdef __cplusplus
409}
410#endif
411
412#endif /* _PSP2KERN_KERNEL_IOFILEMGR_H_ */
#define VITASDK_BUILD_ASSERT_EQ(__size__, __name__)
Definition build_utils.h:13
SceSize default_io_cache_size
Default I/O-cache size.
Definition iofilemgr.h:174
SceVfsVnode * vnode_list_head
First vnode belonging to the mount.
Definition iofilemgr.h:171
SceMode mode
File access permissions.
Definition iofilemgr.h:230
int vsh_mount_id
One of SceVshMountId.
Definition iofilemgr.h:160
int vfsIoctl(SceVfsIoctlArgs *args)
Perform an ioctl through VFS before returning.
int vfsClose(SceVfsCloseArgs *args)
Close a file through VFS before returning.
SceUID pid
Definition iofilemgr.h:22
const SceIoStat * stat
Definition iofilemgr.h:207
SceUInt32 cbit
Bitwise OR of SCE_CST_* values.
Definition iofilemgr.h:200
SceSize outlen
Size of SceVfsIoctlArgs::outdata.
Definition iofilemgr.h:223
int ksceIoGetPUIDFdListForDebugger(int vis_level, SceIoFdInfo *dst, SceSize max_size, SceSize *res_size)
Get process file descriptor.
SceUInt32 reserved2[2]
Must be zero when creating the event.
Definition iofilemgr.h:277
int data_0x804
Definition iofilemgr.h:58
SceVfsVnode * mountpoint
Vnode on which this filesystem is mounted.
Definition iofilemgr.h:167
SceUInt32 vsh_mount_id
Mount ID that produced the error.
Definition iofilemgr.h:273
const char * path
Definition iofilemgr.h:198
SceSize size
Definition iofilemgr.h:237
int ksceIoDeleteMountEvent(SceUID event_uid)
Delete a mount event by kernel GUID.
int vfsGetMntInfo(SceVfsMount *mnt, SceIoMountInfo *info)
Get a snapshot of one mounted filesystem.
SceVfsMount * mounted_on_list
First mount attached to this mount.
Definition iofilemgr.h:172
int data_0x81C
Definition iofilemgr.h:64
void * fd_lock
Internal file-descriptor lock object.
Definition iofilemgr.h:176
SceUID fd_lock_mutex
File-descriptor lock mutex UID.
Definition iofilemgr.h:177
SceVfsMount * mnt
Internal VFS mount.
Definition iofilemgr.h:143
int data_0x80C
Definition iofilemgr.h:60
SceSSize vfsPwrite(SceVfsPwriteArgs *args)
Write at the specified file offset before returning.
SceUID ksceIoCreateErrorEvent(int vsh_mount_id, SceUInt32 event_bits, SceIoErrorEventInfo *event_info)
Create an I/O error event.
SceSSize vfsRead(SceVfsReadArgs *args)
Read from a file before returning.
SceUInt32 reference_count
Internal mount reference count.
Definition iofilemgr.h:169
int ksceIoIoctl(SceUID fd, int cmd, const void *argp, SceSize arglen, void *bufp, SceSize buflen)
Perform an ioctl using kernel buffers.
const void * data
Definition iofilemgr.h:245
int vfsChstatByFd(SceVfsChstatByFdArgs *args)
Change file status by descriptor through VFS before returning.
int ksceIoGetGUIDFdListForDebugger(int vis_level, SceIoFdInfo *dst, SceSize max_size, SceSize *res_size)
Get global file descriptor.
SceBool allow_attribute_change
Preserve the internal 0x10000 attribute-change bit.
Definition iofilemgr.h:201
char block_device_primary[0x40]
Primary block-device name.
Definition iofilemgr.h:189
SceUID pid
Definition iofilemgr.h:57
SceUInt32 padding
Alignment padding; ignored on FW 3.60.
Definition iofilemgr.h:238
const void * data
Definition iofilemgr.h:261
void * mount_cc
Internal mount cache-control object.
Definition iofilemgr.h:181
SceUInt32 fd_lock_waiter_count
Number of threads waiting for the file-descriptor lock.
Definition iofilemgr.h:180
int ksceIoGetFileInfo(SceUID fd, SceUID pid, SceIofileInfo *info)
Get file info.
char path2[0x400]
Definition iofilemgr.h:56
int ksceIoDeleteErrorEvent(SceUID event_uid)
Delete an I/O error event by kernel GUID.
int data_0x818
Definition iofilemgr.h:63
char unix_mount_path[0x400]
Internal Unix mount path.
Definition iofilemgr.h:186
char assign_name[0x20]
Assigned Vita device name.
Definition iofilemgr.h:161
const SceIoStat * stat
Definition iofilemgr.h:199
SceVfsMount * mount_copy
Same pointer as SceIoMountInfo::mnt.
Definition iofilemgr.h:166
SceUID fd
Definition iofilemgr.h:21
int vsh_mount_id
One of SceVshMountId, or -1 for a PFS mount.
Definition iofilemgr.h:144
int ksceIoMount(int id, const char *path, int permission, int a4, int a5, int a6)
Mounts a device.
SceIoMountEvent
Event bits accepted by ksceIoCreateMountEvent.
Definition iofilemgr.h:122
SceBool is_pfs_mount
Nonzero when the mount uses PFS_GDSD_INF.
Definition iofilemgr.h:147
SceUID vfsAllocateFileDummy(int flags, SceBool is_dir, const char *name)
Allocate a dummy internal VFS file object named name.
SceUID fd
Definition iofilemgr.h:253
int ksceIoGetThreadDefaultPriorityForSystem(void)
Return the current thread's default I/O priority using the system-priority view.
SceUID mount_cc_event_flag
Cache-control event-flag UID.
Definition iofilemgr.h:184
char block_device_secondary[0x40]
Secondary block-device name.
Definition iofilemgr.h:190
SceVfsMount * mnt
Internal VFS mount.
Definition iofilemgr.h:159
SceUID ksceIoOpenForPid(ScePID pid, const char *filename, int flags, SceMode mode)
Open a path after resolving overlays in another process's namespace.
SceSize size
Definition iofilemgr.h:246
SceSize inlen
Size of SceVfsIoctlArgs::indata.
Definition iofilemgr.h:221
void * outdata
Output buffer.
Definition iofilemgr.h:222
SceUInt32 dev_major
Internal device-major value.
Definition iofilemgr.h:165
SceSize size
Definition iofilemgr.h:262
SceSSize vfsWrite(SceVfsWriteArgs *args)
Write to a file before returning.
SceUID fd
Definition iofilemgr.h:206
int() SceIoPathMappingFunc(const char *path, ScePID pid, char *mapped_path, SceSize mapped_path_size)
Path-mapping callback installed by ksceIoSetPathMappingFunction.
Definition iofilemgr.h:195
SceUInt32 mount_cc_dirty
Cache-control dirty value.
Definition iofilemgr.h:182
SceUInt32 vnode_count
Number of vnodes belonging to the mount.
Definition iofilemgr.h:170
char path[0x400]
Definition iofilemgr.h:55
SceUID fd
Definition iofilemgr.h:260
SceUID fd_lock_cond
File-descriptor lock condition-variable UID.
Definition iofilemgr.h:178
int data_0x808
Definition iofilemgr.h:59
int ksceIoGetMediaType(ScePID pid, const char *path, int ignored, SceUInt32 *media_type)
Get the media type for a path.
int data_0x814
Definition iofilemgr.h:62
void * data
Definition iofilemgr.h:254
void * data
Definition iofilemgr.h:236
int ksceIoClearErrorEvent(SceUID event_uid)
Clear an error event's one-shot notification latch.
int data_0x824
Definition iofilemgr.h:66
SceUInt32 dev_minor
Internal device-minor value.
Definition iofilemgr.h:164
SceSize size
Definition iofilemgr.h:255
int ksceIoDreadForVshbridge(SceUID fd, SceIoDirent *dir)
Read a directory entry for VshBridge, preserving SceIoStat::st_attr.
int ksceIoSetPathMappingFunction(SceIoPathMappingFunc *func)
Install or remove the process-path mapping callback.
int vfsChstat(SceVfsChstatArgs *args)
Change file status through VFS before returning.
SceVfsMount * mounted_on_list_prev
Previous entry in the mounted-on list.
Definition iofilemgr.h:173
SceUID fd
Definition iofilemgr.h:213
char assign_name[0x20]
Assigned Vita device name, such as ux0:.
Definition iofilemgr.h:145
SceUID fd
Definition iofilemgr.h:218
SceUInt32 cbit
Bitwise OR of SCE_CST_* values.
Definition iofilemgr.h:208
void * implementation_data
Mount data specific to the filesystem implementation.
Definition iofilemgr.h:175
int vfsGetMntList(SceIoMount *mounts, SceSize capacity, SceSize *count)
List mounted filesystems.
SceUInt32 fd_lock_operation_state
File-descriptor lock operation state.
Definition iofilemgr.h:179
SceUInt32 reserved1[2]
Must be zero when creating the event.
Definition iofilemgr.h:275
int data_0x820
Definition iofilemgr.h:65
const void * indata
Input buffer.
Definition iofilemgr.h:220
SceVfsMountData ** mount_data_address
Address of the mount-data pointer.
Definition iofilemgr.h:185
int data_0x810
Definition iofilemgr.h:61
int flags
Bitwise OR of SceIoMode values.
Definition iofilemgr.h:229
SceUID fd
Definition iofilemgr.h:244
int ksceIoGetstatForVshbridge(const char *name, SceIoStat *stat)
Get file status for VshBridge, preserving SceIoStat::st_attr.
SceUID fd
Definition iofilemgr.h:235
int cmd
Definition iofilemgr.h:219
SceUInt32 state
Internal mount state.
Definition iofilemgr.h:163
int ksceIoUmount(int id, int a2, int a3, int a4)
Unmounts a device.
int error_code
I/O error code.
Definition iofilemgr.h:274
SceUInt32 open_entry_count
Number of open entries on the mount.
Definition iofilemgr.h:146
int error_detail
Additional error value supplied by the I/O subsystem.
Definition iofilemgr.h:276
SceVfsMountData * mount_data
Structure containing mount names and the VSH mount ID.
Definition iofilemgr.h:187
int ksceIoChstatForVshbridge(const char *name, const SceIoStat *stat, unsigned int cbit)
Change file status for VshBridge, allowing the internal attribute-change bit.
int ksceIoSyncByFd2(SceUID fd, int flags)
Synchronize a file descriptor.
char filesystem[0x40]
Filesystem implementation name.
Definition iofilemgr.h:188
SceSSize vfsPread(SceVfsPreadArgs *args)
Read at the specified file offset before returning.
SceOff offset
Definition iofilemgr.h:248
SceUInt32 padding
Alignment padding; ignored on FW 3.60.
Definition iofilemgr.h:247
SceUID pool_uid
Mount allocator UID.
Definition iofilemgr.h:168
SceIoErrorEvent
Event bits accepted by ksceIoCreateErrorEvent.
Definition iofilemgr.h:132
SceUInt32 open_entry_count
Number of open entries on the mount.
Definition iofilemgr.h:162
SceOff offset
Definition iofilemgr.h:239
SceUID vfsOpen(SceVfsOpenArgs *args)
Open a file through VFS before returning.
SceUInt32 mount_cc_flag
Value referenced by the cache-control flag pointer.
Definition iofilemgr.h:183
int ksceIoGetRemoteKPLSData(SceUID pid, void *dst)
Get Remote Kernel Process Local Storage Data.
SceUID ksceIoCreateMountEvent(int vsh_mount_id, SceUInt32 event_bits)
Create a mount event.
void * implementation_data
Mount data specific to the filesystem implementation.
Definition iofilemgr.h:148
const char * filename
Definition iofilemgr.h:228
@ SCE_IO_MOUNT_EVENT_MOUNT_FAILED
A VFS mount operation failed.
Definition iofilemgr.h:125
@ SCE_IO_MOUNT_EVENT_UNMOUNTED
A VFS unmount operation succeeded.
Definition iofilemgr.h:124
@ SCE_IO_MOUNT_EVENT_MOUNTED
A VFS mount operation succeeded.
Definition iofilemgr.h:123
@ SCE_IO_MOUNT_EVENT_DEVICE_DETACHED
The mount's backing device was detached.
Definition iofilemgr.h:128
@ SCE_IO_MOUNT_EVENT_UNMOUNT_FAILED
A VFS unmount operation failed.
Definition iofilemgr.h:126
@ SCE_IO_MOUNT_EVENT_DEVICE_ATTACHED
The mount's backing device was attached.
Definition iofilemgr.h:127
@ SCE_IO_ERROR_EVENT_OCCURRED
Definition iofilemgr.h:133
Describes a single directory entry.
Definition iofilemgr.h:147
Result block in user memory, owned by the caller, for ksceIoCreateErrorEvent.
Definition iofilemgr.h:272
Definition iofilemgr.h:20
One entry returned by vfsGetMntList.
Definition iofilemgr.h:142
FW 3.60 snapshot returned by vfsGetMntInfo.
Definition iofilemgr.h:158
Structure to hold the status information about a file.
Definition iofilemgr.h:127
Definition iofilemgr.h:54
Definition iofilemgr.h:197
Definition iofilemgr.h:205
Definition iofilemgr.h:212
Definition iofilemgr.h:217
Definition iofilemgr.h:227
Definition iofilemgr.h:234
Definition iofilemgr.h:243
Definition iofilemgr.h:252
Definition iofilemgr.h:259
int flags
Event flags.
Definition debug.h:3
SceUID pid
Definition debug.h:1
signed int SceSSize
Definition types.h:57
int ScePID
Process ID.
Definition types.h:91
int SceBool
Definition types.h:59
unsigned int SceSize
Definition types.h:56
int SceUID
UIDs are used to describe many different kernel objects.
Definition types.h:90
uint32_t SceUInt32
Definition types.h:45
SceInt64 SceOff
Offset type.
Definition types.h:88
int SceMode
Mode for I/O functions.
Definition types.h:87
Definition vfs.h:100
Mountpoint Data.
Definition vfs.h:65
VFS Vnode.
Definition vfs.h:168