vitasdk
Documentation of the vitasdk

Exports for Kernel. More...

Data Structures

struct  SceKernelTimeval
 
struct  SceKernelTimezone
 
struct  SceKernelProcessInfo
 
struct  SceKernelProcessOpt2
 FW 3.60 process-creation options. More...
 

Macros

#define SCE_KERNEL_PROCESS_TYPE_GAME   (0x01000000U)
 
#define SCE_KERNEL_PROCESS_TYPE_MINI_APPLICATION   (0x02000000U)
 
#define SCE_KERNEL_PROCESS_TYPE_SYSTEM_APPLICATION   (0x04000000U)
 
#define SCE_KERNEL_PROCESS_TYPE_KERNEL   (0x05000000U)
 Used by the kernel process object; rejected by the FW 3.60 create/spawn APIs.
 
#define SCE_KERNEL_PROCESS_START_FLAG_DEBUG   (0x80000000U)
 Requests a debug-suspended start; OR into the type passed to a spawn function.
 
#define SCE_KERNEL_PROCESS_CURRENT_PROCESS_BUDGET   (0)
 Select the calling process's built-in game or system-application budget.
 
#define SCE_KERNEL_PROCESS_FULL_GAME_PROCESS_BUDGET   (2)
 Select the built-in full-game process budget.
 
#define SCE_KERNEL_PROCESS_SYSTEM_APPLICATION_PROCESS_BUDGET   (3)
 Select the built-in system-application process budget.
 

Typedefs

typedef SceUInt32 SceKernelProcessType
 
typedef SceUInt64 SceKernelClock
 
typedef SceUInt32 SceKernelTime
 
typedef struct SceUIDProcessObject SceUIDProcessObject
 
typedef SceUInt32 SceKernelProcessType
 

Enumerations

enum  SceKernelProcessPrioritySystem { SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_HIGH = 32 , SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_DEFAULT = 96 , SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_LOW = 159 , __SCE_KERNEL_PROCESS_PRIORITY_SYSTEM = 0xFFFFFFFF }
 
enum  SceKernelProcessPriorityUser { SCE_KERNEL_PROCESS_PRIORITY_USER_HIGH = 64 , SCE_KERNEL_PROCESS_PRIORITY_USER_DEFAULT = 96 , SCE_KERNEL_PROCESS_PRIORITY_USER_LOW = 127 , __SCE_KERNEL_PROCESS_PRIORITY_USER = 0xFFFFFFFF }
 
enum  SceKernelPowerTickType {
  SCE_KERNEL_POWER_TICK_DEFAULT = 0 , SCE_KERNEL_POWER_TICK_DISABLE_AUTO_SUSPEND = 1 , SCE_KERNEL_POWER_TICK_DISABLE_OLED_OFF = 4 , SCE_KERNEL_POWER_TICK_DISABLE_OLED_DIMMING = 6 ,
  __SCE_KERNEL_POWER_TICK_DISABLE = 0xFFFFFFFF
}
 
enum  SceKernelProcessOptAttribute {
  SCE_KERNEL_PROCESS_OPT_ATTR_CPU_AFFINITY_MASK = 0x00001000 , SCE_KERNEL_PROCESS_OPT_ATTR_BUDGET_ID = 0x00004000 , SCE_KERNEL_PROCESS_OPT_ATTR_PARENT_PROCESS_ID = 0x00010000 , SCE_KERNEL_PROCESS_OPT_ATTR_PROCESS_EXIT_SPAWN = 0x00020000 ,
  SCE_KERNEL_PROCESS_OPT_ATTR_KLICENSEE = 0x00040000 , SCE_KERNEL_PROCESS_OPT_ATTR_MAX_OPEN_FILES = 0x00080000 , SCE_KERNEL_PROCESS_OPT_ATTR_MAX_DIRECTORY_OPEN_LEVEL = 0x00100000 , SCE_KERNEL_PROCESS_OPT_ATTR_UNIQUE_HEAP_SIZE = 0x00200000 ,
  SCE_KERNEL_PROCESS_OPT_ATTR_DISPLAY_RESOLUTION_FLAGS = 0x00800000 , SCE_KERNEL_PROCESS_OPT_ATTR_POWER_CONFIGURATION_FLAGS = 0x01000000 , SCE_KERNEL_PROCESS_OPT_ATTR_INITIAL_PRIORITY = 0x10000000 , SCE_KERNEL_PROCESS_OPT_ATTR_STACK_SIZE = 0x20000000 ,
  SCE_KERNEL_PROCESS_OPT_ATTR_REPORT_LOAD_PROGRESS = 0x40000000 , SCE_KERNEL_PROCESS_OPT_ATTR_SUPPRESS_START_NOTIFICATIONS = 0x80000000
}
 Known option bits used in SceKernelProcessOpt2::attr on FW 3.60. More...
 
enum  SceKernelProcessExitSpawnMode { SCE_KERNEL_PROCESS_EXIT_SPAWN_MODE_NORMAL = 0 , SCE_KERNEL_PROCESS_EXIT_SPAWN_MODE_ENABLED = 1 }
 Process-object handling mode selected during process creation. More...
 

Functions

 VITASDK_BUILD_ASSERT_EQ (8, SceKernelTimeval)
 
 VITASDK_BUILD_ASSERT_EQ (8, SceKernelTimezone)
 
 VITASDK_BUILD_ASSERT_EQ (4, SceKernelProcessPrioritySystem)
 
 VITASDK_BUILD_ASSERT_EQ (4, SceKernelProcessPriorityUser)
 
 VITASDK_BUILD_ASSERT_EQ (4, SceKernelPowerTickType)
 
 VITASDK_BUILD_ASSERT_EQ (0xE8, SceKernelProcessInfo)
 
void * ksceKernelGetProcessKernelBuf (SceUID pid)
 Previous VitaSDK name and prototype for ksceKernelUIDtoProcess.
 
SceUIDProcessObject * ksceKernelUIDtoProcess (ScePID pid)
 Resolves a process ID to its internal process object without acquiring a reference.
 
int ksceKernelGetProcessInfo (SceUID pid, SceKernelProcessInfo *info)
 
int ksceKernelCreateProcessLocalStorage (const char *name, SceSize size)
 
void * ksceKernelGetProcessLocalStorageAddr (int key)
 
int ksceKernelGetProcessLocalStorageAddrForPid (SceUID pid, int key, void **out_addr, int create_if_doesnt_exist)
 
 VITASDK_BUILD_ASSERT_EQ (4, SceKernelProcessType)
 
 VITASDK_BUILD_ASSERT_EQ (0x40, SceKernelProcessOpt2)
 
ScePID ksceKernelCreateProcess (const char *name, SceKernelProcessType type, const char *path, void *opt)
 Create a dormant process.
 
int ksceKernelResumeProcess (SceUID pid)
 Resume a suspended process.
 
int ksceKernelSuspendProcess (SceUID pid, int status)
 Suspend a running process.
 
int ksceKernelGetProcessStatus (SceUID pid, int *status)
 Get the status of a given process.
 
SceUID ksceKernelGetProcessMainThread (SceUID pid)
 Get the main thread for a given process.
 
ScePVoid ksceKernelGetProcessModuleInfo (SceUID pid)
 Get the process module control block.
 
int ksceKernelGetProcessSelfAuthInfo (SceUID pid, SceSelfAuthInfo *self_auth_info)
 Get the process self auth info.
 
int ksceKernelLibcGettimeofday (SceKernelTimeval *tv, SceKernelTimezone *tz)
 
SceKernelTime ksceKernelLibcTime (SceKernelTime *tloc)
 
int ksceKernelExitProcess (int status)
 
SceClass * ksceKernelGetUIDProcessClass (void)
 
int ksceKernelGetProcessTimeCore (SceKernelSysClock *time)
 Gets the current process's elapsed time in microseconds.
 
SceUInt32 ksceKernelGetProcessTimeLowCore (void)
 Returns the wrapping low 32 bits of the current process's elapsed time in microseconds.
 
int ksceKernelGetRemoteProcessTime (ScePID pid, SceKernelSysClock *time)
 Gets a process's running elapsed time or stored final time in microseconds.
 
SceBool ksceKernelIsCDialogAvailable (void)
 Tests whether the current process budget reserves common-dialog memory.
 
int ksceKernelKillProcess (ScePID pid, SceInt32 option)
 Requests process termination.
 
ScePID ksceKernelSpawnProcess (const char *name, SceKernelProcessType type, const char *path, SceSize arg_size, const void *arg_block, const SceKernelProcessOpt2 *opt)
 Creates and starts a process.
 
ScePID ksceKernelSpawnProcessExt (const char *name, SceKernelProcessType type, const char *path, SceSize arg_size, const void *arg_block, const SceKernelProcessOpt2 *opt, SceUInt32 preload_flags)
 Extended form of ksceKernelSpawnProcess.
 
int ksceKernelStartProcess (ScePID pid, SceUInt32 start_flags, SceSize arg_size, const void *arg_block)
 Starts a dormant process.
 
int ksceKernelStartProcessExt (ScePID pid, SceUInt32 start_flags, SceSize arg_size, const void *arg_block, SceUInt32 preload_flags)
 Extended form of ksceKernelStartProcess.
 

Variables

SceInt32 SceKernelTimeval::sec
 
SceInt32 SceKernelTimeval::usec
 
SceUInt64 SceKernelTimezone::value
 
SceSize SceKernelProcessInfo::size
 size of this struct, make sure it's 0xE8
 
SceUID SceKernelProcessInfo::pid
 our process ID
 
int SceKernelProcessInfo::unk1
 
int SceKernelProcessInfo::unk2
 
int SceKernelProcessInfo::unk3
 
SceUID SceKernelProcessInfo::ppid
 parent process ID
 
int SceKernelProcessInfo::unk [0xE8/4 - 6]
 the rest is unknown
 
SceSize SceKernelProcessOpt2::size
 Must be 0x40 on FW 3.60.
 
SceUInt32 SceKernelProcessOpt2::attr
 Bitwise OR of SceKernelProcessOptAttribute values. FW 3.60 does not reject unlisted bits, whose purpose is unknown.
 
SceUInt32 SceKernelProcessOpt2::cpu_affinity_mask
 Four-bit mask in bits 0-3 or bits 16-19; 0 selects the default. Do not combine the two encodings.
 
SceInt32 SceKernelProcessOpt2::init_priority
 Initial main-thread priority when selected; otherwise the process-image value or 0x10000100 is used.
 
SceSize SceKernelProcessOpt2::stack_size
 Main-thread stack size when selected; otherwise the process-image value or 0x40000 is used.
 
SceUInt32 SceKernelProcessOpt2::reserved
 Ignored on FW 3.60.
 
SceUID SceKernelProcessOpt2::budget_id
 Budget selector or process-budget UID; the default selector is SCE_KERNEL_PROCESS_FULL_GAME_PROCESS_BUDGET.
 
ScePID SceKernelProcessOpt2::parent_pid
 Parent process ID; the calling process's ID is used when this field is not selected.
 
SceKernelProcessExitSpawnMode SceKernelProcessOpt2::process_exit_spawn_mode
 Exit-spawn handling mode when selected.
 
ScePID SceKernelProcessOpt2::process_exit_spawn_pid
 Pending exit-spawn PID to reuse in enabled mode; zero allocates a new object.
 
const void * SceKernelProcessOpt2::klicensee
 Pointer to a 16-byte klicensee when selected.
 
SceSize SceKernelProcessOpt2::max_open_files
 Maximum open-file count when selected; default is 64.
 
SceSize SceKernelProcessOpt2::max_directory_open_level
 Maximum directory-open nesting level when selected; default is 10.
 
SceSize SceKernelProcessOpt2::unique_heap_size
 Required and nonzero when selected by attr.
 
SceUInt32 SceKernelProcessOpt2::display_resolution_flags
 Selected value must use only bit 0 for 1280-wide modes and bit 1 for 1440/1920-wide modes.
 
SceUInt32 SceKernelProcessOpt2::power_configuration_flags
 Selected value must fit in two bits; the default queried by ScePower is 3.
 

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:

SceProcessmgrForKernel_stub SceProcessmgrForDriver_stub




Data Structure Documentation

◆ SceKernelTimeval

struct SceKernelTimeval
Data Fields
SceInt32 sec
SceInt32 usec

◆ SceKernelTimezone

struct SceKernelTimezone
Data Fields
SceUInt64 value

◆ SceKernelProcessInfo

struct SceKernelProcessInfo
Data Fields
SceSize size size of this struct, make sure it's 0xE8
SceUID pid our process ID
int unk1
int unk2
int unk3
SceUID ppid parent process ID
int unk[0xE8/4 - 6] the rest is unknown

◆ SceKernelProcessOpt2

struct SceKernelProcessOpt2

FW 3.60 process-creation options.

Data Fields
SceSize size Must be 0x40 on FW 3.60.
SceUInt32 attr Bitwise OR of SceKernelProcessOptAttribute values. FW 3.60 does not reject unlisted bits, whose purpose is unknown.
SceUInt32 cpu_affinity_mask Four-bit mask in bits 0-3 or bits 16-19; 0 selects the default. Do not combine the two encodings.
SceInt32 init_priority Initial main-thread priority when selected; otherwise the process-image value or 0x10000100 is used.
SceSize stack_size Main-thread stack size when selected; otherwise the process-image value or 0x40000 is used.
SceUInt32 reserved Ignored on FW 3.60.
SceUID budget_id Budget selector or process-budget UID; the default selector is SCE_KERNEL_PROCESS_FULL_GAME_PROCESS_BUDGET.
ScePID parent_pid Parent process ID; the calling process's ID is used when this field is not selected.
SceKernelProcessExitSpawnMode process_exit_spawn_mode Exit-spawn handling mode when selected.
ScePID process_exit_spawn_pid Pending exit-spawn PID to reuse in enabled mode; zero allocates a new object.
const void * klicensee Pointer to a 16-byte klicensee when selected.
SceSize max_open_files Maximum open-file count when selected; default is 64.
SceSize max_directory_open_level Maximum directory-open nesting level when selected; default is 10.
SceSize unique_heap_size Required and nonzero when selected by attr.
SceUInt32 display_resolution_flags Selected value must use only bit 0 for 1280-wide modes and bit 1 for 1440/1920-wide modes.
SceUInt32 power_configuration_flags Selected value must fit in two bits; the default queried by ScePower is 3.

Macro Definition Documentation

◆ SCE_KERNEL_PROCESS_TYPE_GAME

#define SCE_KERNEL_PROCESS_TYPE_GAME   (0x01000000U)

◆ SCE_KERNEL_PROCESS_TYPE_MINI_APPLICATION

#define SCE_KERNEL_PROCESS_TYPE_MINI_APPLICATION   (0x02000000U)

◆ SCE_KERNEL_PROCESS_TYPE_SYSTEM_APPLICATION

#define SCE_KERNEL_PROCESS_TYPE_SYSTEM_APPLICATION   (0x04000000U)

◆ SCE_KERNEL_PROCESS_TYPE_KERNEL

#define SCE_KERNEL_PROCESS_TYPE_KERNEL   (0x05000000U)

Used by the kernel process object; rejected by the FW 3.60 create/spawn APIs.

◆ SCE_KERNEL_PROCESS_START_FLAG_DEBUG

#define SCE_KERNEL_PROCESS_START_FLAG_DEBUG   (0x80000000U)

Requests a debug-suspended start; OR into the type passed to a spawn function.

◆ SCE_KERNEL_PROCESS_CURRENT_PROCESS_BUDGET

#define SCE_KERNEL_PROCESS_CURRENT_PROCESS_BUDGET   (0)

Select the calling process's built-in game or system-application budget.

◆ SCE_KERNEL_PROCESS_FULL_GAME_PROCESS_BUDGET

#define SCE_KERNEL_PROCESS_FULL_GAME_PROCESS_BUDGET   (2)

Select the built-in full-game process budget.

◆ SCE_KERNEL_PROCESS_SYSTEM_APPLICATION_PROCESS_BUDGET

#define SCE_KERNEL_PROCESS_SYSTEM_APPLICATION_PROCESS_BUDGET   (3)

Select the built-in system-application process budget.

Typedef Documentation

◆ SceKernelProcessType [1/2]

◆ SceKernelClock

◆ SceKernelTime

◆ SceUIDProcessObject

◆ SceKernelProcessType [2/2]

Enumeration Type Documentation

◆ SceKernelProcessPrioritySystem

Enumerator
SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_HIGH 
SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_DEFAULT 
SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_LOW 
__SCE_KERNEL_PROCESS_PRIORITY_SYSTEM 

◆ SceKernelProcessPriorityUser

Enumerator
SCE_KERNEL_PROCESS_PRIORITY_USER_HIGH 
SCE_KERNEL_PROCESS_PRIORITY_USER_DEFAULT 
SCE_KERNEL_PROCESS_PRIORITY_USER_LOW 
__SCE_KERNEL_PROCESS_PRIORITY_USER 

◆ SceKernelPowerTickType

Enumerator
SCE_KERNEL_POWER_TICK_DEFAULT 

Cancel all timers.

SCE_KERNEL_POWER_TICK_DISABLE_AUTO_SUSPEND 

Cancel automatic suspension timer.

SCE_KERNEL_POWER_TICK_DISABLE_OLED_OFF 

Cancel OLED-off timer.

SCE_KERNEL_POWER_TICK_DISABLE_OLED_DIMMING 

Cancel OLED dimming timer.

__SCE_KERNEL_POWER_TICK_DISABLE 

◆ SceKernelProcessOptAttribute

Known option bits used in SceKernelProcessOpt2::attr on FW 3.60.

Enumerator
SCE_KERNEL_PROCESS_OPT_ATTR_CPU_AFFINITY_MASK 

Use SceKernelProcessOpt2::cpu_affinity_mask.

SCE_KERNEL_PROCESS_OPT_ATTR_BUDGET_ID 

Use SceKernelProcessOpt2::budget_id.

SCE_KERNEL_PROCESS_OPT_ATTR_PARENT_PROCESS_ID 

Use SceKernelProcessOpt2::parent_pid.

SCE_KERNEL_PROCESS_OPT_ATTR_PROCESS_EXIT_SPAWN 

Use the exit-spawn mode and PID.

SCE_KERNEL_PROCESS_OPT_ATTR_KLICENSEE 

Copy the 16-byte klicensee.

SCE_KERNEL_PROCESS_OPT_ATTR_MAX_OPEN_FILES 

Use SceKernelProcessOpt2::max_open_files.

SCE_KERNEL_PROCESS_OPT_ATTR_MAX_DIRECTORY_OPEN_LEVEL 

Use SceKernelProcessOpt2::max_directory_open_level.

SCE_KERNEL_PROCESS_OPT_ATTR_UNIQUE_HEAP_SIZE 

Use SceKernelProcessOpt2::unique_heap_size.

SCE_KERNEL_PROCESS_OPT_ATTR_DISPLAY_RESOLUTION_FLAGS 

Use SceKernelProcessOpt2::display_resolution_flags.

SCE_KERNEL_PROCESS_OPT_ATTR_POWER_CONFIGURATION_FLAGS 

Use SceKernelProcessOpt2::power_configuration_flags.

SCE_KERNEL_PROCESS_OPT_ATTR_INITIAL_PRIORITY 

Use SceKernelProcessOpt2::init_priority instead of the process-image value.

SCE_KERNEL_PROCESS_OPT_ATTR_STACK_SIZE 

Use SceKernelProcessOpt2::stack_size instead of the process-image value.

SCE_KERNEL_PROCESS_OPT_ATTR_REPORT_LOAD_PROGRESS 

Request process-image load-progress reports.

SCE_KERNEL_PROCESS_OPT_ATTR_SUPPRESS_START_NOTIFICATIONS 

Suppress the normal Sysroot process-start notifications.

◆ SceKernelProcessExitSpawnMode

Process-object handling mode selected during process creation.

Enumerator
SCE_KERNEL_PROCESS_EXIT_SPAWN_MODE_NORMAL 

Allocate an ordinary new process object.

SCE_KERNEL_PROCESS_EXIT_SPAWN_MODE_ENABLED 

Enable exit-spawn handling and reuse a matching prepared object when requested.

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ() [1/8]

VITASDK_BUILD_ASSERT_EQ ( 8  ,
SceKernelTimeval   
)

◆ VITASDK_BUILD_ASSERT_EQ() [2/8]

VITASDK_BUILD_ASSERT_EQ ( 8  ,
SceKernelTimezone   
)

◆ VITASDK_BUILD_ASSERT_EQ() [3/8]

VITASDK_BUILD_ASSERT_EQ ( 4  ,
SceKernelProcessPrioritySystem   
)

◆ VITASDK_BUILD_ASSERT_EQ() [4/8]

VITASDK_BUILD_ASSERT_EQ ( 4  ,
SceKernelProcessPriorityUser   
)

◆ VITASDK_BUILD_ASSERT_EQ() [5/8]

VITASDK_BUILD_ASSERT_EQ ( 4  ,
SceKernelPowerTickType   
)

◆ VITASDK_BUILD_ASSERT_EQ() [6/8]

VITASDK_BUILD_ASSERT_EQ ( 0xE8  ,
SceKernelProcessInfo   
)

◆ ksceKernelGetProcessKernelBuf()

void * ksceKernelGetProcessKernelBuf ( SceUID  pid)

Previous VitaSDK name and prototype for ksceKernelUIDtoProcess.

This spelling remains a separately generated stub for backwards compatibility. Its return value is the same borrowed internal process object pointer; new code should use ksceKernelUIDtoProcess.

Parameters
[in]pidProcess ID, or 0 for the calling process.
Returns
Process object pointer, or NULL when the process cannot be resolved.

◆ ksceKernelUIDtoProcess()

SceUIDProcessObject * ksceKernelUIDtoProcess ( ScePID  pid)

Resolves a process ID to its internal process object without acquiring a reference.

The returned pointer is borrowed and remains valid only while the process object exists. PID 0 selects the calling process.

Parameters
[in]pidProcess ID, or 0 for the calling process.
Returns
Process object pointer, or NULL when the process cannot be resolved.

◆ ksceKernelGetProcessInfo()

int ksceKernelGetProcessInfo ( SceUID  pid,
SceKernelProcessInfo *  info 
)

◆ ksceKernelCreateProcessLocalStorage()

int ksceKernelCreateProcessLocalStorage ( const char *  name,
SceSize  size 
)

◆ ksceKernelGetProcessLocalStorageAddr()

void * ksceKernelGetProcessLocalStorageAddr ( int  key)

◆ ksceKernelGetProcessLocalStorageAddrForPid()

int ksceKernelGetProcessLocalStorageAddrForPid ( SceUID  pid,
int  key,
void **  out_addr,
int  create_if_doesnt_exist 
)

◆ VITASDK_BUILD_ASSERT_EQ() [7/8]

VITASDK_BUILD_ASSERT_EQ ( 4  ,
SceKernelProcessType   
)

◆ VITASDK_BUILD_ASSERT_EQ() [8/8]

VITASDK_BUILD_ASSERT_EQ ( 0x40  ,
SceKernelProcessOpt2   
)

◆ ksceKernelCreateProcess()

ScePID ksceKernelCreateProcess ( const char *  name,
SceKernelProcessType  type,
const char *  path,
void *  opt 
)

Create a dormant process.

FW 3.60 accepts game, mini-application, and system-application process types. A non-NULL option must have a size of exactly 0x40. Passing NULL selects the built-in full-game budget and the documented field defaults. Creation is rejected in interrupt context and when either the global or selected-budget process count has already reached 16. The option block and its klicensee bytes must remain valid until this function returns; they are not used afterwards.

Parameters
[in]nameNon-NULL process name.
[in]typeProcess type. Bit 31 is discarded by this function; use a spawn or start function to request debug suspension.
[in]pathNon-NULL process-image path.
[in]optOptional FW 3.60 process options. NULL uses defaults.
Returns
Process ID on success, or < 0 on error.

◆ ksceKernelResumeProcess()

int ksceKernelResumeProcess ( SceUID  pid)

Resume a suspended process.

Parameters
[in]pidThe process to resume.
Returns
Zero on success, < 0 on error.

◆ ksceKernelSuspendProcess()

int ksceKernelSuspendProcess ( SceUID  pid,
int  status 
)

Suspend a running process.

Parameters
[in]pidThe process to suspend.
[in]statusThe new status for the process.
Returns
Zero on success, < 0 on error.

◆ ksceKernelGetProcessStatus()

int ksceKernelGetProcessStatus ( SceUID  pid,
int *  status 
)

Get the status of a given process.

Parameters
[in]pidThe process ID to query.
[out]statusThe bit field status of the process.
Returns
Zero on success, < 0 on error.

◆ ksceKernelGetProcessMainThread()

SceUID ksceKernelGetProcessMainThread ( SceUID  pid)

Get the main thread for a given process.

Parameters
[in]pidThe process id to query for.
Returns
The thread UID on success, else < 0 on error.

◆ ksceKernelGetProcessModuleInfo()

ScePVoid ksceKernelGetProcessModuleInfo ( SceUID  pid)

Get the process module control block.

Parameters
[in]pid- The target process ID.
Returns
The process module control-block pointer.

◆ ksceKernelGetProcessSelfAuthInfo()

int ksceKernelGetProcessSelfAuthInfo ( SceUID  pid,
SceSelfAuthInfo *  self_auth_info 
)

Get the process self auth info.

Parameters
[in]pid- The target process id.
[out]self_auth_info- The output buffer pointer of self auth info.
Returns
Zero on success, < 0 on error.

◆ ksceKernelLibcGettimeofday()

int ksceKernelLibcGettimeofday ( SceKernelTimeval *  tv,
SceKernelTimezone *  tz 
)

◆ ksceKernelLibcTime()

SceKernelTime ksceKernelLibcTime ( SceKernelTime *  tloc)

◆ ksceKernelExitProcess()

int ksceKernelExitProcess ( int  status)

◆ ksceKernelGetUIDProcessClass()

SceClass * ksceKernelGetUIDProcessClass ( void  )

◆ ksceKernelGetProcessTimeCore()

int ksceKernelGetProcessTimeCore ( SceKernelSysClock *  time)

Gets the current process's elapsed time in microseconds.

Parameters
[out]timeNon-NULL output for the elapsed time.
Returns
0 on success, or < 0 on error.

◆ ksceKernelGetProcessTimeLowCore()

SceUInt32 ksceKernelGetProcessTimeLowCore ( void  )

Returns the wrapping low 32 bits of the current process's elapsed time in microseconds.

◆ ksceKernelGetRemoteProcessTime()

int ksceKernelGetRemoteProcessTime ( ScePID  pid,
SceKernelSysClock *  time 
)

Gets a process's running elapsed time or stored final time in microseconds.

Parameters
[in]pidProcess ID, or 0 for the current process.
[out]timeNon-NULL output for the elapsed time.
Returns
0 on success, or < 0 on error.

◆ ksceKernelIsCDialogAvailable()

SceBool ksceKernelIsCDialogAvailable ( void  )

Tests whether the current process budget reserves common-dialog memory.

Returns
1 when available, 0 when unavailable, or < 0 on error.

◆ ksceKernelKillProcess()

int ksceKernelKillProcess ( ScePID  pid,
SceInt32  option 
)

Requests process termination.

Option 0 requests normal termination, option 1 selects the alternate 0x20 process-event path, and option 2 prepares the process for exit-spawn reuse. Other option values are rejected on FW 3.60. This function cannot be called from interrupt or nested-exception context.

Parameters
[in]pidTarget process ID.
[in]optionTermination option described above.
Returns
0 on success, or < 0 on error.

◆ ksceKernelSpawnProcess()

ScePID ksceKernelSpawnProcess ( const char *  name,
SceKernelProcessType  type,
const char *  path,
SceSize  arg_size,
const void *  arg_block,
const SceKernelProcessOpt2 *  opt 
)

Creates and starts a process.

A failure while starting automatically kills the newly created process.

For a normal start, the argument block must remain valid until this function returns; it is not used afterwards. For a debug-suspended start, the preload thread keeps the pointer, so the argument block must remain valid until the process is resumed and the main thread is started.

Parameters
[in]nameNon-NULL process name.
[in]typeProcess type, optionally ORed with SCE_KERNEL_PROCESS_START_FLAG_DEBUG.
[in]pathNon-NULL process-image path.
[in]arg_sizeArgument-block size.
[in]arg_blockOptional argument block; may be NULL when arg_size is 0.
[in]optOptional FW 3.60 process options. NULL uses defaults.
Returns
Process ID on success, or < 0 on error.

◆ ksceKernelSpawnProcessExt()

ScePID ksceKernelSpawnProcessExt ( const char *  name,
SceKernelProcessType  type,
const char *  path,
SceSize  arg_size,
const void *  arg_block,
const SceKernelProcessOpt2 *  opt,
SceUInt32  preload_flags 
)

Extended form of ksceKernelSpawnProcess.

Parameters
[in]nameNon-NULL process name.
[in]typeProcess type, optionally ORed with SCE_KERNEL_PROCESS_START_FLAG_DEBUG.
[in]pathNon-NULL process-image path.
[in]arg_sizeArgument-block size.
[in]arg_blockOptional argument block; may be NULL when arg_size is 0.
[in]optOptional FW 3.60 process options. NULL uses defaults.
[in]preload_flagsFlags forwarded to the preloading-module loader. AppMgr uses bit 0 when its GXM-debug setting is enabled. A debug-suspended start additionally sets bit 0x00020000 internally.
Returns
Process ID on success, or < 0 on error.

◆ ksceKernelStartProcess()

int ksceKernelStartProcess ( ScePID  pid,
SceUInt32  start_flags,
SceSize  arg_size,
const void *  arg_block 
)

Starts a dormant process.

On FW 3.60, only bit 31 of start_flags has an effect: it requests a start suspended for debugging. This form passes zero preloading flags. For a normal start, the argument block must remain valid until this function returns; it is not used afterwards. For a debug-suspended start, the pointer is kept, so the argument block must remain valid until the process is resumed and the main thread is started.

Parameters
[in]pidDormant process ID.
[in]start_flagsStart flags.
[in]arg_sizeArgument-block size.
[in]arg_blockOptional argument block; may be NULL when arg_size is 0.
Returns
0 on success, or < 0 on error.

◆ ksceKernelStartProcessExt()

int ksceKernelStartProcessExt ( ScePID  pid,
SceUInt32  start_flags,
SceSize  arg_size,
const void *  arg_block,
SceUInt32  preload_flags 
)

Extended form of ksceKernelStartProcess.

Parameters
[in]pidDormant process ID.
[in]start_flagsStart flags; only bit 31 affects FW 3.60.
[in]arg_sizeArgument-block size.
[in]arg_blockOptional argument block; may be NULL when arg_size is 0.
[in]preload_flagsFlags forwarded to the preloading-module loader.
Returns
0 on success, or < 0 on error.

Variable Documentation

◆ sec

SceInt32 SceKernelTimeval::sec

◆ usec

SceInt32 SceKernelTimeval::usec

◆ value

SceUInt64 SceKernelTimezone::value

◆ size [1/2]

SceSize SceKernelProcessInfo::size

size of this struct, make sure it's 0xE8

◆ pid

SceUID SceKernelProcessInfo::pid

our process ID

◆ unk1

int SceKernelProcessInfo::unk1

◆ unk2

int SceKernelProcessInfo::unk2

◆ unk3

int SceKernelProcessInfo::unk3

◆ ppid

SceUID SceKernelProcessInfo::ppid

parent process ID

◆ unk

int SceKernelProcessInfo::unk[0xE8/4 - 6]

the rest is unknown

◆ size [2/2]

SceSize SceKernelProcessOpt2::size

Must be 0x40 on FW 3.60.

◆ attr

SceUInt32 SceKernelProcessOpt2::attr

Bitwise OR of SceKernelProcessOptAttribute values. FW 3.60 does not reject unlisted bits, whose purpose is unknown.

◆ cpu_affinity_mask

SceUInt32 SceKernelProcessOpt2::cpu_affinity_mask

Four-bit mask in bits 0-3 or bits 16-19; 0 selects the default. Do not combine the two encodings.

◆ init_priority

SceInt32 SceKernelProcessOpt2::init_priority

Initial main-thread priority when selected; otherwise the process-image value or 0x10000100 is used.

◆ stack_size

SceSize SceKernelProcessOpt2::stack_size

Main-thread stack size when selected; otherwise the process-image value or 0x40000 is used.

◆ reserved

SceUInt32 SceKernelProcessOpt2::reserved

Ignored on FW 3.60.

◆ budget_id

SceUID SceKernelProcessOpt2::budget_id

Budget selector or process-budget UID; the default selector is SCE_KERNEL_PROCESS_FULL_GAME_PROCESS_BUDGET.

◆ parent_pid

ScePID SceKernelProcessOpt2::parent_pid

Parent process ID; the calling process's ID is used when this field is not selected.

◆ process_exit_spawn_mode

SceKernelProcessExitSpawnMode SceKernelProcessOpt2::process_exit_spawn_mode

Exit-spawn handling mode when selected.

◆ process_exit_spawn_pid

ScePID SceKernelProcessOpt2::process_exit_spawn_pid

Pending exit-spawn PID to reuse in enabled mode; zero allocates a new object.

◆ klicensee

const void* SceKernelProcessOpt2::klicensee

Pointer to a 16-byte klicensee when selected.

◆ max_open_files

SceSize SceKernelProcessOpt2::max_open_files

Maximum open-file count when selected; default is 64.

◆ max_directory_open_level

SceSize SceKernelProcessOpt2::max_directory_open_level

Maximum directory-open nesting level when selected; default is 10.

◆ unique_heap_size

SceSize SceKernelProcessOpt2::unique_heap_size

Required and nonzero when selected by attr.

◆ display_resolution_flags

SceUInt32 SceKernelProcessOpt2::display_resolution_flags

Selected value must use only bit 0 for 1280-wide modes and bit 1 for 1440/1920-wide modes.

◆ power_configuration_flags

SceUInt32 SceKernelProcessOpt2::power_configuration_flags

Selected value must fit in two bits; the default queried by ScePower is 3.