![]() |
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 |
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. | |
Exports for Kernel.
Include the header file in your project:
Include the header file in your project:
Link the library to the executable:
| struct SceKernelTimezone |
| Data Fields | ||
|---|---|---|
| SceUInt64 | value | |
| struct SceKernelProcessInfo |
| 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. |
| #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.
| typedef SceUInt32 SceKernelProcessType |
| typedef SceUInt64 SceKernelClock |
| typedef SceUInt32 SceKernelTime |
| typedef struct SceUIDProcessObject SceUIDProcessObject |
| typedef SceUInt32 SceKernelProcessType |
Known option bits used in SceKernelProcessOpt2::attr on FW 3.60.
| Enumerator | |
|---|---|
| SCE_KERNEL_PROCESS_OPT_ATTR_CPU_AFFINITY_MASK | |
| SCE_KERNEL_PROCESS_OPT_ATTR_BUDGET_ID | |
| SCE_KERNEL_PROCESS_OPT_ATTR_PARENT_PROCESS_ID | |
| 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 | |
| SCE_KERNEL_PROCESS_OPT_ATTR_MAX_DIRECTORY_OPEN_LEVEL | |
| SCE_KERNEL_PROCESS_OPT_ATTR_UNIQUE_HEAP_SIZE | |
| SCE_KERNEL_PROCESS_OPT_ATTR_DISPLAY_RESOLUTION_FLAGS | |
| SCE_KERNEL_PROCESS_OPT_ATTR_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. |
| 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.
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.
| [in] | pid | Process ID, or 0 for the calling process. |
| 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.
| [in] | pid | Process ID, or 0 for the calling process. |
| 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.
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.
| [in] | name | Non-NULL process name. |
| [in] | type | Process type. Bit 31 is discarded by this function; use a spawn or start function to request debug suspension. |
| [in] | path | Non-NULL process-image path. |
| [in] | opt | Optional FW 3.60 process options. NULL uses defaults. |
| int ksceKernelResumeProcess | ( | SceUID | pid | ) |
Resume a suspended process.
| [in] | pid | The process to resume. |
| int ksceKernelSuspendProcess | ( | SceUID | pid, |
| int | status | ||
| ) |
Suspend a running process.
| [in] | pid | The process to suspend. |
| [in] | status | The new status for the process. |
| int ksceKernelGetProcessStatus | ( | SceUID | pid, |
| int * | status | ||
| ) |
Get the status of a given process.
| [in] | pid | The process ID to query. |
| [out] | status | The bit field status of the process. |
Get the main thread for a given process.
| [in] | pid | The process id to query for. |
Get the process module control block.
| [in] | pid | - The target process ID. |
| int ksceKernelGetProcessSelfAuthInfo | ( | SceUID | pid, |
| SceSelfAuthInfo * | self_auth_info | ||
| ) |
Get the process self auth info.
| [in] | pid | - The target process id. |
| [out] | self_auth_info | - The output buffer pointer of 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.
| [out] | time | Non-NULL output for the elapsed time. |
| 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.
| [in] | pid | Process ID, or 0 for the current process. |
| [out] | time | Non-NULL output for the elapsed time. |
| SceBool ksceKernelIsCDialogAvailable | ( | void | ) |
Tests whether the current process budget reserves common-dialog memory.
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.
| [in] | pid | Target process ID. |
| [in] | option | Termination option described above. |
| 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.
| [in] | name | Non-NULL process name. |
| [in] | type | Process type, optionally ORed with SCE_KERNEL_PROCESS_START_FLAG_DEBUG. |
| [in] | path | Non-NULL process-image path. |
| [in] | arg_size | Argument-block size. |
| [in] | arg_block | Optional argument block; may be NULL when arg_size is 0. |
| [in] | opt | Optional FW 3.60 process options. NULL uses defaults. |
| 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.
| [in] | name | Non-NULL process name. |
| [in] | type | Process type, optionally ORed with SCE_KERNEL_PROCESS_START_FLAG_DEBUG. |
| [in] | path | Non-NULL process-image path. |
| [in] | arg_size | Argument-block size. |
| [in] | arg_block | Optional argument block; may be NULL when arg_size is 0. |
| [in] | opt | Optional FW 3.60 process options. NULL uses defaults. |
| [in] | preload_flags | Flags 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. |
| 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.
| [in] | pid | Dormant process ID. |
| [in] | start_flags | Start flags. |
| [in] | arg_size | Argument-block size. |
| [in] | arg_block | Optional argument block; may be NULL when arg_size is 0. |
| int ksceKernelStartProcessExt | ( | ScePID | pid, |
| SceUInt32 | start_flags, | ||
| SceSize | arg_size, | ||
| const void * | arg_block, | ||
| SceUInt32 | preload_flags | ||
| ) |
Extended form of ksceKernelStartProcess.
| [in] | pid | Dormant process ID. |
| [in] | start_flags | Start flags; only bit 31 affects FW 3.60. |
| [in] | arg_size | Argument-block size. |
| [in] | arg_block | Optional argument block; may be NULL when arg_size is 0. |
| [in] | preload_flags | Flags forwarded to the preloading-module loader. |
| 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.