![]() |
vitasdk
Documentation of the vitasdk
|
Exports for User. More...
Data Structures | |
| struct | SceKernelSpackageArgs |
| struct | SceSblUsSpkgInfo |
| Installed secure-package information. More... | |
| struct | SceSblUsApplicableVersionInfo |
| Applicable version information for OS0 and SLB2 packages. More... | |
Macros | |
| #define | SCE_UPDATE_MODE_SWU_GUI 0x10 |
| #define | SCE_UPDATE_MODE_SWU_CUI 0x30 |
| #define | sceSblSsUpdateMgrGetBootMode sceSblUsGetUpdateMode |
| #define | sceSblSsUpdateMgrSetBootMode sceSblUsSetUpdateMode |
Typedefs | |
| typedef char | SceUpdateMode |
Functions | |
| VITASDK_BUILD_ASSERT_EQ (1, SceUpdateMode) | |
| int | sceSblUsGetUpdateMode (SceUpdateMode *mode) |
| Getting system update mode on boot. | |
| int | sceSblUsSetUpdateMode (SceUpdateMode mode) |
| Setting system update mode on boot. | |
| int | sceSblUsVerifyPup (const char *path) |
| Verify PUP. | |
| VITASDK_BUILD_ASSERT_EQ (1, SceSblUsSpackageType) | |
| VITASDK_BUILD_ASSERT_EQ (1, SceSblUsSpackageRequestType) | |
| VITASDK_BUILD_ASSERT_EQ (1, SceSblUsSpackageRequestState) | |
| VITASDK_BUILD_ASSERT_EQ (1, SceSblUsSpackageFlags) | |
| VITASDK_BUILD_ASSERT_EQ (1, SceSblUsPowerControlMode) | |
| VITASDK_BUILD_ASSERT_EQ (0x2C, SceKernelSpackageArgs) | |
| VITASDK_BUILD_ASSERT_EQ (0x10, SceSblUsSpkgInfo) | |
| VITASDK_BUILD_ASSERT_EQ (0x10, SceSblUsApplicableVersionInfo) | |
| int | sceSblUsAllocateBuffer (SceSize size, void **user_buffer) |
| Allocate a process-owned update buffer. | |
| SceInt32 | sceSblUsCheckSystemIntegrity (void) |
| Check system integrity. | |
| int | sceSblUsExtractSpackage (int package_type, const SceKernelSpackageArgs *args, int *request_id) |
| Submit an asynchronous package-extraction request. | |
| int | sceSblUsGetApplicableVersion (int package_type, SceSblUsApplicableVersionInfo *version_info) |
| Get an applicable package version. | |
| int | sceSblUsGetExtractSpackage (int request_type, int request_id, SceKernelSpackageArgs *args) |
| Return a request buffer's user-space mapping. | |
| int | sceSblUsGetSpkgInfo (int package_type, SceSblUsSpkgInfo *info) |
| Get information about an installed package. | |
| int | sceSblUsGetStatus (int request_type, int request_id, const SceKernelSpackageArgs *args) |
| Get the state of an asynchronous package request. | |
| int | sceSblUsInformUpdateFinished (SceUInt32 task, const char *message, SceSize message_length) |
| Inform the system that an update has finished. | |
| int | sceSblUsInformUpdateOngoing (SceUInt32 task, SceUInt32 percentage) |
| Inform the system that an update is ongoing. | |
| int | sceSblUsInformUpdateStarted (SceUInt32 task, SceUInt32 value, const char *message, SceSize message_length) |
| Inform the system that an update has started. | |
| int | sceSblUsInspectSpackage (int package_type, const SceKernelSpackageArgs *args, int *request_id) |
| Submit an asynchronous package-inspection request. | |
| int | sceSblUsPowerControl (int mode, SceUInt32 flags) |
| Perform an update-related power-control operation. | |
| int | sceSblUsReleaseBuffer (void *user_buffer) |
| Release an update buffer allocated by sceSblUsAllocateBuffer. | |
| int | sceSblUsSetSwInfoBin (const char *name, SceSize name_length, const void *value, SceSize value_length) |
| Set a binary software-information value. | |
| int | sceSblUsSetSwInfoInt (const char *name, SceSize name_length, SceUInt32 value) |
| Set an integer software-information value. | |
| int | sceSblUsSetSwInfoStr (const char *name, SceSize name_length, const char *value, SceSize value_length) |
| Set a string software-information value. | |
| int | sceSblUsUpdateSpackage (int package_type, const SceKernelSpackageArgs *args, int *request_id) |
| Submit an asynchronous package-update request. | |
| int | sceSblUsVerifyPupAdditionalSign (const char *path) |
| Verify an additional PUP signature. | |
| int | sceSblUsVerifyPupHeader (const char *path) |
| Verify a PUP header. | |
| int | sceSblUsVerifyPupSegment (const char *path, SceUInt64 segment_index) |
| Verify a PUP segment by index. | |
| int | sceSblUsVerifyPupSegmentById (const char *path, SceUInt64 segment_id) |
| Verify a PUP segment by ID. | |
| int | sceSblUsVerifyPupWatermark (const char *path) |
| Verify a PUP watermark. | |
Variables | |
| SceSize | SceKernelSpackageArgs::size |
| Initialize to sizeof(SceKernelSpackageArgs); copied but not validated on FW 3.60. | |
| SceUInt32 | SceKernelSpackageArgs::package_type |
| One of SceSblUsSpackageType; the function uses its package_type argument instead on FW 3.60. | |
| void * | SceKernelSpackageArgs::buffer |
| Process-owned buffer returned by sceSblUsAllocateBuffer. | |
| SceSize | SceKernelSpackageArgs::buffer_size |
| Must equal the size passed to sceSblUsAllocateBuffer for this buffer. | |
| SceUInt32 | SceKernelSpackageArgs::flags |
| One of SceSblUsSpackageFlags. | |
| SceUInt32 | SceKernelSpackageArgs::reserved [2] |
| Preserved by sceSblUsGetExtractSpackage and ignored by SceSblUpdateMgr. | |
| SceUInt32 * | SceKernelSpackageArgs::sequence_number |
| Receives a counter incremented each time the request state changes. | |
| SceInt32 * | SceKernelSpackageArgs::request_result |
| Receives the operation result; valid when the request is completed. | |
| SceUInt32 * | SceKernelSpackageArgs::request_state |
| Receives one of SceSblUsSpackageRequestState. | |
| SceUInt32 * | SceKernelSpackageArgs::written_rate |
| Receives the write-rate value; applicable update paths report 100 when finished. | |
| SceSize | SceSblUsSpkgInfo::size |
| Set to sizeof(SceSblUsSpkgInfo) on success. | |
| SceUInt32 | SceSblUsSpkgInfo::version |
| Installed package version. | |
| SceUInt8 | SceSblUsSpkgInfo::status [4] |
| Package-specific status bytes; only elements 0 and 1 are used on FW 3.60. | |
| SceInt32 | SceSblUsSpkgInfo::reserved |
| Set to 0 on FW 3.60. | |
| SceUInt32 | SceSblUsApplicableVersionInfo::version |
| Applicable package version. | |
| SceUInt32 | SceSblUsApplicableVersionInfo::handled |
| Set to 1 for OS0 and SLB2, or 0 for an unsupported package type. | |
| SceUInt32 | SceSblUsApplicableVersionInfo::reserved [2] |
| Set to 0 on FW 3.60. | |
Exports for User.
Include the header file in your project:
Link the library to the executable:
Every function in this header requires system-program privilege on FW 3.60.
| struct SceKernelSpackageArgs |
| Data Fields | ||
|---|---|---|
| SceSize | size | Initialize to sizeof(SceKernelSpackageArgs); copied but not validated on FW 3.60. |
| SceUInt32 | package_type | One of SceSblUsSpackageType; the function uses its package_type argument instead on FW 3.60. |
| void * | buffer | Process-owned buffer returned by sceSblUsAllocateBuffer. |
| SceSize | buffer_size | Must equal the size passed to sceSblUsAllocateBuffer for this buffer. |
| SceUInt32 | flags | One of SceSblUsSpackageFlags. |
| SceUInt32 | reserved[2] | Preserved by sceSblUsGetExtractSpackage and ignored by SceSblUpdateMgr. |
| SceUInt32 * | sequence_number | Receives a counter incremented each time the request state changes. |
| SceInt32 * | request_result | Receives the operation result; valid when the request is completed. |
| SceUInt32 * | request_state | Receives one of SceSblUsSpackageRequestState. |
| SceUInt32 * | written_rate | Receives the write-rate value; applicable update paths report 100 when finished. |
| struct SceSblUsSpkgInfo |
Installed secure-package information.
On FW 3.60, SceSblUsSpkgInfo::status element 0 is used only for the BBMC firmware package and is zero only when the BBMC status query succeeds and returns a nonzero value. Element 1 is used only for the preinstall-data patch package and is one when its secondary stored status is nonzero.
| Data Fields | ||
|---|---|---|
| SceSize | size | Set to sizeof(SceSblUsSpkgInfo) on success. |
| SceUInt32 | version | Installed package version. |
| SceUInt8 | status[4] | Package-specific status bytes; only elements 0 and 1 are used on FW 3.60. |
| SceInt32 | reserved | Set to 0 on FW 3.60. |
| struct SceSblUsApplicableVersionInfo |
| #define SCE_UPDATE_MODE_SWU_GUI 0x10 |
| #define SCE_UPDATE_MODE_SWU_CUI 0x30 |
| #define sceSblSsUpdateMgrGetBootMode sceSblUsGetUpdateMode |
| #define sceSblSsUpdateMgrSetBootMode sceSblUsSetUpdateMode |
| typedef char SceUpdateMode |
| enum SceSblUsSpackageType |
Secure-package component types accepted on FW 3.60.
Types 3, 4, and 27 support extraction only. Types 10, 21, 22, 23, and 28 support inspection, update, and extraction. The other values declared here support inspection and update. Other numeric package types are rejected.
Values reported through SceKernelSpackageArgs::request_state.
| Enumerator | |
|---|---|
| SCE_SBL_US_SPACKAGE_STATE_ACCEPTED | |
| SCE_SBL_US_SPACKAGE_STATE_VALIDATING | |
| SCE_SBL_US_SPACKAGE_STATE_APPLYING | |
| SCE_SBL_US_SPACKAGE_STATE_FINALIZING | |
| SCE_SBL_US_SPACKAGE_STATE_COMPLETED | |
Flag values used by package-operation callers on FW 3.60.
FW 3.60 requires the bits in mask 0x5 or 0x9 to be set, but does not reject additional bits. Value 0x9 enables version checks. Value 0x5 skips version checks for the boot and system-partition package types, but not peripheral firmware checks. When the system does not use external storage, value 0x5 is rejected on CEX units.
| Enumerator | |
|---|---|
| SCE_SBL_US_SPACKAGE_FLAGS_SKIP_SYSTEM_VERSION_CHECK | |
| SCE_SBL_US_SPACKAGE_FLAGS_CHECK_SYSTEM_VERSION | |
| VITASDK_BUILD_ASSERT_EQ | ( | 1 | , |
| SceUpdateMode | |||
| ) |
| int sceSblUsGetUpdateMode | ( | SceUpdateMode * | mode | ) |
Getting system update mode on boot.
| [out] | mode | - The pointer of SceUpdateMode variable |
| int sceSblUsSetUpdateMode | ( | SceUpdateMode | mode | ) |
Setting system update mode on boot.
| [in] | mode | - The update mode |
| int sceSblUsVerifyPup | ( | const char * | path | ) |
Verify PUP.
| [in] | path | - The PUP path |
note - If verify CEX PUP on Devkit system, got error.
| VITASDK_BUILD_ASSERT_EQ | ( | 1 | , |
| SceSblUsSpackageType | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 1 | , |
| SceSblUsSpackageRequestType | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 1 | , |
| SceSblUsSpackageRequestState | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 1 | , |
| SceSblUsSpackageFlags | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 1 | , |
| SceSblUsPowerControlMode | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 0x2C | , |
| SceKernelSpackageArgs | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 0x10 | , |
| SceSblUsSpkgInfo | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 0x10 | , |
| SceSblUsApplicableVersionInfo | |||
| ) |
| int sceSblUsAllocateBuffer | ( | SceSize | size, |
| void ** | user_buffer | ||
| ) |
Allocate a process-owned update buffer.
FW 3.60 rounds size up to a 4 KiB boundary and has four update-buffer slots shared by all processes.
| [in] | size | - Nonzero buffer size. |
| [out] | user_buffer | - Receives the user-space mapping. |
| SceInt32 sceSblUsCheckSystemIntegrity | ( | void | ) |
Check system integrity.
FW 3.60 checks only that the caller is a system program. It performs no additional integrity scan.
| int sceSblUsExtractSpackage | ( | int | package_type, |
| const SceKernelSpackageArgs * | args, | ||
| int * | request_id | ||
| ) |
Submit an asynchronous package-extraction request.
The operation validates and decrypts the package without installing it. The buffer must have been allocated by sceSblUsAllocateBuffer for the calling process.
| [in] | package_type | - One of SceSblUsSpackageType. |
| [in] | args | - Update buffer, size, and flags. |
| [out] | request_id | - Request identifier used by sceSblUsGetStatus and sceSblUsGetExtractSpackage. |
| int sceSblUsGetApplicableVersion | ( | int | package_type, |
| SceSblUsApplicableVersionInfo * | version_info | ||
| ) |
Get an applicable package version.
For OS0 and SLB2, FW 3.60 selects a built-in applicable version and, on CEX systems, raises it to at least the installed version. Other package types return success with a zeroed result.
| [in] | package_type | - One of SceSblUsSpackageType. |
| [out] | version_info | - Receives the applicable-version information. |
| int sceSblUsGetExtractSpackage | ( | int | request_type, |
| int | request_id, | ||
| SceKernelSpackageArgs * | args | ||
| ) |
Return a request buffer's user-space mapping.
FW 3.60 accepts every valid request type and does not itself require the request to be completed. The request type and ID must identify the current request. Only SceKernelSpackageArgs::buffer is replaced; every other byte of the caller's structure is preserved.
| [in] | request_type | - One of SceSblUsSpackageRequestType. |
| [in] | request_id | - Request identifier. |
| [in,out] | args | - Receives the mapped user-space buffer. |
| int sceSblUsGetSpkgInfo | ( | int | package_type, |
| SceSblUsSpkgInfo * | info | ||
| ) |
Get information about an installed package.
The function writes the complete 0x10-byte output structure; its SceSblUsSpkgInfo::size member is not an input.
| [in] | package_type | - One of SceSblUsSpackageType. |
| [out] | info | - Package information. |
| int sceSblUsGetStatus | ( | int | request_type, |
| int | request_id, | ||
| const SceKernelSpackageArgs * | args | ||
| ) |
Get the state of an asynchronous package request.
All four output pointers in args must be non-NULL. A nonzero request ID must match the current request for request_type. Request ID zero selects the module's legacy fallback-result path.
| [in] | request_type | - One of SceSblUsSpackageRequestType. |
| [in] | request_id | - Request identifier. |
| [in] | args | - Contains the four user-space output pointers. |
Inform the system that an update has finished.
FW 3.60 copies the message into a 64-byte local buffer and forwards all arguments unchanged to the registered system-root callback. If no callback is registered, the call succeeds after validating and copying the message.
| [in] | task | - Update task value. |
| [in] | message | - Message buffer. |
| [in] | message_length | - Number of bytes to copy, from 1 through 64. |
Inform the system that an update is ongoing.
Both arguments are forwarded unchanged to the registered system-root callback. If no callback is registered, the call succeeds without otherwise using the values.
| [in] | task | - Update task value. |
| [in] | percentage | - Update completion percentage. |
| int sceSblUsInformUpdateStarted | ( | SceUInt32 | task, |
| SceUInt32 | value, | ||
| const char * | message, | ||
| SceSize | message_length | ||
| ) |
Inform the system that an update has started.
FW 3.60 copies the message into a 64-byte local buffer and forwards all arguments unchanged to the registered system-root callback. If no callback is registered, the call succeeds after validating and copying the message.
| [in] | task | - Update task value. |
| [in] | value | - Callback value whose purpose is unknown. |
| [in] | message | - Message buffer. |
| [in] | message_length | - Number of bytes to copy, from 1 through 64. |
| int sceSblUsInspectSpackage | ( | int | package_type, |
| const SceKernelSpackageArgs * | args, | ||
| int * | request_id | ||
| ) |
Submit an asynchronous package-inspection request.
The operation performs the same package authentication, platform checks, and version checks as an update request, but does not install the package.
| [in] | package_type | - One of SceSblUsSpackageType. |
| [in] | args | - Update buffer, size, and flags. |
| [out] | request_id | - Request identifier used by sceSblUsGetStatus. |
| int sceSblUsPowerControl | ( | int | mode, |
| SceUInt32 | flags | ||
| ) |
Perform an update-related power-control operation.
For reboot and shutdown, observed flag values use bits 0 through 2; value 0x2 selects the CP path and value 0x5 selects the system/Ernie path. For lock and unlock, bit 0 requests the corresponding kernel power lock. LED and CP-check modes ignore flags. Power-tick mode passes flags directly as a SceKernelPowerTickType value.
| [in] | mode | - One of SceSblUsPowerControlMode. |
| [in] | flags | - Mode-dependent flags. |
| int sceSblUsReleaseBuffer | ( | void * | user_buffer | ) |
Release an update buffer allocated by sceSblUsAllocateBuffer.
If an asynchronous request still owns the buffer, this call removes the caller's mapping. FW 3.60 frees the underlying memory only after the request stops using it.
| [in] | user_buffer | - User-space update buffer. |
| int sceSblUsSetSwInfoBin | ( | const char * | name, |
| SceSize | name_length, | ||
| const void * | value, | ||
| SceSize | value_length | ||
| ) |
Set a binary software-information value.
The input buffers are copied before the registered system-root callback is called. If no callback is registered, the call succeeds after validating and copying the inputs.
| [in] | name | - Name buffer. |
| [in] | name_length | - Number of name bytes to copy, from 1 through 31. |
| [in] | value | - Binary value buffer. |
| [in] | value_length | - Number of value bytes to copy, from 1 through 127. |
Set an integer software-information value.
If no system-root callback is registered, the call succeeds after validating and copying the name.
| [in] | name | - Name buffer. |
| [in] | name_length | - Number of name bytes to copy, from 1 through 31. |
| [in] | value | - Integer value. |
| int sceSblUsSetSwInfoStr | ( | const char * | name, |
| SceSize | name_length, | ||
| const char * | value, | ||
| SceSize | value_length | ||
| ) |
Set a string software-information value.
The input buffers are copied before the registered system-root callback is called. If no callback is registered, the call succeeds after validating and copying the inputs.
| [in] | name | - Name buffer. |
| [in] | name_length | - Number of name bytes to copy, from 1 through 31. |
| [in] | value | - String value buffer. |
| [in] | value_length | - Number of value bytes to copy, from 1 through 127. |
| int sceSblUsUpdateSpackage | ( | int | package_type, |
| const SceKernelSpackageArgs * | args, | ||
| int * | request_id | ||
| ) |
Submit an asynchronous package-update request.
The operation authenticates the package, checks target compatibility and version policy, and installs the package-specific payload.
| [in] | package_type | - One of SceSblUsSpackageType. |
| [in] | args | - Update buffer, size, and flags. |
| [out] | request_id | - Request identifier used by sceSblUsGetStatus. |
| int sceSblUsVerifyPupAdditionalSign | ( | const char * | path | ) |
Verify an additional PUP signature.
| [in] | path | - NUL-terminated PUP path, at most 0x3FF characters. |
| int sceSblUsVerifyPupHeader | ( | const char * | path | ) |
Verify a PUP header.
| [in] | path | - NUL-terminated PUP path, at most 0x3FF characters. |
| int sceSblUsVerifyPupSegment | ( | const char * | path, |
| SceUInt64 | segment_index | ||
| ) |
Verify a PUP segment by index.
| [in] | path | - NUL-terminated PUP path, at most 0x3FF characters. |
| [in] | segment_index | - 64-bit segment index. |
| int sceSblUsVerifyPupSegmentById | ( | const char * | path, |
| SceUInt64 | segment_id | ||
| ) |
Verify a PUP segment by ID.
| [in] | path | - NUL-terminated PUP path, at most 0x3FF characters. |
| [in] | segment_id | - 64-bit segment ID. |
| int sceSblUsVerifyPupWatermark | ( | const char * | path | ) |
Verify a PUP watermark.
| [in] | path | - NUL-terminated PUP path, at most 0x3FF characters. |
| SceSize SceKernelSpackageArgs::size |
Initialize to sizeof(SceKernelSpackageArgs); copied but not validated on FW 3.60.
| SceUInt32 SceKernelSpackageArgs::package_type |
One of SceSblUsSpackageType; the function uses its package_type argument instead on FW 3.60.
| void* SceKernelSpackageArgs::buffer |
Process-owned buffer returned by sceSblUsAllocateBuffer.
| SceSize SceKernelSpackageArgs::buffer_size |
Must equal the size passed to sceSblUsAllocateBuffer for this buffer.
| SceUInt32 SceKernelSpackageArgs::flags |
One of SceSblUsSpackageFlags.
| SceUInt32 SceKernelSpackageArgs::reserved[2] |
Preserved by sceSblUsGetExtractSpackage and ignored by SceSblUpdateMgr.
| SceUInt32* SceKernelSpackageArgs::sequence_number |
Receives a counter incremented each time the request state changes.
| SceInt32* SceKernelSpackageArgs::request_result |
Receives the operation result; valid when the request is completed.
| SceUInt32* SceKernelSpackageArgs::request_state |
Receives one of SceSblUsSpackageRequestState.
| SceUInt32* SceKernelSpackageArgs::written_rate |
Receives the write-rate value; applicable update paths report 100 when finished.
| SceSize SceSblUsSpkgInfo::size |
Set to sizeof(SceSblUsSpkgInfo) on success.
| SceUInt32 SceSblUsSpkgInfo::version |
Installed package version.
| SceUInt8 SceSblUsSpkgInfo::status[4] |
Package-specific status bytes; only elements 0 and 1 are used on FW 3.60.
| SceInt32 SceSblUsSpkgInfo::reserved |
Set to 0 on FW 3.60.
| SceUInt32 SceSblUsApplicableVersionInfo::version |
Applicable package version.
| SceUInt32 SceSblUsApplicableVersionInfo::handled |
Set to 1 for OS0 and SLB2, or 0 for an unsupported package type.
| SceUInt32 SceSblUsApplicableVersionInfo::reserved[2] |
Set to 0 on FW 3.60.