vitasdk
Documentation of the vitasdk

Exports for Kernel. More...

Data Structures

struct  SceFiosOverlay
 File-system overlay configuration and returned state. More...
 

Macros

#define SCE_FIOS2_OVERLAY_PATH_SIZE   (292)
 
#define SCE_FIOS2_OVERLAY_PATH_MAX_LENGTH   (SCE_FIOS2_OVERLAY_PATH_SIZE - 1)
 

Typedefs

typedef int32_t SceFiosOverlayID
 

Enumerations

enum  SceFiosOverlayType { SCE_FIOS_OVERLAY_TYPE_OPAQUE = 0 , SCE_FIOS_OVERLAY_TYPE_TRANSLUCENT = 1 , SCE_FIOS_OVERLAY_TYPE_NEWER = 2 , SCE_FIOS_OVERLAY_TYPE_WRITABLE = 3 }
 

Functions

 VITASDK_BUILD_ASSERT_EQ (4, SceFiosOverlayID)
 
 VITASDK_BUILD_ASSERT_EQ (0x258, SceFiosOverlay)
 
int ksceFiosKernelOverlayAdd (SceFiosOverlay *overlay, SceFiosOverlayID *outID)
 Overlay process file system overlay.
 
int ksceFiosKernelOverlayAddForProcess (SceUID pid, SceFiosOverlay *overlay, SceFiosOverlayID *outID)
 Overlay process file system overlay.
 
int ksceFiosKernelOverlayRemoveForProcess (SceUID pid, SceFiosOverlayID id)
 Remove process file system overlay.
 
int ksceFiosKernelOverlayResolveSync (SceUID pid, int resolveForWrite, const char *inPath, char *outPath, SceSize maxPath)
 Resolves a path synchronously through a process's overlays.
 
int ksceFiosKernelOverlayGetInfo (SceFiosOverlayID id, SceFiosOverlay *out_overlay)
 Gets an overlay from the calling process's table.
 
int ksceFiosKernelOverlayGetInfoForProcess (SceUID pid, SceFiosOverlayID id, SceFiosOverlay *out_overlay)
 Gets an overlay from a process's table.
 
int ksceFiosKernelOverlayGetList (SceUID pid, SceUInt8 min_order, SceUInt8 max_order, SceFiosOverlayID *out_ids, SceSize max_ids, SceSize *actual_ids)
 Gets the IDs of overlays whose order is from min_order through max_order, inclusive.
 
int ksceFiosKernelOverlayGetRecommendedScheduler (int scheduler_count, const char *partially_resolved_path)
 Gets the recommended scheduler index for a partially resolved path.
 
int ksceFiosKernelOverlayModify (SceFiosOverlayID id, const SceFiosOverlay *new_value)
 Replaces an overlay in the calling process's table.
 
int ksceFiosKernelOverlayModifyForProcess (SceUID pid, SceFiosOverlayID id, const SceFiosOverlay *new_value)
 Replaces an overlay in a process's table.
 
int ksceFiosKernelOverlayRemove (SceFiosOverlayID id)
 Removes an overlay synchronously from the calling process's table.
 
int ksceFiosKernelOverlayResolveWithRangeSync (SceUID pid, int resolve_for_write, const char *in_path, char *out_path, SceSize max_path, SceUInt8 min_order, SceUInt8 max_order)
 Resolves a path through overlays whose order is from min_order through max_order, inclusive.
 
int ksceFiosKernelOverlayThreadIsDisabled (void)
 Returns whether application overlays are disabled for the current thread.
 
int ksceFiosKernelOverlayThreadSetDisabled (int disabled)
 Enables or disables application overlays for the current thread.
 

Variables

uint8_t SceFiosOverlay::type
 One of SceFiosOverlayType.
 
uint8_t SceFiosOverlay::order
 Resolution order. Lower values are evaluated first; 0x00-0x7F are application orders and 0x80-0xFF are reserved for privileged overlays.
 
uint16_t SceFiosOverlay::dst_len
 Destination-path length computed by FIOS2.
 
uint16_t SceFiosOverlay::src_len
 Source-path length computed by FIOS2.
 
uint16_t SceFiosOverlay::unk2
 
SceUID SceFiosOverlay::pid
 Target process ID. Used by ksceFiosKernelOverlayAdd and overwritten by functions that take a process ID argument.
 
SceFiosOverlayID SceFiosOverlay::id
 Overlay ID assigned by FIOS2; ignored when adding an overlay.
 
char SceFiosOverlay::dst [SCE_FIOS2_OVERLAY_PATH_SIZE]
 Destination-path prefix matched during resolution.
 
char SceFiosOverlay::src [SCE_FIOS2_OVERLAY_PATH_SIZE]
 Source-path prefix substituted according to SceFiosOverlayType.
 

Detailed Description

Exports for Kernel.


Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceFios2KernelForDriver_stub




Data Structure Documentation

◆ SceFiosOverlay

struct SceFiosOverlay

File-system overlay configuration and returned state.

When adding or modifying an overlay, FIOS2 copies the structure before the function returns. Keep the structure valid until then; you may reuse or free it afterwards. Supply type, order, dst, and src; FIOS2 normalizes the paths and fills in the other fields. A per-process overlay remains installed until it is removed or the process exits.

Data Fields
uint8_t type One of SceFiosOverlayType.
uint8_t order Resolution order. Lower values are evaluated first; 0x00-0x7F are application orders and 0x80-0xFF are reserved for privileged overlays.
uint16_t dst_len Destination-path length computed by FIOS2.
uint16_t src_len Source-path length computed by FIOS2.
uint16_t unk2
SceUID pid Target process ID. Used by ksceFiosKernelOverlayAdd and overwritten by functions that take a process ID argument.
SceFiosOverlayID id Overlay ID assigned by FIOS2; ignored when adding an overlay.
char dst[SCE_FIOS2_OVERLAY_PATH_SIZE] Destination-path prefix matched during resolution.
char src[SCE_FIOS2_OVERLAY_PATH_SIZE] Source-path prefix substituted according to SceFiosOverlayType.

Macro Definition Documentation

◆ SCE_FIOS2_OVERLAY_PATH_SIZE

#define SCE_FIOS2_OVERLAY_PATH_SIZE   (292)

◆ SCE_FIOS2_OVERLAY_PATH_MAX_LENGTH

#define SCE_FIOS2_OVERLAY_PATH_MAX_LENGTH   (SCE_FIOS2_OVERLAY_PATH_SIZE - 1)

Typedef Documentation

◆ SceFiosOverlayID

typedef int32_t SceFiosOverlayID

Enumeration Type Documentation

◆ SceFiosOverlayType

Enumerator
SCE_FIOS_OVERLAY_TYPE_OPAQUE 

Always replace the matching destination path with the source path.

SCE_FIOS_OVERLAY_TYPE_TRANSLUCENT 

Use the source path when it exists, otherwise use the destination path.

SCE_FIOS_OVERLAY_TYPE_NEWER 

Use the source path when it is newer or the destination is missing; otherwise use the destination path.

SCE_FIOS_OVERLAY_TYPE_WRITABLE 

Reads prefer an existing source path and writes always use the source path.

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ() [1/2]

VITASDK_BUILD_ASSERT_EQ ( 4  ,
SceFiosOverlayID   
)

◆ VITASDK_BUILD_ASSERT_EQ() [2/2]

VITASDK_BUILD_ASSERT_EQ ( 0x258  ,
SceFiosOverlay   
)

◆ ksceFiosKernelOverlayAdd()

int ksceFiosKernelOverlayAdd ( SceFiosOverlay *  overlay,
SceFiosOverlayID *  outID 
)

Overlay process file system overlay.

Parameters
[in]overlay- Overlay config pointer
[out]outID- outID pointer
Returns
Error code or zero on success

◆ ksceFiosKernelOverlayAddForProcess()

int ksceFiosKernelOverlayAddForProcess ( SceUID  pid,
SceFiosOverlay *  overlay,
SceFiosOverlayID *  outID 
)

Overlay process file system overlay.

Parameters
[in]pid- Process id
[in]overlay- Overlay config pointer
[out]outID- outID pointer
Returns
Error code or zero on success

◆ ksceFiosKernelOverlayRemoveForProcess()

int ksceFiosKernelOverlayRemoveForProcess ( SceUID  pid,
SceFiosOverlayID  id 
)

Remove process file system overlay.

Parameters
[in]pid- Process id
[in]id- Overlay id
Returns
Error code or zero on success

◆ ksceFiosKernelOverlayResolveSync()

int ksceFiosKernelOverlayResolveSync ( SceUID  pid,
int  resolveForWrite,
const char *  inPath,
char *  outPath,
SceSize  maxPath 
)

Resolves a path synchronously through a process's overlays.

maxPath must be from 1 through 0x400, inclusive. The input's NUL terminator must fall within that many bytes, and outPath must provide at least maxPath bytes. When application overlays are disabled for the current thread, orders below 0x80 are skipped.

Parameters
[in]pid- Process whose overlays are used.
[in]resolveForWrite- Must be 0 for read resolution or 1 for write resolution.
[in]inPath- Path to resolve.
[out]outPath- Resolved path output buffer.
[in]maxPath- Input and output path limit.
Returns
0 on success, or a negative error code.

◆ ksceFiosKernelOverlayGetInfo()

int ksceFiosKernelOverlayGetInfo ( SceFiosOverlayID  id,
SceFiosOverlay *  out_overlay 
)

Gets an overlay from the calling process's table.

Parameters
[in]id- Overlay identifier.
[out]out_overlay- Receives a copy of the complete overlay.
Returns
0 on success, or a negative error code.

◆ ksceFiosKernelOverlayGetInfoForProcess()

int ksceFiosKernelOverlayGetInfoForProcess ( SceUID  pid,
SceFiosOverlayID  id,
SceFiosOverlay *  out_overlay 
)

Gets an overlay from a process's table.

Copies the complete 0x258-byte overlay to out_overlay. The output buffer must remain valid until this function returns; it is not used afterwards. Access to another process's table requires the appropriate privileges.

Parameters
[in]pid- Process whose overlay table is queried.
[in]id- Overlay identifier.
[out]out_overlay- Receives the overlay information.
Returns
0 on success, or a negative error code.

◆ ksceFiosKernelOverlayGetList()

int ksceFiosKernelOverlayGetList ( SceUID  pid,
SceUInt8  min_order,
SceUInt8  max_order,
SceFiosOverlayID *  out_ids,
SceSize  max_ids,
SceSize *  actual_ids 
)

Gets the IDs of overlays whose order is from min_order through max_order, inclusive.

Parameters
[in]pid- Process whose overlays are enumerated.
[in]min_order- Minimum value of an overlay's order field to include.
[in]max_order- Maximum value of an overlay's order field to include.
[out]out_ids- Overlay ID output buffer, or NULL when max_ids is zero.
[in]max_ids- Maximum number of overlay IDs to write.
[out]actual_ids- Optional pointer receiving the total number of matching overlays, including those beyond max_ids.
Returns
0 on success, or an error code.

◆ ksceFiosKernelOverlayGetRecommendedScheduler()

int ksceFiosKernelOverlayGetRecommendedScheduler ( int  scheduler_count,
const char *  partially_resolved_path 
)

Gets the recommended scheduler index for a partially resolved path.

Parameters
[in]scheduler_count- Number of available schedulers.
[in]partially_resolved_path- Optional partially resolved path.
Returns
1 for a host[0-9]: path when scheduler_count is greater than 1, otherwise 0.

◆ ksceFiosKernelOverlayModify()

int ksceFiosKernelOverlayModify ( SceFiosOverlayID  id,
const SceFiosOverlay *  new_value 
)

Replaces an overlay in the calling process's table.

Validates and copies new_value before returning. Keeps the process and overlay IDs and recalculates both path lengths.

Parameters
[in]id- Overlay identifier.
[in]new_value- Replacement overlay configuration.
Returns
0 on success, or a negative error code.

◆ ksceFiosKernelOverlayModifyForProcess()

int ksceFiosKernelOverlayModifyForProcess ( SceUID  pid,
SceFiosOverlayID  id,
const SceFiosOverlay *  new_value 
)

Replaces an overlay in a process's table.

Copies new_value before returning. Keep it valid until this function returns; it is not used afterwards. Access to another process's table requires the appropriate privileges.

Parameters
[in]pid- Process whose overlay is replaced.
[in]id- Overlay identifier.
[in]new_value- Replacement overlay configuration.
Returns
0 on success, or a negative error code.

◆ ksceFiosKernelOverlayRemove()

int ksceFiosKernelOverlayRemove ( SceFiosOverlayID  id)

Removes an overlay synchronously from the calling process's table.

Returns
0 on success, or a negative error code.

◆ ksceFiosKernelOverlayResolveWithRangeSync()

int ksceFiosKernelOverlayResolveWithRangeSync ( SceUID  pid,
int  resolve_for_write,
const char *  in_path,
char *  out_path,
SceSize  max_path,
SceUInt8  min_order,
SceUInt8  max_order 
)

Resolves a path through overlays whose order is from min_order through max_order, inclusive.

max_path must be from 1 through 0x400, inclusive. The input's NUL terminator must fall within that many bytes, and out_path must provide at least max_path bytes. If application overlays are disabled for the current thread, the supplied min_order is replaced with 0x80.

Parameters
[in]pid- Process whose overlays are used.
[in]resolve_for_write- Must be 0 for read resolution or 1 for write resolution.
[in]in_path- Path to resolve.
[out]out_path- Resolved path output buffer.
[in]max_path- Output buffer size.
[in]min_order- Minimum value of an overlay's order field to include.
[in]max_order- Maximum value of an overlay's order field to include.
Returns
0 on success, or an error code.

◆ ksceFiosKernelOverlayThreadIsDisabled()

int ksceFiosKernelOverlayThreadIsDisabled ( void  )

Returns whether application overlays are disabled for the current thread.

A nonzero state skips orders 0x00 through 0x7F. Privileged overlays with orders 0x80 through 0xFF remain active.

Returns
0 or 1.

◆ ksceFiosKernelOverlayThreadSetDisabled()

int ksceFiosKernelOverlayThreadSetDisabled ( int  disabled)

Enables or disables application overlays for the current thread.

Any nonzero value skips orders 0x00 through 0x7F until this function is called with zero or the thread exits. Privileged orders 0x80 through 0xFF remain active.

Parameters
[in]disabled- Zero to enable application overlays, or any nonzero value to disable them.
Returns
0 on success, or -1 if the thread-local state is unavailable.

Variable Documentation

◆ type

uint8_t SceFiosOverlay::type

◆ order

uint8_t SceFiosOverlay::order

Resolution order. Lower values are evaluated first; 0x00-0x7F are application orders and 0x80-0xFF are reserved for privileged overlays.

◆ dst_len

uint16_t SceFiosOverlay::dst_len

Destination-path length computed by FIOS2.

◆ src_len

uint16_t SceFiosOverlay::src_len

Source-path length computed by FIOS2.

◆ unk2

uint16_t SceFiosOverlay::unk2

◆ pid

SceUID SceFiosOverlay::pid

Target process ID. Used by ksceFiosKernelOverlayAdd and overwritten by functions that take a process ID argument.

◆ id

SceFiosOverlayID SceFiosOverlay::id

Overlay ID assigned by FIOS2; ignored when adding an overlay.

◆ dst

char SceFiosOverlay::dst[SCE_FIOS2_OVERLAY_PATH_SIZE]

Destination-path prefix matched during resolution.

◆ src

char SceFiosOverlay::src[SCE_FIOS2_OVERLAY_PATH_SIZE]

Source-path prefix substituted according to SceFiosOverlayType.