From 021e1ddf1f2e77930f14cef64e8f7955892eb329 Mon Sep 17 00:00:00 2001 From: Princess of Sleeping Date: Wed, 23 Sep 2020 14:04:07 +0900 Subject: Add SceFios2Kernel https://github.com/DolceSDK/headers/pull/11--- include/kernel/fios2.h | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 include/kernel/fios2.h (limited to 'include') diff --git a/include/kernel/fios2.h b/include/kernel/fios2.h new file mode 100644 index 0000000..6c9c15e --- /dev/null +++ b/include/kernel/fios2.h @@ -0,0 +1,88 @@ +#ifndef _PSP2_KERNEL_FIOS2KERNEL_H_ +#define _PSP2_KERNEL_FIOS2KERNEL_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int32_t SceFiosOverlayID; + +typedef enum SceFiosOverlayType { + // src replaces dst. All accesses to dst are redirected to src. + SCE_FIOS_OVERLAY_TYPE_OPAQUE = 0, + + // src merges with dst. Reads check src first, then dst. Writes go to dst. + SCE_FIOS_OVERLAY_TYPE_TRANSLUCENT = 1, + + // src merges with dst. Reads check both src and dst, and use whichever has the most recent modification time. + // If both src and dst have the same modification time, dst is used. + // If no file exists at src or dst, dst is used; if no file exists at dst, but a file exists at src, src is used. Writes go to dst. + SCE_FIOS_OVERLAY_TYPE_NEWER = 2, + + // src merges with dst. Reads check src first, then dst. Writes go to src. + SCE_FIOS_OVERLAY_TYPE_WRITABLE = 3 +} SceFiosOverlayType; + +typedef struct SceFiosOverlay { + uint8_t type; // see SceFiosOverlayType + uint8_t order; + uint16_t dst_len; + uint16_t src_len; + uint16_t unk2; + SceUID pid; + SceFiosOverlayID id; + char dst[292]; + char src[292]; // src path replaces dst path based on type policy +} SceFiosOverlay; + +/** + * Overlay process file system overlay + * + * @param[in] overlay - Overlay config pointer + * @param[out] outID - outID pointer + * + * @return Error code or zero on success + */ +int sceFiosKernelOverlayAdd(SceFiosOverlay *overlay, SceFiosOverlayID *outID); + +/** + * Overlay process file system overlay + * + * @param[in] pid - Process id + * @param[in] overlay - Overlay config pointer + * @param[out] outID - outID pointer + * + * @return Error code or zero on success + */ +int sceFiosKernelOverlayAddForProcess(SceUID pid, SceFiosOverlay *overlay, SceFiosOverlayID *outID); + +/** + * Remove process file system overlay + * + * @param[in] pid - Process id + * @param[in] id - Overlay id + * + * @return Error code or zero on success + */ +int sceFiosKernelOverlayRemoveForProcess(SceUID pid, SceFiosOverlayID id); + +/** + * Resolve process file system overlay with sync + * + * @param[in] pid - Process id + * @param[in] resolveFlag - Some flags + * @param[in] inPath - Path input + * @param[out] outPath - Path output + * @param[in] maxPath - Path output max length + * + * @return Error code or zero on success + */ +int sceFiosKernelOverlayResolveSync(SceUID pid, int resolveFlag, const char *inPath, char *outPath, SceSize maxPath); + +#ifdef __cplusplus +} +#endif + +#endif /* _PSP2_KERNEL_FIOS2KERNEL_H_ */ -- cgit v1.2.3