diff options
author | Princess of Sleeping | 2020-09-23 14:04:07 +0900 |
---|---|---|
committer | Reiko Asakura | 2020-09-23 14:04:07 +0900 |
commit | 021e1ddf1f2e77930f14cef64e8f7955892eb329 (patch) | |
tree | b4758e968db32a7f9c93d5d9178bfa09f0c938fe /include/kernel | |
parent | Move functions to correct library (diff) | |
download | vds-libraries-021e1ddf1f2e77930f14cef64e8f7955892eb329.tar.gz |
Add SceFios2Kernel
https://github.com/DolceSDK/headers/pull/11
Diffstat (limited to 'include/kernel')
-rw-r--r-- | include/kernel/fios2.h | 88 |
1 files changed, 88 insertions, 0 deletions
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 <psp2kern/types.h> + +#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_ */ |