summaryrefslogtreecommitdiff
path: root/include/user
diff options
context:
space:
mode:
Diffstat (limited to 'include/user')
-rw-r--r--include/user/appmgr.h92
-rw-r--r--include/user/avconfig.h10
-rw-r--r--include/user/compat.h7
-rw-r--r--include/user/ctrl.h13
-rw-r--r--include/user/incoming_dialog.h83
-rw-r--r--include/user/jpegarm.h103
-rw-r--r--include/user/kernel/clib.h56
-rw-r--r--include/user/kernel/dmac.h6
-rw-r--r--include/user/kernel/modulemgr.h58
-rw-r--r--include/user/kernel/processmgr.h21
-rw-r--r--include/user/kernel/rng.h2
-rw-r--r--include/user/kernel/sysmem.h38
-rw-r--r--include/user/kernel/threadmgr.h1165
-rw-r--r--include/user/net/net_syscalls.h16
-rw-r--r--include/user/notification_util.h80
-rw-r--r--include/user/paf.h6
-rw-r--r--include/user/power.h48
-rw-r--r--include/user/promoterutil.h23
-rw-r--r--include/user/pss.h10
-rw-r--r--include/user/registrymgr.h4
-rw-r--r--include/user/sblacmgr.h16
-rw-r--r--include/user/shellutil.h93
-rw-r--r--include/user/sysmodule.h6
-rw-r--r--include/user/udcd.h8
-rw-r--r--include/user/vshbridge.h57
25 files changed, 1533 insertions, 488 deletions
diff --git a/include/user/appmgr.h b/include/user/appmgr.h
index a6e09c6..b55859a 100644
--- a/include/user/appmgr.h
+++ b/include/user/appmgr.h
@@ -13,8 +13,9 @@ typedef enum SceAppMgrErrorCode {
SCE_APPMGR_ERROR_STATE = 0x80802013, //!< Invalid state
SCE_APPMGR_ERROR_NULL_POINTER = 0x80802016, //!< NULL pointer
SCE_APPMGR_ERROR_INVALID = 0x8080201A, //!< Invalid param
+ SCE_APPMGR_ERROR_TOO_LONG_ARGV = 0x8080201D, //!< argv is too long
SCE_APPMGR_ERROR_INVALID_SELF_PATH = 0x8080201E, //!< Invalid SELF path
- SCE_APPMGR_ERROR_TOO_LONG_ARGV = 0x8080201D //!< argv is too long
+ SCE_APPMGR_ERROR_BGM_PORT_BUSY = 0x80803000 //!< BGM port was occupied and could not be secured
} SceAppMgrErrorCode;
typedef enum SceAppMgrSystemEventType {
@@ -79,7 +80,13 @@ typedef struct SceAppMgrSaveDataSlotDelete {
SceAppUtilSaveDataMountPoint mountPoint; //!< Savedata mountpoint
} SceAppMgrSaveDataSlotDelete;
-typedef struct SceAppMgrAppState SceAppMgrAppState; // Missing struct
+typedef struct SceAppMgrAppState {
+ SceUInt32 systemEventNum;
+ SceUInt32 appEventNum;
+ SceBool isSystemUiOverlaid;
+ SceUInt8 reserved[116];
+} SceAppMgrAppState;
+
typedef struct SceAppMgrExecOptParam SceAppMgrExecOptParam; // Missing struct
typedef struct SceAppMgrLaunchAppOptParam SceAppMgrLaunchAppOptParam; // Missing struct
@@ -89,6 +96,34 @@ typedef struct sceAppMgrLoadExecOptParam {
#define SCE_APPMGR_MAX_APP_NAME_LENGTH (31)
+typedef struct SceAppMgrBudgetInfo {
+// 0x00
+ SceSize size;
+ SceUInt32 mode;
+ SceUInt32 unk_8;
+ SceUInt32 budgetLPDDR2;
+// 0x10
+ SceUInt32 freeLPDDR2;
+ SceUInt32 allow0x0E208060;
+ SceUInt32 unk_14;
+ SceUInt32 budget0x0E208060;
+// 0x20
+ SceUInt32 free0x0E208060;
+ SceUInt32 unk_24;
+ SceUInt32 unk_28;
+ SceUInt32 budgetPHYCONT;
+// 0x30
+ SceUInt32 freePHYCONT;
+ SceUInt32 allow;
+ SceUChar8 unk_38[0x20];
+ SceUInt32 unk_58;
+ SceUInt32 budgetCDRAM;
+// 0x60
+ SceUInt32 freeCDRAM;
+ SceUChar8 reserved_64[0x24];
+// 0x88
+} SceAppMgrBudgetInfo;
+
/**
* Save data on savedata0: partition
*
@@ -177,7 +212,7 @@ int sceAppMgrDestroyOtherApp(void);
*
* @return 0 on success, < 0 on error.
*/
-int sceAppMgrDestroyAppByName(char *name);
+int sceAppMgrDestroyAppByName(const char *name);
/**
* Destroy an application by Application ID
@@ -230,7 +265,7 @@ int sceAppMgrReceiveSystemEvent(SceAppMgrSystemEvent *systemEvent);
/**
* Copies app param to an array
*
- * @param[in] param - pointer to a 1024 byte location to store the app param
+ * @param[out] param - pointer to a 1024 byte location to store the app param
*
* @return 0 on success, < 0 on error.
*
@@ -290,7 +325,7 @@ int sceAppMgrLoadExec(const char *appPath, char * const argv[],
*
* @note If flags != 0x20000, Livearea is opened.
*/
-int sceAppMgrLaunchAppByUri(int flags, char *uri);
+int sceAppMgrLaunchAppByUri(int flags, const char *uri);
/**
* Start an application by Title ID
@@ -325,7 +360,7 @@ SceUID sceAppMgrLaunchAppByName2ForShell(const char *name, const char *param, Sc
* @return 0 on success, < 0 on error.
*
*/
-int sceAppMgrGameDataMount(const char *path, int unk1, int unk2, char *mount_point);
+int sceAppMgrGameDataMount(const char *path, int unk1, int unk2, const char *mount_point);
/**
* Mount application data
@@ -337,7 +372,7 @@ int sceAppMgrGameDataMount(const char *path, int unk1, int unk2, char *mount_poi
*
* @note id: 100 (photo0), 101 (friends), 102 (messages), 103 (near), 105 (music), 108 (calendar)
*/
-int sceAppMgrAppDataMount(int id, char *mount_point);
+int sceAppMgrAppDataMount(int id, const char *mount_point);
/**
* Mount application data by Title ID
@@ -350,7 +385,7 @@ int sceAppMgrAppDataMount(int id, char *mount_point);
*
* @note id: 106 (ad), 107 (ad)
*/
-int sceAppMgrAppDataMountById(int id, char *titleid, char *mount_point);
+int sceAppMgrAppDataMountById(int id, const char *titleid, const char *mount_point);
/**
* Get application params from SFO descriptor
@@ -362,7 +397,7 @@ int sceAppMgrAppDataMountById(int id, char *titleid, char *mount_point);
*
* @return 0 on success, < 0 on error.
*
- * @note param: 8 (category), 9 (stitle/title?), 10 (title/stitle?), 12 (titleid)
+ * @note param: 6 (contentid) 8 (category), 9 (stitle/title?), 10 (title/stitle?), 12 (titleid)
*/
int sceAppMgrAppParamGetString(int pid, int param, char *string, int length);
@@ -377,7 +412,7 @@ int sceAppMgrAppParamGetString(int pid, int param, char *string, int length);
*
* @note dev: ux0:
*/
-int sceAppMgrGetDevInfo(char *dev, uint64_t *max_size, uint64_t *free_size);
+int sceAppMgrGetDevInfo(const char *dev, uint64_t *max_size, uint64_t *free_size);
/**
* Mount application data (PSPEmu)
@@ -389,7 +424,7 @@ int sceAppMgrGetDevInfo(char *dev, uint64_t *max_size, uint64_t *free_size);
*
* @note id: 400 (ad), 401 (ad), 402 (ad)
*/
-int sceAppMgrMmsMount(int id, char *mount_point);
+int sceAppMgrMmsMount(int id, const char *mount_point);
/**
* Mount PSPEmu virtual memory stick
@@ -400,7 +435,7 @@ int sceAppMgrMmsMount(int id, char *mount_point);
*
* @note mount_point: ms
*/
-int sceAppMgrPspSaveDataRootMount(char *mount_point);
+int sceAppMgrPspSaveDataRootMount(const char *mount_point);
/**
* Mount working directory
@@ -412,7 +447,7 @@ int sceAppMgrPspSaveDataRootMount(char *mount_point);
*
* @note id: 200 (td), 201 (td), 203 (td), 204 (td), 206 (td)
*/
-int sceAppMgrWorkDirMount(int id, char *mount_point);
+int sceAppMgrWorkDirMount(int id, const char *mount_point);
/**
* Mount working directory by Title ID
@@ -425,7 +460,7 @@ int sceAppMgrWorkDirMount(int id, char *mount_point);
*
* @note id: 205 (cache0), 207 (td)
*/
-int sceAppMgrWorkDirMountById(int id, char *titleid, char *mount_point);
+int sceAppMgrWorkDirMountById(int id, const char *titleid, const char *mount_point);
/**
* Unmount a mountpoint
@@ -460,6 +495,35 @@ int sceAppMgrConvertVs0UserDrivePath(char *path, char *mount_point, int unk);
*/
int sceAppMgrGetRawPath(char *path, char *mount_point, char *unk);
+/**
+ * Resolve a path to the corresponding true path (uses ::sceFiosKernelOverlayResolveSync underneath).
+ *
+ * @param[in] path - Path to convert (e.g. app0:)
+ * @param[out] resolved_path - True resolved path
+ * @param[in] unk - Unknown, provide an empty buffer
+ *
+ * @return 0 on success, < 0 on error.
+ */
+int _sceAppMgrGetRawPath(char *path, char *resolved_path, int resolved_path_size, char unk[16]);
+
+/**
+ * Get the real/resolved path of app0: (where it's actually mounted)
+ *
+ * @param[in] appId - Use -2 for the current application
+ * @param[out] resolved_path - Buffer that will hold the resolved path. It should have enough room to hold 292 characters or it will buffer overflow (noname120).
+ *
+ * @return 0 on success.
+ */
+int _sceAppMgrGetRawPathOfApp0ByAppIdForShell(int appId, char resolved_path[292]);
+
+/**
+ * Get application memory budget info.
+ *
+ * @return 0 on success, < 0 on error.
+ *
+ */
+int sceAppMgrGetBudgetInfo(SceAppMgrBudgetInfo *info);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/user/avconfig.h b/include/user/avconfig.h
index 947af3c..d171647 100644
--- a/include/user/avconfig.h
+++ b/include/user/avconfig.h
@@ -7,7 +7,7 @@
extern "C" {
#endif
-/***
+/**
* Get the maximum brightness.
*
* @param[out] maxBrightness - Maximum brightness.
@@ -16,7 +16,7 @@ extern "C" {
*/
int sceAVConfigGetDisplayMaxBrightness(int *maxBrightness);
-/***
+/**
* Set the screen brightness.
*
* @param brightness - Brightness that the screen will be set to (range 21-65536, 0 turns off the screen).
@@ -25,7 +25,7 @@ int sceAVConfigGetDisplayMaxBrightness(int *maxBrightness);
*/
int sceAVConfigSetDisplayBrightness(int brightness);
-/***
+/**
* Get the shutter volume.
*
* @param[out] volume - shutter volume.
@@ -34,7 +34,7 @@ int sceAVConfigSetDisplayBrightness(int brightness);
*/
int sceAVConfigGetShutterVol(int *volume);
-/***
+/**
* Get the system volume.
*
* @param[out] volume - System volume.
@@ -43,7 +43,7 @@ int sceAVConfigGetShutterVol(int *volume);
*/
int sceAVConfigGetSystemVol(int *volume);
-/***
+/**
* Set the system volume.
*
* @param volume - volume that the device will be set to (range 0-30).
diff --git a/include/user/compat.h b/include/user/compat.h
index a7e2283..9a4786e 100644
--- a/include/user/compat.h
+++ b/include/user/compat.h
@@ -11,8 +11,9 @@ extern "C" {
#endif
typedef enum SceCompatCacheMode {
- SCE_COMPAT_CACHE_NONE = 1,
- SCE_COMPAT_CACHE_INVALIDATE = 2
+ SCE_COMPAT_CACHE_NONE = 0,
+ SCE_COMPAT_CACHE_INVALIDATE = 1,
+ SCE_COMPAT_CACHE_WRITEBACK = 2
} SceCompatCacheMode;
typedef enum SceCompatPeripheralMode {
@@ -105,7 +106,7 @@ int sceCompatSetSuspendSema(SceUID semaid1, SceUID semaid2);
int sceCompatSuspendResume(int unk);
/**
- * Cache invalidate
+ * Cache operation
*
* @param[in] mode - One of ::SceCompatCacheMode
* @param[in] addr - Address
diff --git a/include/user/ctrl.h b/include/user/ctrl.h
index 0d1b02c..4758f6c 100644
--- a/include/user/ctrl.h
+++ b/include/user/ctrl.h
@@ -20,6 +20,7 @@ typedef enum SceCtrlErrorCode {
/** Enumeration for the digital controller buttons.
* @note - L1/R1/L3/R3 only can bind using ::sceCtrlPeekBufferPositiveExt2 and ::sceCtrlReadBufferPositiveExt2
* @note - Values bigger than 0x00010000 can be intercepted only with shell privileges
+ * @note - Vita's L Trigger and R Trigger are mapped to L1 and R1 when using ::sceCtrlPeekBufferPositiveExt2 and ::sceCtrlReadBufferPositiveExt2
*/
typedef enum SceCtrlButtons {
SCE_CTRL_SELECT = 0x00000001, //!< Select button.
@@ -298,7 +299,7 @@ int sceCtrlGetBatteryInfo(int port, SceUInt8 *batt);
* having the input sent to the game thread.
* @param[in] intercept Boolean value
*
- * @return 0, < 0 on error
+ * @return 0, < 0 on error
*/
int sceCtrlSetButtonIntercept(int intercept);
@@ -307,9 +308,17 @@ int sceCtrlSetButtonIntercept(int intercept);
*
* @param[out] intercept Boolean value
*
- * @return 0, < 0 on error
+ * @return 0, < 0 on error
*/
int sceCtrlGetButtonIntercept(int *intercept);
+
+/**
+ * Check if multi controller is supported
+ *
+ * @return 1 if yes, 0 if no
+ */
+int sceCtrlIsMultiControllerSupported(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/user/incoming_dialog.h b/include/user/incoming_dialog.h
new file mode 100644
index 0000000..616b89e
--- /dev/null
+++ b/include/user/incoming_dialog.h
@@ -0,0 +1,83 @@
+#ifndef _DOLCESDK_PSP2_INCOMING_DIALOG_H_
+#define _DOLCESDK_PSP2_INCOMING_DIALOG_H_
+
+#include <psp2/kernel/clib.h>
+#include <psp2/scebase.h>
+#include <psp2/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Dialog status
+ */
+typedef enum SceIncomingDialogStatus {
+ SCE_INCOMING_DIALOG_NOT_RUNNING,
+ SCE_INCOMING_DIALOG_BUSY,
+ SCE_INCOMING_DIALOG_RUNNING,
+ SCE_INCOMING_DIALOG_ACCEPTED,
+ SCE_INCOMING_DIALOG_REJECTED,
+ SCE_INCOMING_DIALOG_CLOSED,
+ SCE_INCOMING_DIALOG_TIMEOUT,
+} SceIncomingDialogStatus;
+
+/**
+ * Errors
+ */
+#define SCE_INCOMING_DIALOG_ERROR_INVALID_ARG 0x80106202;
+
+typedef struct SceIncomingDialogParam {
+ SceInt32 sdkVersion;
+ SceChar8 titleid[0x10]; // TitleId of the application to open when "accept" button has been pressed. Can be all zero.
+ SceChar8 audioPath[0x80]; // Path to audio file that will be played during dialog, .mp3, .at9, m4a. Can be all zero.
+ SceUInt32 dialogTimer; // Time to show dialog in seconds
+ SceInt32 unk_BC; // Can be set to 0
+ SceChar8 reserved1[0x3E];
+ SceWChar16 buttonRightText[0x20]; // Text for "accept" button. Must be null-terminated.
+ SceWChar16 buttonLeftText[0x20]; // Text for "reject" button. Must be null-terminated. If all zero, only "accept" button will be created.
+ SceWChar16 dialogText[0x81]; // Text for dialog window, also shared with notification. Must be null-terminated.
+} SceIncomingDialogParam;
+
+/**
+ * Initialize incoming dialog library, initType must be 0.
+ */
+SceInt32 sceIncomingDialogInit(int initType);
+
+/**
+ * Open incoming dialog.
+ */
+SceInt32 sceIncomingDialogOpen(SceIncomingDialogParam* dialogParam);
+
+/**
+ * Returns current status of incoming dialog.
+ */
+SceInt32 sceIncomingDialogGetStatus(void);
+
+/**
+ * Force exit to LiveArea and show dialog window
+ */
+SceInt32 sceIncomingDialogSwitchToDialog(void);
+
+/**
+ * Close incoming dialog.
+ */
+SceInt32 sceIncomingDialogClose(void);
+
+/**
+ * Terminate incoming dialog library
+ */
+SceInt32 sceIncomingDialogTerm(void);
+
+static inline
+void sceIncomingDialogParamInit(SceIncomingDialogParam* dialogParam)
+{
+ sceClibMemset(dialogParam, 0x0, sizeof(SceIncomingDialogParam));
+ dialogParam->sdkVersion = SCE_PSP2_SDK_VERSION;
+}
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _DOLCESDK_PSP2_INCOMING_DIALOG_H_ */
diff --git a/include/user/jpegarm.h b/include/user/jpegarm.h
new file mode 100644
index 0000000..6a5f5c7
--- /dev/null
+++ b/include/user/jpegarm.h
@@ -0,0 +1,103 @@
+#ifndef _DOLCESDK_PSP2_JPEGARM_H_
+#define _DOLCESDK_PSP2_JPEGARM_H_
+
+#include <psp2/types.h>
+#include <psp2/jpeg.h>
+
+#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
+extern "C" {
+#endif
+
+/* Error codes */
+#define SCE_JPEG_ARM_OK (SCE_JPEG_OK)
+
+#define SCE_JPEG_ARM_ERROR_IMAGE_EMPTY (SCE_JPEG_ERROR_IMAGE_EMPTY | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_MARKER_LENGTH (SCE_JPEG_ERROR_BAD_MARKER_LENGTH | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_DHT_COUNTS (SCE_JPEG_ERROR_BAD_DHT_COUNTS | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_DHT_INDEX (SCE_JPEG_ERROR_BAD_DHT_INDEX | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_DQT_INDEX (SCE_JPEG_ERROR_BAD_DQT_INDEX | 0x100)
+#define SCE_JPEG_ARM_ERROR_DECODE_ERROR (SCE_JPEG_ERROR_DECODE_ERROR | 0x100)
+#define SCE_JPEG_ARM_ERROR_INVALID_POINTER (SCE_JPEG_ERROR_INVALID_POINTER | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_COMPONENT_ID (SCE_JPEG_ERROR_BAD_COMPONENT_ID | 0x100)
+#define SCE_JPEG_ARM_ERROR_UNSUPPORT_COLORSPACE (SCE_JPEG_ERROR_UNSUPPORT_COLORSPACE | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_MCU_SIZE (SCE_JPEG_ERROR_BAD_MCU_SIZE | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_PRECISION (SCE_JPEG_ERROR_BAD_PRECISION | 0x100)
+#define SCE_JPEG_ARM_ERROR_UNSUPPORT_SAMPLING (SCE_JPEG_ERROR_UNSUPPORT_SAMPLING | 0x100)
+#define SCE_JPEG_ARM_ERROR_COMPONENT_COUNT (SCE_JPEG_ERROR_COMPONENT_COUNT | 0x100)
+#define SCE_JPEG_ARM_ERROR_EOI_EXPECTED (SCE_JPEG_ERROR_EOI_EXPECTED | 0x100)
+#define SCE_JPEG_ARM_ERROR_UNSUPPORT_IMAGE_SIZE (SCE_JPEG_ERROR_UNSUPPORT_IMAGE_SIZE | 0x100)
+#define SCE_JPEG_ARM_ERROR_NO_HUFF_TABLE (SCE_JPEG_ERROR_NO_HUFF_TABLE | 0x100)
+#define SCE_JPEG_ARM_ERROR_NO_QUANT_TABLE (SCE_JPEG_ERROR_NO_QUANT_TABLE | 0x100)
+#define SCE_JPEG_ARM_ERROR_NO_SOI (SCE_JPEG_ERROR_NO_SOI | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_DHT_MARKER (SCE_JPEG_ERROR_BAD_DHT_MARKER | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_DRI_MARKER (SCE_JPEG_ERROR_BAD_DRI_MARKER | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_SOF_MARKER (SCE_JPEG_ERROR_BAD_SOF_MARKER | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_SOS_MARKER (SCE_JPEG_ERROR_BAD_SOS_MARKER | 0x100)
+#define SCE_JPEG_ARM_ERROR_SOF_DUPLICATE (SCE_JPEG_ERROR_SOF_DUPLICATE | 0x100)
+#define SCE_JPEG_ARM_ERROR_NO_LOSSLESS_SUPPORT (SCE_JPEG_ERROR_NO_LOSSLESS_SUPPORT | 0x100)
+#define SCE_JPEG_ARM_ERROR_NO_ARITH_SUPPORT (SCE_JPEG_ERROR_NO_ARITH_SUPPORT | 0x100)
+#define SCE_JPEG_ARM_ERROR_UNKNOWN_MARKER (SCE_JPEG_ERROR_UNKNOWN_MARKER | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_RESTART_MARKER (SCE_JPEG_ERROR_BAD_RESTART_MARKER | 0x100)
+#define SCE_JPEG_ARM_ERROR_UNEXPECTED_MARKER (SCE_JPEG_ERROR_UNEXPECTED_MARKER | 0x100)
+#define SCE_JPEG_ARM_ERROR_INVALID_REGION (SCE_JPEG_ERROR_INVALID_REGION | 0x100)
+#define SCE_JPEG_ARM_ERROR_INVALID_STATE (SCE_JPEG_ERROR_INVALID_STATE | 0x100)
+#define SCE_JPEG_ARM_ERROR_CANNOT_CONTINUE (SCE_JPEG_ERROR_CANNOT_CONTINUE | 0x100)
+#define SCE_JPEG_ARM_ERROR_MEMORY_SIZE (SCE_JPEG_ERROR_MEMORY_SIZE | 0x100)
+#define SCE_JPEG_ARM_ERROR_INVALID_COLOR_FORMAT (SCE_JPEG_ERROR_INVALID_COLOR_FORMAT | 0x100)
+#define SCE_JPEG_ARM_ERROR_INVALID_DECODE_MODE (SCE_JPEG_ERROR_INVALID_DECODE_MODE | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_PROGRESSIVE_PARAM (SCE_JPEG_ERROR_BAD_PROGRESSIVE_PARAM | 0x100)
+#define SCE_JPEG_ARM_ERROR_INIT_DONE (SCE_JPEG_ERROR_INIT_DONE | 0x100)
+#define SCE_JPEG_ARM_ERROR_INPUT_SUSPENDED (SCE_JPEG_ERROR_INPUT_SUSPENDED | 0x100)
+#define SCE_JPEG_ARM_ERROR_INPUT_DATA_TOO_BIG (SCE_JPEG_ERROR_INPUT_DATA_TOO_BIG | 0x100)
+#define SCE_JPEG_ARM_ERROR_INVALID_DATA_SIZE (SCE_JPEG_ERROR_INVALID_DATA_SIZE | 0x100)
+
+/* for backward compatibility */
+#define SCE_JPEG_ARM_ERROR_UNSUPPORT_DOWNSCALE (SCE_JPEG_ARM_ERROR_INVALID_DECODE_MODE)
+#define SCE_JPEG_ARM_ERROR_OUT_OF_MEMORY (SCE_JPEG_ARM_ERROR_MEMORY_SIZE)
+
+/* Decode JPEG data to RGBA format */
+int sceJpegArmDecodeMJpeg(
+ const unsigned char *pJpeg,
+ SceSize isize,
+ void *pRGBA,
+ SceSize osize,
+ int decodeMode,
+ void *pCoefBuffer,
+ SceSize coefBufferSize);
+
+/* Decode JPEG data (no color conversion) */
+int sceJpegArmDecodeMJpegYCbCr(
+ const unsigned char *pJpeg,
+ SceSize isize,
+ unsigned char *pYCbCr,
+ SceSize osize,
+ int decodeMode,
+ void *pCoefBuffer,
+ SceSize coefBufferSize);
+
+/* tempBufferSize is always 0, even when using colour space conversion */
+typedef SceJpegOutputInfo SceJpegArmOutputInfo;
+
+/* Return color space and each buffer sizes required when decoding a JPEG image */
+int sceJpegArmGetOutputInfo(
+ const unsigned char *pJpeg,
+ SceSize isize,
+ int outputFormat,
+ int decodeMode,
+ SceJpegArmOutputInfo *pOutputInfo);
+
+/* Split decoder (control struct is different from sceJpeg, no reference anywhere in the apps)
+ * These functions cannot be used at the moment.
+ */
+
+int sceJpegArmCreateSplitDecoder(void *pCtrl);
+int sceJpegArmDeleteSplitDecoder(void *pCtrl);
+
+int sceJpegArmSplitDecodeMJpeg(void *pCtrl);
+
+#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
+}
+#endif
+
+#endif /* _DOLCESDK_PSP2_JPEGARM_H_ */
+
diff --git a/include/user/kernel/clib.h b/include/user/kernel/clib.h
index 6db799d..b22eb3f 100644
--- a/include/user/kernel/clib.h
+++ b/include/user/kernel/clib.h
@@ -8,21 +8,47 @@
extern "C" {
#endif
-int sceClibStrcmp(const char *, const char *);
-void *sceClibStrncmp(const char *, const char *, SceSize);
-int sceClibStrncasecmp(const char *, const char *, SceSize);
-char *sceClibStrncpy(char *, const char *, SceSize);
-char *sceClibStrncat(char *, const char *, SceSize);
-SceSize sceClibStrnlen(const char *, SceSize);
-char *sceClibStrrchr(const char *, int);
-
-int sceClibPrintf(const char *, ...);
-int sceClibSnprintf(char *, SceSize, const char *, ...);
-int sceClibVsnprintf(char *, SceSize, const char *, va_list);
-
-void *sceClibMemset(void *, int, SceSize);
-void *sceClibMemcpy(void *, const void *, SceSize);
-void *sceClibMemmove(void *, const void *, SceSize);
+/**
+ * Run bkpt #0x88 and end the process in state -1
+ *
+ * @return none
+ */
+void sceClibAbort(void);
+
+char sceClibLookCtypeTable(char ch);
+
+int sceClibTolower(char ch);
+int sceClibToupper(char ch);
+
+int sceClibPrintf(const char *fmt, ...);
+int sceClibVprintf(const char *fmt, va_list args);
+int sceClibSnprintf(char *dst, SceSize dst_max_size, const char *fmt, ...);
+int sceClibVsnprintf(char *dst, SceSize dst_max_size, const char *fmt, va_list args);
+
+char *sceClibStrncpy(char *dst, const char *src, SceSize len);
+char *sceClibStrncat(char *dst, const char *src, SceSize len);
+
+char *sceClibStrrchr(const char *src, int ch);
+char *sceClibStrstr(const char *s1, const char *s2);
+
+int sceClibStrcmp(const char *s1, const char *s2);
+int sceClibStrncmp(const char *s1, const char *s2, SceSize len);
+int sceClibStrncasecmp(const char *s1, const char *s2, SceSize len);
+
+SceSize sceClibStrnlen(const char *s1, SceSize max_len);
+
+void *sceClibMemset(void *dst, int ch, SceSize len);
+void *sceClibMemcpy(void *dst, const void *src, SceSize len);
+void *sceClibMemcpy_safe(void *dst, const void *src, SceSize len);
+void *sceClibMemmove(void *dst, const void *src, SceSize len);
+
+int sceClibMemcmp(const void *s1, const void *s2, SceSize len);
+
+void *sceClibMemchr(const void *src, int ch, SceSize len);
+
+void *sceClibMspaceCreate(void *base, SceSize size);
+void *sceClibMspaceMalloc(void *space, SceSize size);
+void sceClibMspaceFree(void *space, void *ptr);
#ifdef __cplusplus
}
diff --git a/include/user/kernel/dmac.h b/include/user/kernel/dmac.h
index b0fbd2b..0047d6f 100644
--- a/include/user/kernel/dmac.h
+++ b/include/user/kernel/dmac.h
@@ -1,11 +1,13 @@
#ifndef _PSP2_DMAC_H_
#define _PSP2_DMAC_H_
+#include <stddef.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-/***
+/**
* DMA memcpy
*
* @param[in] dst - Destination
@@ -16,7 +18,7 @@ extern "C" {
*/
void *sceDmacMemcpy(void *dst, const void *src, size_t size);
-/***
+/**
* DMA memset
*
* @param[in] dst - Destination
diff --git a/include/user/kernel/modulemgr.h b/include/user/kernel/modulemgr.h
index 4ea55d3..3aa6f30 100644
--- a/include/user/kernel/modulemgr.h
+++ b/include/user/kernel/modulemgr.h
@@ -22,33 +22,34 @@ extern "C" {
/** @} */
typedef struct SceKernelSegmentInfo {
- SceUInt size; //!< sizeof(SceKernelSegmentInfo)
- SceUInt perms; //!< probably rwx in low bits
- void *vaddr; //!< address in memory
- SceUInt memsz; //!< size in memory
- SceUInt flags; //!< meaning unknown
- SceUInt res; //!< unused?
+ SceSize size; //!< this structure size (0x18)
+ SceUInt perms; //!< probably rwx in low bits
+ void *vaddr; //!< address in memory
+ SceSize memsz; //!< size in memory
+ SceSize filesz; //!< original size of memsz
+ SceUInt res; //!< unused
} SceKernelSegmentInfo;
typedef struct SceKernelModuleInfo {
- SceUInt size; //!< 0x1B8 for Vita 1.x
- SceUInt handle; //!< kernel module handle?
- SceUInt flags; //!< some bits. could be priority or whatnot
- char module_name[28];
- SceUInt unk28;
- void *module_start;
- SceUInt unk30;
- void *module_stop;
- void *exidxTop;
- void *exidxBtm;
- SceUInt unk40;
- SceUInt unk44;
- void *tlsInit;
- SceSize tlsInitSize;
- SceSize tlsAreaSize;
- char path[256];
- SceKernelSegmentInfo segments[4];
- SceUInt type; //!< 6 = user-mode PRX?
+ SceSize size; //!< 0x1B8 for Vita 1.x
+ SceUID modid;
+ uint16_t modattr;
+ uint8_t modver[2];
+ char module_name[28];
+ SceUInt unk28;
+ void *start_entry;
+ void *stop_entry;
+ void *exit_entry;
+ void *exidx_top;
+ void *exidx_btm;
+ void *extab_top;
+ void *extab_btm;
+ void *tlsInit;
+ SceSize tlsInitSize;
+ SceSize tlsAreaSize;
+ char path[256];
+ SceKernelSegmentInfo segments[4];
+ SceUInt type; //!< 6 = user-mode PRX?
} SceKernelModuleInfo;
typedef struct SceKernelLMOption {
@@ -62,21 +63,18 @@ typedef struct SceKernelULMOption {
int sceKernelGetModuleList(int flags, SceUID *modids, int *num);
int sceKernelGetModuleInfo(SceUID modid, SceKernelModuleInfo *info);
-SceUID sceKernelLoadModule(char *path, int flags, SceKernelLMOption *option);
+SceUID sceKernelLoadModule(const char *path, int flags, SceKernelLMOption *option);
int sceKernelUnloadModule(SceUID modid, int flags, SceKernelULMOption *option);
int sceKernelStartModule(SceUID modid, SceSize args, void *argp, int flags, void *option, int *status);
int sceKernelStopModule(SceUID modid, SceSize args, void *argp, int flags, void *option, int *status);
-SceUID sceKernelLoadStartModule(char *path, SceSize args, void *argp, int flags, SceKernelLMOption *option, int *status);
+SceUID sceKernelLoadStartModule(const char *path, SceSize args, void *argp, int flags, SceKernelLMOption *option, int *status);
int sceKernelStopUnloadModule(SceUID modid, SceSize args, void *argp, int flags, SceKernelULMOption *option, int *status);
typedef struct SceKernelFwInfo {
SceSize size;
- char versionString[16];
- SceUInt unk_14;
- SceUInt unk_18;
- SceUInt unk_1C;
+ char versionString[0x1C];
SceUInt version;
SceUInt unk_24;
} SceKernelFwInfo;
diff --git a/include/user/kernel/processmgr.h b/include/user/kernel/processmgr.h
index cbce339..e515f60 100644
--- a/include/user/kernel/processmgr.h
+++ b/include/user/kernel/processmgr.h
@@ -31,7 +31,7 @@ typedef enum SceKernelPowerTickType {
SCE_KERNEL_POWER_TICK_DISABLE_OLED_DIMMING = 6
} SceKernelPowerTickType;
-/***
+/**
* Exit current Process with specified return code
*
* @param[in] res - Exit code to return
@@ -40,7 +40,7 @@ typedef enum SceKernelPowerTickType {
*/
int sceKernelExitProcess(int res);
-/***
+/**
* Cancel specified idle timers to prevent entering in power save processing.
*
* @param[in] type - One of ::SceKernelPowerTickType
@@ -49,7 +49,7 @@ int sceKernelExitProcess(int res);
*/
int sceKernelPowerTick(SceKernelPowerTickType type);
-/***
+/**
* Locks certain timers from triggering.
*
* @param[in] type - One of ::SceKernelPowerTickType
@@ -58,7 +58,7 @@ int sceKernelPowerTick(SceKernelPowerTickType type);
*/
int sceKernelPowerLock(SceKernelPowerTickType type);
-/***
+/**
* Unlocks certain timers.
*
* @param[in] type - One of ::SceKernelPowerTickType
@@ -67,7 +67,7 @@ int sceKernelPowerLock(SceKernelPowerTickType type);
*/
int sceKernelPowerUnlock(SceKernelPowerTickType type);
-/***
+/**
* Get the process time of the current process.
*
* @param[out] type - Pointer to a ::SceKernelSysClock structure which will receive the process time.
@@ -76,27 +76,20 @@ int sceKernelPowerUnlock(SceKernelPowerTickType type);
*/
int sceKernelGetProcessTime(SceKernelSysClock *pSysClock);
-/***
+/**
* Get the lower 32 bits part of process time of the current process.
*
* @return process time of the current process
*/
SceUInt32 sceKernelGetProcessTimeLow(void);
-/***
+/**
* Get the process time of the current process.
*
* @return process time of the current process
*/
SceUInt64 sceKernelGetProcessTimeWide(void);
-/***
- * Get the process ID of the current process.
- *
- * @return process ID of the current process
- */
-SceUID sceKernelGetProcessId(void);
-
#ifdef __cplusplus
}
#endif
diff --git a/include/user/kernel/rng.h b/include/user/kernel/rng.h
index 88e0267..177e662 100644
--- a/include/user/kernel/rng.h
+++ b/include/user/kernel/rng.h
@@ -5,7 +5,7 @@
extern "C" {
#endif
-/***
+/**
* Fills the output buffer with random data.
*
* @param[out] output - Output buffer
diff --git a/include/user/kernel/sysmem.h b/include/user/kernel/sysmem.h
index 1930012..404e810 100644
--- a/include/user/kernel/sysmem.h
+++ b/include/user/kernel/sysmem.h
@@ -1,19 +1,20 @@
#ifndef _PSP2_KERNEL_SYSMEM_H_
#define _PSP2_KERNEL_SYSMEM_H_
-#include <psp2/types.h>
+#include <psp2/kernel/types.h>
#ifdef __cplusplus
extern "C" {
#endif
-typedef enum SceKernelMemBlockType {
+typedef enum _SceKernelMemBlockType {
SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE = 0x0C208060,
+ SCE_KERNEL_MEMBLOCK_TYPE_USER_RX = 0x0C20D050,
SCE_KERNEL_MEMBLOCK_TYPE_USER_RW = 0x0C20D060,
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_RW = 0x0C80D060,
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW = 0x0D808060,
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW = 0x09408060
-} SceKernelMemBlockType;
+} _SceKernelMemBlockType;
typedef struct SceKernelAllocMemBlockOpt {
SceSize size;
@@ -25,6 +26,13 @@ typedef struct SceKernelAllocMemBlockOpt {
int reserved[10];
} SceKernelAllocMemBlockOpt;
+typedef struct SceKernelFreeMemorySizeInfo {
+ int size; //!< sizeof(SceKernelFreeMemorySizeInfo)
+ int size_user; //!< Free memory size for *_USER_RW memory
+ int size_cdram; //!< Free memory size for USER_CDRAM_RW memory
+ int size_phycont; //!< Free memory size for USER_MAIN_PHYCONT_*_RW memory
+} SceKernelFreeMemorySizeInfo;
+
typedef enum SceKernelModel {
SCE_KERNEL_MODEL_VITA = 0x10000,
SCE_KERNEL_MODEL_VITATV = 0x20000
@@ -50,7 +58,7 @@ typedef enum SceKernelMemoryType {
SCE_KERNEL_MEMORY_TYPE_NORMAL = 0xD0
} SceKernelMemoryType;
-/***
+/**
* Allocates a new memory block
*
* @param[in] name - Name for the memory block
@@ -62,7 +70,7 @@ typedef enum SceKernelMemoryType {
*/
SceUID sceKernelAllocMemBlock(const char *name, SceKernelMemBlockType type, int size, SceKernelAllocMemBlockOpt *optp);
-/***
+/**
* Frees new memory block
*
* @param[in] uid - SceUID of the memory block to free
@@ -71,7 +79,7 @@ SceUID sceKernelAllocMemBlock(const char *name, SceKernelMemBlockType type, int
*/
int sceKernelFreeMemBlock(SceUID uid);
-/***
+/**
* Gets the base address of a memory block
*
* @param[in] uid - SceUID of the memory block to free
@@ -94,19 +102,29 @@ int sceKernelCloseVMDomain(void);
int sceKernelOpenMemBlock(const char *name, int flags);
int sceKernelCloseMemBlock(SceUID uid);
-/***
+/**
* Get the model number of the device
*
* @return A value from SCE_KERNEL_MODEL
*/
-int sceKernelGetModelForCDialog();
+int sceKernelGetModelForCDialog(void);
-/***
+/**
* Get the model number of the device
*
* @return A value from SCE_KERNEL_MODEL
*/
-int sceKernelGetModel();
+int sceKernelGetModel(void);
+
+/**
+ * Get free memory size in bytes
+ *
+ * @param[out] info - Returned free memory size for different kind of memory block types
+ * @return 0 on success, < 0 on error.
+*/
+int sceKernelGetFreeMemorySize(SceKernelFreeMemorySizeInfo *info);
+
+int sceKernelIsPSVitaTV(void);
#ifdef __cplusplus
}
diff --git a/include/user/kernel/threadmgr.h b/include/user/kernel/threadmgr.h
index 6535d85..361ec71 100644
--- a/include/user/kernel/threadmgr.h
+++ b/include/user/kernel/threadmgr.h
@@ -1,77 +1,51 @@
#ifndef _PSP2_KERNEL_THREADMGR_H_
#define _PSP2_KERNEL_THREADMGR_H_
-#include <psp2/types.h>
+#include <psp2common/kernel/threadmgr.h>
#ifdef __cplusplus
extern "C" {
#endif
-/** 64-bit system clock type. */
-typedef SceUInt64 SceKernelSysClock;
-
/* Threads. */
-typedef int (*SceKernelThreadEntry)(SceSize args, void *argp);
-
/** Additional options used when creating threads. */
-typedef struct SceKernelThreadOptParam {
+typedef struct _SceKernelThreadOptParam {
/** Size of the ::SceKernelThreadOptParam structure. */
- SceSize size;
- /** Attributes */
- SceUInt32 attr;
+ SceSize size;
+ SceUInt32 attr;
} SceKernelThreadOptParam;
/** Structure to hold the status information for a thread
* @see sceKernelGetThreadInfo
*/
-typedef struct SceKernelThreadInfo {
+typedef struct _SceKernelThreadInfo {
/** Size of the structure */
SceSize size;
- /** The UID of the process where the thread belongs */
- SceUID processId; //Needs confirmation
- /** Nul terminated name of the thread */
- char name[32];
- /** Thread attributes */
- SceUInt attr;
- /** Thread status */
- int status;
- /** Thread entry point */
+ SceUID processId;
+ char name[SCE_UID_NAMELEN+1];
+ SceUInt32 attr;
+ SceUInt32 status;
SceKernelThreadEntry entry;
- /** Thread stack pointer */
- void *stack;
- /** Thread stack size */
- int stackSize;
- /** Initial priority */
- int initPriority;
- /** Current priority */
- int currentPriority;
- /** Initial CPU affinity mask */
- int initCpuAffinityMask;
- /** Current CPU affinity mask */
- int currentCpuAffinityMask;
- /** Current CPU ID */
- int currentCpuId;
- /** Last executed CPU ID */
- int lastExecutedCpuId;
- /** Wait type */
- int waitType;
- /** Wait id */
+ void *pStack;
+ SceSize stackSize;
+ SceInt32 initPriority;
+ SceInt32 currentPriority;
+ SceInt32 initCpuAffinityMask;
+ SceInt32 currentCpuAffinityMask;
+ SceInt32 currentCpuId;
+ SceInt32 lastExecutedCpuId;
+ SceUInt32 waitType;
SceUID waitId;
- /** Exit status of the thread */
- int exitStatus;
- /** Number of clock cycles run */
+ SceInt32 exitStatus;
SceKernelSysClock runClocks;
- /** Interrupt preemption count */
- SceUInt intrPreemptCount;
- /** Thread preemption count */
- SceUInt threadPreemptCount;
- /** Thread release count */
- SceUInt threadReleaseCount;
+ SceUInt32 intrPreemptCount;
+ SceUInt32 threadPreemptCount;
+ SceUInt32 threadReleaseCount;
+ SceInt32 changeCpuCount;
/** Function notify callback UID */
- SceUID fNotifyCallback;
- /** Reserved */
- int reserved;
+ SceInt32 fNotifyCallback;
+ SceInt32 reserved;
} SceKernelThreadInfo;
/** Statistics about a running thread.
@@ -83,7 +57,7 @@ typedef struct SceKernelThreadRunStatus {
SceUID processId;
SceUID threadId;
int priority;
- } cpuInfo[4];
+ } cpuInfo[SCE_KERNEL_MAX_CPU];
} SceKernelThreadRunStatus;
/* Sure there must be more than this, but haven't seen them */
@@ -99,176 +73,185 @@ typedef enum SceThreadStatus {
/**
* Create a thread
*
- * @par Example:
- * @code
- * SceUID thid;
- * thid = sceKernelCreateThread("my_thread", threadFunc, 0x10000100, 0x10000, 0, 0, NULL);
- * @endcode
- *
- * @param name - An arbitrary thread name.
+ * @param pName - An arbitrary thread name.
* @param entry - The thread function to run when started.
* @param initPriority - The initial priority of the thread. Less if higher priority.
* @param stackSize - The size of the initial stack.
* @param attr - The thread attributes, zero or more of ::SceThreadAttributes.
* @param cpuAffinityMask - The CPU affinity mask
- * @param option - Additional options specified by ::SceKernelThreadOptParam.
+ * @param pOptParam - Additional options specified by ::SceKernelThreadOptParam.
* @return UID of the created thread, or an error code.
*/
-SceUID sceKernelCreateThread(const char *name, SceKernelThreadEntry entry, int initPriority,
- int stackSize, SceUInt attr, int cpuAffinityMask,
- const SceKernelThreadOptParam *option);
+SceUID sceKernelCreateThread(
+ const char *pName,
+ SceKernelThreadEntry entry,
+ SceInt32 initPriority,
+ SceSize stackSize,
+ SceUInt32 attr,
+ SceInt32 cpuAffinityMask,
+ const SceKernelThreadOptParam *pOptParam);
/**
* Delate a thread
*
- * @param thid - UID of the thread to be deleted.
+ * @param threadId - UID of the thread to be deleted.
*
* @return < 0 on error.
*/
-int sceKernelDeleteThread(SceUID thid);
+SceInt32 sceKernelDeleteThread(SceUID threadId);
/**
* Start a created thread
*
- * @param thid - Thread id from ::sceKernelCreateThread
- * @param arglen - Length of the data pointed to by argp, in bytes
- * @param argp - Pointer to the arguments.
+ * @param threadId - Thread id from ::sceKernelCreateThread
+ * @param argSize - Length of the data pointed to by argp, in bytes
+ * @param pArgBlock - Pointer to the arguments.
*/
-int sceKernelStartThread(SceUID thid, SceSize arglen, void *argp);
+SceInt32 sceKernelStartThread(SceUID threadId, SceSize argSize, const void *pArgBlock);
/**
* Exit a thread
*
- * @param status - Exit status.
+ * @param exitStatus - Exit status.
*/
-int sceKernelExitThread(int status);
+SceInt32 sceKernelExitThread(SceInt32 exitStatus);
/**
* Exit a thread and delete itself.
*
- * @param status - Exit status
+ * @param exitStatus - Exit status
*/
-int sceKernelExitDeleteThread(int status);
+SceInt32 sceKernelExitDeleteThread(SceInt32 exitStatus);
/**
* Wait until a thread has ended.
*
- * @param thid - Id of the thread to wait for.
- * @param stat - Exit status.
- * @param timeout - Timeout in microseconds (assumed).
+ * @param threadId - Id of the thread to wait for.
+ * @param pExitStatus - Exit status.
+ * @param pTimeout - Timeout in microseconds.
*
* @return < 0 on error.
*/
-int sceKernelWaitThreadEnd(SceUID thid, int *stat, SceUInt *timeout);
+SceInt32 sceKernelWaitThreadEnd(SceUID threadId, SceInt32 *pExitStatus, SceUInt32 *pTimeout);
/**
* Wait until a thread has ended and handle callbacks if necessary.
*
- * @param thid - Id of the thread to wait for.
- * @param stat - Exit status.
- * @param timeout - Timeout in microseconds (assumed).
+ * @param threadId - Id of the thread to wait for.
+ * @param pExitStatus - Exit status.
+ * @param pTimeout - Timeout in microseconds.
*
* @return < 0 on error.
*/
-int sceKernelWaitThreadEndCB(SceUID thid, int *stat, SceUInt *timeout);
+SceInt32 sceKernelWaitThreadEndCB(SceUID threadId, SceInt32 *pExitStatus, SceUInt32 *pTimeout);
/**
* Delay the current thread by a specified number of microseconds
*
- * @param delay - Delay in microseconds.
+ * @param usec - Delay in microseconds.
*
* @par Example:
* @code
* sceKernelDelayThread(1000000); // Delay for a second
* @endcode
*/
-int sceKernelDelayThread(SceUInt delay);
+SceInt32 sceKernelDelayThread(SceUInt32 usec);
/**
* Delay the current thread by a specified number of microseconds and handle any callbacks.
*
- * @param delay - Delay in microseconds.
+ * @param usec - Delay in microseconds.
*
* @par Example:
* @code
* sceKernelDelayThread(1000000); // Delay for a second
* @endcode
*/
-int sceKernelDelayThreadCB(SceUInt delay);
+SceInt32 sceKernelDelayThreadCB(SceUInt32 usec);
/**
* Modify the attributes of the current thread.
*
- * @param unknown - Set to 0.
- * @param attr - The thread attributes to modify. One of ::SceThreadAttributes.
+ * @param clearAttr - Bits to clear
+ * @param setAttr - Bits to set
*
* @return < 0 on error.
*/
-int sceKernelChangeCurrentThreadAttr(int unknown, SceUInt attr);
+SceInt32 sceKernelChangeCurrentThreadAttr(SceUInt32 clearAttr, SceUInt32 setAttr);
/**
* Change the threads current priority.
*
- * @param thid - The ID of the thread (from ::sceKernelCreateThread or ::sceKernelGetThreadId)
+ * @param threadId - The ID of the thread (from ::sceKernelCreateThread or ::sceKernelGetThreadId)
* @param priority - The new priority (the lower the number the higher the priority)
*
* @par Example:
* @code
- * int thid = sceKernelGetThreadId();
+ * int threadId = sceKernelGetThreadId();
* // Change priority of current thread to 16
* sceKernelChangeThreadPriority(thid, 16);
* @endcode
*
* @return 0 if successful, otherwise the error code.
*/
-int sceKernelChangeThreadPriority(SceUID thid, int priority);
+SceInt32 sceKernelChangeThreadPriority(SceUID threadId, SceInt32 priority);
+
+/**
+ * Change the threads current priority.
+ *
+ * @param threadId - The ID of the thread (from ::sceKernelCreateThread or ::sceKernelGetThreadId)
+ * @param priority - The new priority (the lower the number the higher the priority)
+ *
+ * @return old priority or error code
+ */
+SceInt32 sceKernelChangeThreadPriority2(SceUID threadId, SceInt32 priority);
/**
* Get the current thread Id
*
* @return The thread id of the calling thread.
*/
-int sceKernelGetThreadId(void);
+SceUID sceKernelGetThreadId(void);
/**
* Get the current priority of the thread you are in.
*
* @return The current thread priority
*/
-int sceKernelGetThreadCurrentPriority(void);
+SceInt32 sceKernelGetThreadCurrentPriority(void);
/**
* Get the exit status of a thread.
*
- * @param thid - The UID of the thread to check.
+ * @param threadId - The UID of the thread to check.
+ * @param pExitStatus - pointer to area to store result
*
- * @return The exit status
+ * @return 0 or <0 on error
*/
-int sceKernelGetThreadExitStatus(SceUID thid);
+SceInt32 sceKernelGetThreadExitStatus(SceUID threadId, SceInt32 *pExitStatus);
/**
- * Check the thread stack?
+ * Check remaining thread stack size
*
- * @return Unknown.
+ * @return Stack size at the time of function call
*/
-int sceKernelCheckThreadStack(void);
+SceSize sceKernelCheckThreadStack(void);
/**
* Get the free stack size for a thread.
*
- * @param thid - The thread ID. Seem to take current thread
- * if set to 0.
+ * @param threadId - The thread ID
*
* @return The free size.
*/
-int sceKernelGetThreadStackFreeSize(SceUID thid);
+SceSize sceKernelGetThreadStackFreeSize(SceUID threadId);
/**
* Get the status information for the specified thread.
*
- * @param thid - Id of the thread to get status
- * @param info - Pointer to the info structure to receive the data.
+ * @param threadId - Id of the thread to get status
+ * @param pInfo - Pointer to the info structure to receive the data.
* Note: The structures size field should be set to
* sizeof(SceKernelThreadInfo) before calling this function.
*
@@ -281,17 +264,41 @@ int sceKernelGetThreadStackFreeSize(SceUID thid);
* @endcode
* @return 0 if successful, otherwise the error code.
*/
-int sceKernelGetThreadInfo(SceUID thid, SceKernelThreadInfo *info);
+SceInt32 sceKernelGetThreadInfo(SceUID threadId, SceKernelThreadInfo *pInfo);
/**
* Retrive the runtime status of a thread.
*
- * @param thid - UID of the thread to retrieve status.
- * @param status - Pointer to a ::SceKernelThreadRunStatus struct to receive the runtime status.
+ * @param pStatus - Pointer to a ::SceKernelThreadRunStatus struct to receive the runtime status.
*
* @return 0 if successful, otherwise the error code.
*/
-int sceKernelGetThreadRunStatus(SceUID thid, SceKernelThreadRunStatus *status);
+SceInt32 sceKernelGetThreadRunStatus(SceKernelThreadRunStatus *pStatus);
+
+typedef SceInt32 (*SceKernelChangeStackFunction)(void *pArg);
+
+SceInt32 sceKernelCallWithChangeStack(
+ void *pBase,
+ SceSize size,
+ SceKernelChangeStackFunction changeStackFunc,
+ void *pCommon);
+
+SceInt32 sceKernelChangeThreadCpuAffinityMask(SceUID threadId, SceInt32 cpuAffinityMask);
+
+SceInt32 sceKernelGetThreadCpuAffinityMask(SceUID threadId);
+
+/**
+ * Get the process ID of the current thread.
+ *
+ * @return process ID of the current thread
+ */
+SceUID sceKernelGetProcessId(void);
+
+SceInt32 sceKernelCheckWaitableStatus(void);
+
+SceInt32 sceKernelChangeThreadVfpException(SceInt32 clearMask, SceInt32 setMask);
+
+SceInt32 sceKernelGetCurrentThreadVfpException(void);
/* Semaphores. */
@@ -311,7 +318,7 @@ typedef struct SceKernelSemaInfo {
/** The UID of the semaphore */
SceUID semaId;
/** NUL-terminated name of the semaphore. */
- char name[32];
+ char name[SCE_UID_NAMELEN + 1];
/** Attributes. */
SceUInt attr;
/** The initial count the semaphore was created with. */
@@ -335,20 +342,25 @@ typedef struct SceKernelSemaInfo {
*
* @param name - Specifies the name of the sema
* @param attr - Sema attribute flags (normally set to 0)
- * @param initVal - Sema initial value
- * @param maxVal - Sema maximum value
- * @param option - Sema options (normally set to 0)
+ * @param initCount - Sema initial value
+ * @param maxCount - Sema maximum value
+ * @param pOptParam - Sema options (normally set to 0)
* @return A semaphore id
*/
-SceUID sceKernelCreateSema(const char *name, SceUInt attr, int initVal, int maxVal, SceKernelSemaOptParam *option);
+SceUID sceKernelCreateSema(
+ const char *name,
+ SceUInt32 attr,
+ SceInt32 initCount,
+ SceInt32 maxCount,
+ SceKernelSemaOptParam *pOptParam);
/**
* Destroy a semaphore
*
- * @param semaid - The semaid returned from a previous create call.
- * @return Returns the value 0 if it's successful, otherwise -1
+ * @param semaId - The semaid returned from a previous create call.
+ * @return Returns the value 0 if it's successful, otherwise negative
*/
-int sceKernelDeleteSema(SceUID semaid);
+SceInt32 sceKernelDeleteSema(SceUID semaId);
/**
* Send a signal to a semaphore
@@ -356,77 +368,81 @@ int sceKernelDeleteSema(SceUID semaid);
* @par Example:
* @code
* // Signal the sema
- * sceKernelSignalSema(semaid, 1);
+ * sceKernelSignalSema(semaId, 1);
* @endcode
*
- * @param semaid - The sema id returned from ::sceKernelCreateSema
- * @param signal - The amount to signal the sema (i.e. if 2 then increment the sema by 2)
+ * @param semaId - The sema ID returned from ::sceKernelCreateSema
+ * @param signalCount - The amount to signal the sema (i.e. if 2 then increment the sema by 2)
*
* @return < 0 On error.
*/
-int sceKernelSignalSema(SceUID semaid, int signal);
+SceInt32 sceKernelSignalSema(SceUID semaId, SceInt32 signalCount);
/**
* Lock a semaphore
*
* @par Example:
* @code
- * sceKernelWaitSema(semaid, 1, 0);
+ * sceKernelWaitSema(semaId, 1, 0);
* @endcode
*
- * @param semaid - The sema id returned from ::sceKernelCreateSema
- * @param signal - The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
- * @param timeout - Timeout in microseconds (assumed).
+ * @param semaId - The sema id returned from ::sceKernelCreateSema
+ * @param needCount - The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
+ * @param pTimeout - Timeout in microseconds.
*
* @return < 0 on error.
*/
-int sceKernelWaitSema(SceUID semaid, int signal, SceUInt *timeout);
+SceInt32 sceKernelWaitSema(SceUID semaId, SceInt32 needCount, SceUInt32 *pTimeout);
/**
* Lock a semaphore and handle callbacks if necessary.
*
* @par Example:
* @code
- * sceKernelWaitSemaCB(semaid, 1, 0);
+ * sceKernelWaitSemaCB(semaId, 1, 0);
* @endcode
*
- * @param semaid - The sema id returned from ::sceKernelCreateSema
- * @param signal - The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
- * @param timeout - Timeout in microseconds (assumed).
+ * @param semaId - The sema id returned from ::sceKernelCreateSema
+ * @param needCount - The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
+ * @param pTimeout - Timeout in microseconds.
*
* @return < 0 on error.
*/
-int sceKernelWaitSemaCB(SceUID semaid, int signal, SceUInt *timeout);
+SceInt32 sceKernelWaitSemaCB(SceUID semaId, SceInt32 needCount, SceUInt32 *pTimeout);
/**
* Poll a semaphore.
*
- * @param semaid - UID of the semaphore to poll.
- * @param signal - The value to test for.
+ * @param semaId - UID of the semaphore to poll.
+ * @param needCount - The value to test for.
*
* @return < 0 on error.
*/
-int sceKernelPollSema(SceUID semaid, int signal);
+SceInt32 sceKernelPollSema(SceUID semaId, SceInt32 needCount);
/**
* Cancels a semaphore
*
- * @param semaid - The sema id returned from ::sceKernelCreateSema
+ * @param semaId - The sema id returned from ::sceKernelCreateSema
* @param setCount - The new lock count of the semaphore
- * @param numWaitThreads - Number of threads waiting for the semaphore
+ * @param pNumWaitThreads - Number of threads waiting for the semaphore
* @return < 0 On error.
*/
-int sceKernelCancelSema(SceUID semaid, int setCount, int *numWaitThreads);
+SceInt32 sceKernelCancelSema(SceUID semaId, SceInt32 setCount, SceUInt32 *pNumWaitThreads);
/**
* Retrieve information about a semaphore.
*
- * @param semaid - UID of the semaphore to retrieve info for.
- * @param info - Pointer to a ::SceKernelSemaInfo struct to receive the info.
+ * @param semaId - UID of the semaphore to retrieve info for.
+ * @param pInfo - Pointer to a ::SceKernelSemaInfo struct to receive the info.
*
* @return < 0 on error.
*/
-int sceKernelGetSemaInfo(SceUID semaid, SceKernelSemaInfo *info);
+SceInt32 sceKernelGetSemaInfo(SceUID semaId, SceKernelSemaInfo *pInfo);
+
+SceUID sceKernelOpenSema(const char *pName);
+
+SceInt32 sceKernelCloseSema(SceUID semaId);
/* Mutexes. */
@@ -435,7 +451,7 @@ int sceKernelGetSemaInfo(SceUID semaid, SceKernelSemaInfo *info);
typedef struct SceKernelMutexOptParam {
/** Size of the ::SceKernelMutexOptParam structure. */
SceSize size;
- int ceilingPriority;
+ SceInt32 ceilingPriority;
} SceKernelMutexOptParam;
/** Current state of a mutex.
@@ -447,17 +463,18 @@ typedef struct SceKernelMutexInfo {
/** The UID of the mutex. */
SceUID mutexId;
/** NUL-terminated name of the mutex. */
- char name[32];
+ char name[SCE_UID_NAMELEN + 1];
/** Attributes. */
- SceUInt attr;
+ SceUInt32 attr;
/** The initial count the mutex was created with. */
- int initCount;
+ SceInt32 initCount;
/** The current count. */
- int currentCount;
+ SceInt32 currentCount;
/** The UID of the current owner of the mutex. */
SceUID currentOwnerId;
/** The number of threads waiting on the mutex. */
- int numWaitThreads;
+ SceUInt32 numWaitThreads;
+ SceInt32 ceilingPriority;
} SceKernelMutexInfo;
/**
@@ -469,141 +486,125 @@ typedef struct SceKernelMutexInfo {
* mutexid = sceKernelCreateMutex("MyMutex", 0, 1, 1, 0);
* @endcode
*
- * @param name - Specifies the name of the mutex
+ * @param pName - Specifies the name of the mutex
* @param attr - Mutex attribute flags (normally set to 0)
* @param initCount - Mutex initial value
- * @param option - Mutex options (normally set to 0)
+ * @param pOptParam - Mutex options (normally set to 0)
* @return A mutex id
*/
-SceUID sceKernelCreateMutex(const char *name, SceUInt attr, int initCount, SceKernelMutexOptParam *option);
+SceUID sceKernelCreateMutex(
+ const char *pName,
+ SceUInt32 attr,
+ SceInt32 initCount,
+ const SceKernelMutexOptParam *pOptParam);
/**
* Destroy a mutex
*
- * @param mutexid - The mutex id returned from ::sceKernelCreateMutex
- * @return Returns the value 0 if it's successful, otherwise -1
+ * @param mutexId - The mutex id returned from ::sceKernelCreateMutex
+ * @return Returns the value 0 if it's successful, otherwise < 0
*/
-int sceKernelDeleteMutex(SceUID mutexid);
+SceInt32 sceKernelDeleteMutex(SceUID mutexId);
/**
* Open a mutex
*
- * @param name - The name of the mutex to open
- * @return Returns the value 0 if it's successful, otherwise -1
+ * @param pName - The name of the mutex to open
+ * @return Returns an UID if successful, otherwise < 0
*/
-int sceKernelOpenMutex(const char *name);
+SceUID sceKernelOpenMutex(const char *pName);
/**
* Close a mutex
*
- * @param mutexid - The mutex id returned from ::sceKernelCreateMutex
- * @return Returns the value 0 if it's successful, otherwise -1
+ * @param mutexId - The mutex id returned from ::sceKernelCreateMutex
+ * @return Returns the value 0 if it's successful, otherwise < 0
*/
-int sceKernelCloseMutex(SceUID mutexid);
+SceInt32 sceKernelCloseMutex(SceUID mutexId);
/**
* Lock a mutex
*
- * @param mutexid - The mutex id returned from ::sceKernelCreateMutex
+ * @param mutexId - The mutex id returned from ::sceKernelCreateMutex
* @param lockCount - The value to increment to the lock count of the mutex
- * @param timeout - Timeout in microseconds (assumed)
+ * @param pTimeout - Timeout in microseconds
* @return < 0 On error.
*/
-int sceKernelLockMutex(SceUID mutexid, int lockCount, unsigned int *timeout);
+SceInt32 sceKernelLockMutex(SceUID mutexId, SceInt32 lockCount, SceUInt32 *pTimeout);
/**
* Lock a mutex and handle callbacks if necessary.
*
- * @param mutexid - The mutex id returned from ::sceKernelCreateMutex
+ * @param mutexId - The mutex id returned from ::sceKernelCreateMutex
* @param lockCount - The value to increment to the lock count of the mutex
- * @param timeout - Timeout in microseconds (assumed)
+ * @param pTimeout - Timeout in microseconds
* @return < 0 On error.
*/
-int sceKernelLockMutexCB(SceUID mutexid, int lockCount, unsigned int *timeout);
+SceInt32 sceKernelLockMutexCB(SceUID mutexId, SceInt32 lockCount, SceUInt32 *pTimeout);
/**
* Try to lock a mutex (non-blocking)
*
- * @param mutexid - The mutex id returned from ::sceKernelCreateMutex
+ * @param mutexId - The mutex id returned from ::sceKernelCreateMutex
* @param lockCount - The value to increment to the lock count of the mutex
* @return < 0 On error.
*/
-int sceKernelTryLockMutex(SceUID mutexid, int lockCount);
+SceInt32 sceKernelTryLockMutex(SceUID mutexId, SceInt32 lockCount);
/**
* Try to unlock a mutex (non-blocking)
*
- * @param mutexid - The mutex id returned from ::sceKernelCreateMutex
+ * @param mutexId - The mutex id returned from ::sceKernelCreateMutex
* @param unlockCount - The value to decrement to the lock count of the mutex
* @return < 0 On error.
*/
-int sceKernelUnlockMutex(SceUID mutexid, int unlockCount);
+SceInt32 sceKernelUnlockMutex(SceUID mutexId, SceInt32 unlockCount);
/**
* Cancels a mutex
*
- * @param mutexid - The mutex id returned from ::sceKernelCreateMutex
+ * @param mutexId - The mutex id returned from ::sceKernelCreateMutex
* @param newCount - The new lock count of the mutex
- * @param numWaitThreads - Number of threads waiting for the mutex
+ * @param pNumWaitThreads - Number of threads waiting for the mutex
* @return < 0 On error.
*/
-int sceKernelCancelMutex(SceUID mutexid, int newCount, int *numWaitThreads);
+SceInt32 sceKernelCancelMutex(SceUID mutexId, SceInt32 newCount, SceUInt32 *pNumWaitThreads);
/**
* Retrieve information about a mutex.
*
- * @param mutexid - UID of the mutex to retrieve info for.
- * @param info - Pointer to a ::SceKernelMutexInfo struct to receive the info.
+ * @param mutexId - UID of the mutex to retrieve info for.
+ * @param pInfo - Pointer to a ::SceKernelMutexInfo struct to receive the info.
*
* @return < 0 on error.
*/
-int sceKernelGetMutexInfo(SceUID mutexid, SceKernelMutexInfo *info);
+SceInt32 sceKernelGetMutexInfo(SceUID mutexId, SceKernelMutexInfo *pInfo);
/* Event flags. */
/** Structure to hold the event flag information */
typedef struct SceKernelEventFlagInfo {
- SceSize size;
- SceUID evfId; // Needs confirmation
- char name[32];
- SceUInt attr;
- SceUInt initPattern;
- SceUInt currentPattern;
- int numWaitThreads;
+ SceSize size;
+ SceUID evfId;
+ char name[SCE_UID_NAMELEN + 1];
+ SceUInt32 attr;
+ SceUInt32 initPattern;
+ SceUInt32 currentPattern;
+ SceUInt32 numWaitThreads;
} SceKernelEventFlagInfo;
typedef struct SceKernelEventFlagOptParam {
SceSize size;
} SceKernelEventFlagOptParam;
-typedef struct SceKernelEventFlagOptParam SceKernelEventFlagOptParam;
-
-/** Event flag creation attributes */
-typedef enum SceEventFlagAttributes {
- /** Allow the event flag to be waited upon by multiple threads */
- SCE_EVENT_WAITMULTIPLE = 0x200
-} SceEventFlagAttributes;
-
-/** Event flag wait types */
-typedef enum SceEventFlagWaitTypes {
- /** Wait for all bits in the pattern to be set */
- SCE_EVENT_WAITAND = 0,
- /** Wait for one or more bits in the pattern to be set */
- SCE_EVENT_WAITOR = 1,
- /** Clear all the bits when it matches */
- SCE_EVENT_WAITCLEAR = 2,
- /** Clear the wait pattern when it matches */
- SCE_EVENT_WAITCLEAR_PAT = 4
-} SceEventFlagWaitTypes;
-
/**
* Create an event flag.
*
- * @param name - The name of the event flag.
+ * @param pName - The name of the event flag.
* @param attr - Attributes from ::SceEventFlagAttributes
- * @param bits - Initial bit pattern.
- * @param opt - Options, set to NULL
+ * @param initPattern - Initial bit pattern.
+ * @param pOptParam - Options, set to NULL
* @return < 0 on error. >= 0 event flag id.
*
* @par Example:
@@ -612,81 +613,101 @@ typedef enum SceEventFlagWaitTypes {
* evid = sceKernelCreateEventFlag("wait_event", 0, 0, 0);
* @endcode
*/
-SceUID sceKernelCreateEventFlag(const char *name, int attr, int bits, SceKernelEventFlagOptParam *opt);
+SceUID sceKernelCreateEventFlag(
+ const char *pName,
+ SceUInt32 attr,
+ SceUInt32 initPattern,
+ const SceKernelEventFlagOptParam *pOptParam);
/**
* Set an event flag bit pattern.
*
- * @param evid - The event id returned by ::sceKernelCreateEventFlag.
- * @param bits - The bit pattern to set.
+ * @param evfId - The event id returned by ::sceKernelCreateEventFlag.
+ * @param bitPattern - The bit pattern to set.
*
* @return < 0 On error
*/
-int sceKernelSetEventFlag(SceUID evid, unsigned int bits);
+SceInt32 sceKernelSetEventFlag(SceUID evfId, SceUInt32 bitPattern);
/**
* Clear a event flag bit pattern
*
- * @param evid - The event id returned by ::sceKernelCreateEventFlag
- * @param bits - The bits to clean
+ * @param evfId - The event id returned by ::sceKernelCreateEventFlag
+ * @param bitPattern - The bits to unset
*
* @return < 0 on Error
*/
-int sceKernelClearEventFlag(SceUID evid, unsigned int bits);
+SceInt32 sceKernelClearEventFlag(SceUID evfId, SceUInt32 bitPattern);
/**
* Poll an event flag for a given bit pattern.
*
- * @param evid - The event id returned by ::sceKernelCreateEventFlag.
- * @param bits - The bit pattern to poll for.
- * @param wait - Wait type, one or more of ::SceEventFlagWaitTypes or'ed together
- * @param outBits - The bit pattern that was matched.
+ * @param evfId - The event id returned by ::sceKernelCreateEventFlag.
+ * @param bitPattern - The bit pattern to poll for.
+ * @param waitMode - Wait type, one or more of ::SceEventFlagWaitTypes or'ed together
+ * @param pResultPat - The bit pattern that was matched.
* @return < 0 On error
*/
-int sceKernelPollEventFlag(int evid, unsigned int bits, unsigned int wait, unsigned int *outBits);
+SceInt32 sceKernelPollEventFlag(SceUID evfId, SceUInt32 bitPattern, SceUInt32 waitMode, SceUInt32 *pResultPat);
/**
* Wait for an event flag for a given bit pattern.
*
- * @param evid - The event id returned by ::sceKernelCreateEventFlag.
- * @param bits - The bit pattern to poll for.
- * @param wait - Wait type, one or more of ::SceEventFlagWaitTypes or'ed together
- * @param outBits - The bit pattern that was matched.
- * @param timeout - Timeout in microseconds
+ * @param evfId - The event id returned by ::sceKernelCreateEventFlag.
+ * @param bitPattern - The bit pattern to poll for.
+ * @param waitMode - Wait type, one or more of ::SceEventFlagWaitTypes or'ed together
+ * @param pResultPat - The bit pattern that was matched.
+ * @param pTimeout - Timeout in microseconds
* @return < 0 On error
*/
-int sceKernelWaitEventFlag(int evid, unsigned int bits, unsigned int wait, unsigned int *outBits, SceUInt *timeout);
+SceInt32 sceKernelWaitEventFlag(
+ SceUID evfId,
+ SceUInt32 bitPattern,
+ SceUInt32 waitMode,
+ SceUInt32 *pResultPat,
+ SceUInt32 *pTimeout);
/**
* Wait for an event flag for a given bit pattern with callback.
*
- * @param evid - The event id returned by ::sceKernelCreateEventFlag.
- * @param bits - The bit pattern to poll for.
- * @param wait - Wait type, one or more of ::SceEventFlagWaitTypes or'ed together
- * @param outBits - The bit pattern that was matched.
- * @param timeout - Timeout in microseconds
+ * @param evfId - The event id returned by ::sceKernelCreateEventFlag.
+ * @param bitPattern - The bit pattern to poll for.
+ * @param waitMode - Wait type, one or more of ::SceEventFlagWaitTypes or'ed together
+ * @param pResultPat - The bit pattern that was matched.
+ * @param pTimeout - Timeout in microseconds
* @return < 0 On error
*/
-int sceKernelWaitEventFlagCB(int evid, unsigned int bits, unsigned int wait, unsigned int *outBits, SceUInt *timeout);
+SceInt32 sceKernelWaitEventFlagCB(
+ SceUID evfId,
+ SceUInt32 bitPattern,
+ SceUInt32 waitMode,
+ SceUInt32 *pResultPat,
+ SceUInt32 *pTimeout);
/**
* Delete an event flag
*
- * @param evid - The event id returned by ::sceKernelCreateEventFlag.
+ * @param evfId - The event id returned by ::sceKernelCreateEventFlag.
*
* @return < 0 On error
*/
-int sceKernelDeleteEventFlag(int evid);
+SceInt32 sceKernelDeleteEventFlag(SceUID evfId);
/**
* Get the status of an event flag.
*
- * @param event - The UID of the event.
- * @param status - A pointer to a ::SceKernelEventFlagInfo structure.
+ * @param evfId - The UID of the event.
+ * @param pInfo - A pointer to a ::SceKernelEventFlagInfo structure.
*
* @return < 0 on error.
*/
-int sceKernelGetEventFlagInfo(SceUID event, SceKernelEventFlagInfo *info);
+SceInt32 sceKernelGetEventFlagInfo(SceUID evfId, SceKernelEventFlagInfo *pInfo);
+
+SceUID sceKernelOpenEventFlag(const char *pName);
+
+SceInt32 sceKernelCloseEventFlag(SceUID evfId);
+
+SceInt32 sceKernelCancelEventFlag(SceUID evfId, SceUInt32 setPattern, SceUInt32 *pNumWaitThreads);
/* Condition variables */
@@ -705,7 +726,7 @@ typedef struct SceKernelCondInfo {
/** The UID of the condition variable. */
SceUID condId;
/** NUL-terminated name of the condition variable. */
- char name[32];
+ char name[SCE_UID_NAMELEN + 1];
/** Attributes. */
SceUInt attr;
/** Mutex associated with the condition variable. */
@@ -723,55 +744,59 @@ typedef struct SceKernelCondInfo {
* condId = sceKernelCreateCond("MyCond", 0, mutexId, NULL);
* @endcode
*
- * @param name - Specifies the name of the condition variable
+ * @param pName - Specifies the name of the condition variable
* @param attr - Condition variable attribute flags (normally set to 0)
* @param mutexId - Mutex to be related to the condition variable
- * @param option - Condition variable options (normally set to 0)
+ * @param pOptParam - Condition variable options (normally set to 0)
* @return A condition variable id
*/
-SceUID sceKernelCreateCond(const char *name, SceUInt attr, SceUID mutexId, const SceKernelCondOptParam *option);
+SceUID sceKernelCreateCond(
+ const char *pName,
+ SceUInt32 attr,
+ SceUID mutexId,
+ const SceKernelCondOptParam *pOptParam);
/**
* Destroy a condition variable
*
* @param condition variableid - The condition variable id returned from ::sceKernelCreateCond
- * @return Returns the value 0 if it's successful, otherwise -1
+ * @return Returns the value 0 if it's successful, otherwise < 0
*/
-int sceKernelDeleteCond(SceUID condId);
+SceInt32 sceKernelDeleteCond(SceUID condId);
/**
* Open a condition variable
*
- * @param name - The name of the condition variable to open
- * @return Returns the value 0 if it's successful, otherwise -1
+ * @param pName - The name of the condition variable to open
+ * @return Returns an UID if successful, otherwise < 0
*/
-int sceKernelOpenCond(const char *name);
+SceUID sceKernelOpenCond(const char *pName);
/**
* Close a condition variable
*
* @param condition variableid - The condition variable id returned from ::sceKernelCreateCond
- * @return Returns the value 0 if it's successful, otherwise -1
+ * @return Returns the value 0 if it's successful, otherwise < 0
*/
-int sceKernelCloseCond(SceUID condId);
+SceInt32 sceKernelCloseCond(SceUID condId);
/**
* Waits for a signal of a condition variable
*
* @param condId - The condition variable id returned from ::sceKernelCreateCond
- * @param timeout - Timeout in microseconds (assumed)
+ * @param pTimeout - Timeout in microseconds
* @return < 0 On error.
*/
-int sceKernelWaitCond(SceUID condId, unsigned int *timeout);
+SceInt32 sceKernelWaitCond(SceUID condId, SceUInt32 *pTimeout);
/**
* Waits for a signal of a condition variable (with callbacks)
*
* @param condId - The condition variable id returned from ::sceKernelCreateCond
- * @param timeout - Timeout in microseconds (assumed)
+ * @param pTimeout - Timeout in microseconds
* @return < 0 On error.
*/
-int sceKernelWaitCondCB(SceUID condId, unsigned int *timeout);
+SceInt32 sceKernelWaitCondCB(SceUID condId, SceUInt32 *pTimeout);
/**
* Signals a condition variable
@@ -779,7 +804,7 @@ int sceKernelWaitCondCB(SceUID condId, unsigned int *timeout);
* @param condId - The condition variable id returned from ::sceKernelCreateCond
* @return < 0 On error.
*/
-int sceKernelSignalCond(SceUID condId);
+SceInt32 sceKernelSignalCond(SceUID condId);
/**
* Signals a condition variable to all threads waiting for it
@@ -787,7 +812,7 @@ int sceKernelSignalCond(SceUID condId);
* @param condId - The condition variable id returned from ::sceKernelCreateCond
* @return < 0 On error.
*/
-int sceKernelSignalCondAll(SceUID condId);
+SceInt32 sceKernelSignalCondAll(SceUID condId);
/**
* Signals a condition variable to a specific thread waiting for it
@@ -796,31 +821,37 @@ int sceKernelSignalCondAll(SceUID condId);
* @param threadId - The thread id returned from ::sceKernelCreateThread
* @return < 0 On error.
*/
-int sceKernelSignalCondTo(SceUID condId, SceUID threadId);
+SceInt32 sceKernelSignalCondTo(SceUID condId, SceUID threadId);
+
+SceInt32 sceKernelGetCondInfo(SceUID condId, SceKernelCondInfo *pInfo);
/* Callbacks. */
/** Callback function prototype */
-typedef int (*SceKernelCallbackFunction)(int notifyId, int notifyCount, int notifyArg, void *common);
+typedef SceInt32 (*SceKernelCallbackFunction)(
+ SceUID notifyId,
+ SceInt32 notifyCount,
+ SceInt32 notifyArg,
+ void *pCommon);
/** Structure to hold the status information for a callback */
typedef struct SceKernelCallbackInfo {
/** Size of the structure (i.e. sizeof(SceKernelCallbackInfo)) */
- SceSize size;
+ SceSize size;
/** The UID of the callback. */
- SceUID callbackId; // Needs confirmation
+ SceUID callbackId;
/** The name given to the callback */
- char name[32];
+ char name[SCE_UID_NAMELEN + 1];
+ SceUInt32 attr;
/** The thread id associated with the callback */
- SceUID threadId;
+ SceUID threadId;
/** Pointer to the callback function */
- SceKernelCallbackFunction callback;
+ SceKernelCallbackFunction callbackFunc;
+ SceUID notifyId;
+ SceInt32 notifyCount;
+ SceInt32 notifyArg;
/** User supplied argument for the callback */
- void *common;
- /** Unknown */
- int notifyCount;
- /** Unknown */
- int notifyArg;
+ void *pCommon;
} SceKernelCallbackInfo;
/**
@@ -829,212 +860,569 @@ typedef struct SceKernelCallbackInfo {
* @par Example:
* @code
* int cbid;
- * cbid = sceKernelCreateCallback("Exit Callback", exit_cb, NULL);
+ * cbid = sceKernelCreateCallback("Exit Callback", 0, exit_cb, NULL);
* @endcode
*
* @param name - A textual name for the callback
- * @param func - A pointer to a function that will be called as the callback
- * @param arg - Argument for the callback ?
+ * @param attr - Set to 0. There are no attributes.
+ * @param callbackFunc - A pointer to a function that will be called as the callback
+ * @param pCommon - Common data for the callback
*
* @return >= 0 A callback id which can be used in subsequent functions, < 0 an error.
*/
-int sceKernelCreateCallback(const char *name, unsigned int attr, SceKernelCallbackFunction func, void *arg);
+SceUID sceKernelCreateCallback(
+ const char *name,
+ SceUInt32 attr,
+ SceKernelCallbackFunction callbackFunc,
+ void *pCommon);
/**
* Gets the status of a specified callback.
*
- * @param cb - The UID of the callback to retrieve info for.
- * @param status - Pointer to a status structure. The size parameter should be
+ * @param callbackId - The UID of the callback to retrieve info for.
+ * @param pInfo - Pointer to a status structure. The size parameter should be
* initialised before calling.
*
* @return < 0 on error.
*/
-int sceKernelGetCallbackInfo(SceUID cb, SceKernelCallbackInfo *infop);
+SceInt32 sceKernelGetCallbackInfo(SceUID callbackId, SceKernelCallbackInfo *pInfo);
/**
* Delete a callback
*
- * @param cb - The UID of the specified callback
+ * @param callbackId - The UID of the specified callback
*
* @return 0 on success, < 0 on error
*/
-int sceKernelDeleteCallback(SceUID cb);
+SceInt32 sceKernelDeleteCallback(SceUID callbackId);
/**
* Notify a callback
*
- * @param cb - The UID of the specified callback
- * @param arg2 - Passed as arg2 into the callback function
+ * @param callbackId - The UID of the specified callback
+ * @param notifyArg - Passed as arg2 into the callback function
*
* @return 0 on success, < 0 on error
*/
-int sceKernelNotifyCallback(SceUID cb, int arg2);
+SceInt32 sceKernelNotifyCallback(SceUID callbackId, SceInt32 notifyArg);
/**
* Cancel a callback ?
*
- * @param cb - The UID of the specified callback
+ * @param callbackId - The UID of the specified callback
*
* @return 0 on success, < 0 on error
*/
-int sceKernelCancelCallback(SceUID cb);
+SceInt32 sceKernelCancelCallback(SceUID callbackId);
/**
* Get the callback count
*
- * @param cb - The UID of the specified callback
+ * @param callbackId - The UID of the specified callback
*
* @return The callback count, < 0 on error
*/
-int sceKernelGetCallbackCount(SceUID cb);
+SceInt32 sceKernelGetCallbackCount(SceUID callbackId);
/**
- * Check callback ?
+ * Check callback notification
*
- * @return Something or another
+ * @return Callback notification count or < 0 on error
*/
-int sceKernelCheckCallback(void);
+SceInt32 sceKernelCheckCallback(void);
/* Message pipes */
+typedef struct _SceKernelMsgPipeOptParam {
+ SceSize size;
+ SceUInt32 attr;
+ SceInt32 reserved[2];
+ SceUInt32 openLimit;
+} SceKernelMsgPipeOptParam;
+
/**
* Create a message pipe
*
- * @param name - Name of the pipe
- * @param type - The type of memory attribute to use internally (set to 0x40)
- * @param attr - Set to 12
- * @param bufSize - The size of the internal buffer in multiples of 0x1000 (4KB)
- * @param opt - Message pipe options (set to NULL)
+ * @param pName - Name of the pipe
+ * @param type - Message pipe memory type
+ * @param attr - Message pipe attribute
+ * @param bufSize - The size of the internal buffer in multiples of 0x1000 (4KiB) up to 32MiB
+ * @param pOptParam - Message pipe options
*
* @return The UID of the created pipe, < 0 on error
*/
-SceUID sceKernelCreateMsgPipe(const char *name, int type, int attr, unsigned int bufSize, void *opt);
+SceUID sceKernelCreateMsgPipe(
+ const char *pName,
+ SceUInt32 type,
+ SceUInt32 attr,
+ SceSize bufSize,
+ const SceKernelMsgPipeOptParam *pOptParam);
/**
* Delete a message pipe
*
- * @param uid - The UID of the pipe
+ * @param msgPipeId - The UID of the pipe
*
* @return 0 on success, < 0 on error
*/
-int sceKernelDeleteMsgPipe(SceUID uid);
+SceInt32 sceKernelDeleteMsgPipe(SceUID msgPipeId);
/**
* Send a message to a pipe
*
- * @param uid - The UID of the pipe
- * @param message - Pointer to the message
- * @param size - Size of the message
- * @param unk1 - Unknown - async vs sync? use 0 for sync
- * @param unk2 - Unknown - use NULL
- * @param timeout - Timeout for send in us. use NULL to wait indefinitely
+ * @param msgPipeId - The UID of the pipe
+ * @param pSendBuf - Pointer to the message
+ * @param sendSize - Size of the message
+ * @param waitMode - Wait mode when sending
+ * @param pResult - Pointer to area to store sent size
+ * @param pTimeout - Timeout in microseconds
*
* @return 0 on success, < 0 on error
*/
-int sceKernelSendMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout);
+SceInt32 sceKernelSendMsgPipe(
+ SceUID msgPipeId,
+ const void *pSendBuf,
+ SceSize sendSize,
+ SceUInt32 waitMode,
+ SceSize *pResult,
+ SceUInt32 *pTimeout);
/**
* Send a message to a pipe (with callback)
*
- * @param uid - The UID of the pipe
- * @param message - Pointer to the message
- * @param size - Size of the message
- * @param unk1 - Unknown - async vs sync? use 0 for sync
- * @param unk2 - Unknown - use NULL
- * @param timeout - Timeout for send in us. use NULL to wait indefinitely
+ * @param msgPipeId - The UID of the pipe
+ * @param pSendBuf - Pointer to the message
+ * @param sendSize - Size of the message
+ * @param waitMode - Wait mode when sending
+ * @param pResult - Pointer to area to store sent size
+ * @param pTimeout - Timeout in microseconds
*
* @return 0 on success, < 0 on error
*/
-int sceKernelSendMsgPipeCB(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout);
+SceInt32 sceKernelSendMsgPipeCB(
+ SceUID msgPipeId,
+ const void *pSendBuf,
+ SceSize sendSize,
+ SceUInt32 waitMode,
+ SceSize *pResult,
+ SceUInt32 *pTimeout);
/**
- * Try to send a message to a pipe
+ * Send a message to a pipe (non blocking)
*
- * @param uid - The UID of the pipe
- * @param message - Pointer to the message
- * @param size - Size of the message
- * @param unk1 - Unknown - use 0
- * @param unk2 - Unknown - use NULL
+ * @param msgPipeId - The UID of the pipe
+ * @param pSendBuf - Pointer to the message
+ * @param sendSize - Size of the message
+ * @param waitMode - Wait mode when sending
+ * @param pResult - Pointer to area to store sent size
*
* @return 0 on success, < 0 on error
*/
-int sceKernelTrySendMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2);
+SceInt32 sceKernelTrySendMsgPipe(
+ SceUID msgPipeId,
+ const void *pSendBuf,
+ SceSize sendSize,
+ SceUInt32 waitMode,
+ SceSize *pResult);
/**
* Receive a message from a pipe
*
- * @param uid - The UID of the pipe
- * @param message - Pointer to the message
- * @param size - Size of the message
- * @param unk1 - Unknown - async vs sync? use 0 for sync
- * @param unk2 - Unknown - use NULL
- * @param timeout - Timeout for receive in us. use NULL to wait indefinitely
+ * @param msgPipeId - The UID of the pipe
+ * @param pRecvBuf - Pointer to the message
+ * @param recvSize - Size of the message
+ * @param waitMode - Wait mode when receiving
+ * @param pResult - Pointer to area to store received size
+ * @param pTimeout - Timeout in microseconds
*
* @return 0 on success, < 0 on error
*/
-int sceKernelReceiveMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout);
+SceInt32 sceKernelReceiveMsgPipe(
+ SceUID msgPipeId,
+ const void *pRecvBuf,
+ SceSize recvSize,
+ SceUInt32 waitMode,
+ SceSize *pResult,
+ SceUInt32 *pTimeout);
/**
* Receive a message from a pipe (with callback)
*
- * @param uid - The UID of the pipe
- * @param message - Pointer to the message
- * @param size - Size of the message
- * @param unk1 - Unknown - async vs sync? use 0 for sync
- * @param unk2 - Unknown - use NULL
- * @param timeout - Timeout for receive in us. use NULL to wait indefinitely
+ * @param msgPipeId - The UID of the pipe
+ * @param pRecvBuf - Pointer to the message
+ * @param recvSize - Size of the message
+ * @param waitMode - Wait mode when receiving
+ * @param pResult - Pointer to area to store received size
+ * @param pTimeout - Timeout in microseconds
*
* @return 0 on success, < 0 on error
*/
-int sceKernelReceiveMsgPipeCB(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout);
+SceInt32 sceKernelReceiveMsgPipeCB(
+ SceUID msgPipeId,
+ const void *pRecvBuf,
+ SceSize recvSize,
+ SceUInt32 waitMode,
+ SceSize *pResult,
+ SceUInt32 *pTimeout);
/**
- * Receive a message from a pipe
+ * Receive a message from a pipe (non blocking)
*
- * @param uid - The UID of the pipe
- * @param message - Pointer to the message
- * @param size - Size of the message
- * @param unk1 - Unknown - use 0
- * @param unk2 - Unknown - use NULL
+ * @param msgPipeId - The UID of the pipe
+ * @param pRecvBuf - Pointer to the message
+ * @param recvSize - Size of the message
+ * @param waitMode - Wait mode when receiving
+ * @param pResult - Pointer to area to store received size
*
* @return 0 on success, < 0 on error
*/
-int sceKernelTryReceiveMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2);
+SceInt32 sceKernelTryReceiveMsgPipe(
+ SceUID msgPipeId,
+ void *pRecvBuf,
+ SceSize recvSize,
+ SceUInt32 waitMode,
+ SceSize *pResult);
/**
* Cancel a message pipe
*
- * @param uid - UID of the pipe to cancel
- * @param psend - Receive number of sending threads, NULL is valid
- * @param precv - Receive number of receiving threads, NULL is valid
+ * @param msgPipeId - UID of the pipe to cancel
+ * @param pNumSendWaitThreads - Receive number of sending threads, NULL is valid
+ * @param pNumReceiveWaitThreads - Receive number of receiving threads, NULL is valid
*
* @return 0 on success, < 0 on error
*/
-int sceKernelCancelMsgPipe(SceUID uid, int *psend, int *precv);
+SceInt32 sceKernelCancelMsgPipe(
+ SceUID msgPipeId,
+ SceUInt32 *pNumSendWaitThreads,
+ SceUInt32 *pNumReceiveWaitThreads);
/** Message Pipe status info */
typedef struct SceKernelMppInfo {
- SceSize size;
- SceUID mppId; // Needs confirmation
- char name[32];
- SceUInt attr;
- int bufSize;
- int freeSize;
- int numSendWaitThreads;
- int numReceiveWaitThreads;
+ SceSize size;
+ SceUID msgPipeId;
+ char name[SCE_UID_NAMELEN + 1];
+ SceUInt32 attr;
+ SceSize bufSize;
+ SceSize freeSize;
+ SceUInt32 numSendWaitThreads;
+ SceUInt32 numReceiveWaitThreads;
} SceKernelMppInfo;
/**
* Get the status of a Message Pipe
*
- * @param uid - The uid of the Message Pipe
- * @param info - Pointer to a ::SceKernelMppInfo structure
+ * @param msgPipeId - The uid of the Message Pipe
+ * @param pInfo - Pointer to a ::SceKernelMppInfo structure
*
* @return 0 on success, < 0 on error
*/
-int sceKernelGetMsgPipeInfo(SceUID uid, SceKernelMppInfo *info);
+SceInt32 sceKernelGetMsgPipeInfo(SceUID msgPipeId, SceKernelMppInfo *pInfo);
+
+SceUID sceKernelOpenMsgPipe(const char *pName);
+
+SceInt32 sceKernelCloseMsgPipe(SceUID msgPipeId);
+
+typedef struct _SceKernelMsgPipeVector {
+ void *pBase;
+ SceSize bufSize;
+} SceKernelMsgPipeVector;
+
+SceInt32 sceKernelSendMsgPipeVector(
+ SceUID msgPipeId,
+ const SceKernelMsgPipeVector *pVector,
+ SceUInt32 numVector,
+ SceUInt32 waitMode,
+ SceSize *pResult,
+ SceUInt32 *pTimeout
+);
+
+SceInt32 sceKernelSendMsgPipeVectorCB(
+ SceUID msgPipeId,
+ const SceKernelMsgPipeVector *pVector,
+ SceUInt32 numVector,
+ SceUInt32 waitMode,
+ SceSize *pResult,
+ SceUInt32 *pTimeout);
+
+SceInt32 sceKernelTrySendMsgPipeVector(
+ SceUID msgPipeId,
+ const SceKernelMsgPipeVector *pVector,
+ SceUInt32 numVector,
+ SceUInt32 waitMode,
+ SceSize *pResult);
+
+SceInt32 sceKernelReceiveMsgPipeVector(
+ SceUID msgPipeId,
+ const SceKernelMsgPipeVector *pVector,
+ SceUInt32 numVector,
+ SceUInt32 waitMode,
+ SceSize *pResult,
+ SceUInt32 *pTimeout);
+
+SceInt32 sceKernelReceiveMsgPipeVectorCB(
+ SceUID msgPipeId,
+ const SceKernelMsgPipeVector *pVector,
+ SceUInt32 numVector,
+ SceUInt32 waitMode,
+ SceSize *pResult,
+ SceUInt32 *pTimeout);
+
+SceInt32 sceKernelTryReceiveMsgPipeVector(
+ SceUID msgPipeId,
+ const SceKernelMsgPipeVector *pVector,
+ SceUInt32 numVector,
+ SceUInt32 waitMode,
+ SceSize *pResult);
+
+/* Thread event */
+
+SceInt32 sceKernelRegisterCallbackToEvent(SceUID eventId, SceUID callbackId);
+
+SceInt32 sceKernelUnregisterCallbackFromEvent(SceUID eventId, SceUID callbackId);
+
+SceInt32 sceKernelUnregisterCallbackFromEventAll(SceUID eventId);
+
+typedef SceInt32 (*SceKernelThreadEventHandler)(SceInt32 type, SceUID threadId, SceInt32 arg, void *pCommon);
+
+typedef struct _SceKernelEventInfo {
+ SceSize size;
+ SceUID eventId;
+ char name[SCE_UID_NAMELEN + 1];
+ SceUInt32 attr;
+ SceUInt32 eventPattern;
+ SceUInt64 userData;
+ SceUInt32 numWaitThreads;
+ SceInt32 reserved[1];
+} SceKernelEventInfo;
+
+SceInt32 sceKernelWaitEvent(
+ SceUID eventId,
+ SceUInt32 waitPattern,
+ SceUInt32 *pResultPattern,
+ SceUInt64 *pUserData,
+ SceUInt32 *pTimeout
+);
+
+SceInt32 sceKernelWaitEventCB(
+ SceUID eventId,
+ SceUInt32 waitPattern,
+ SceUInt32 *pResultPattern,
+ SceUInt64 *pUserData,
+ SceUInt32 *pTimeout
+);
+
+SceInt32 sceKernelPollEvent(
+ SceUID eventId,
+ SceUInt32 bitPattern,
+ SceUInt32 *pResultPattern,
+ SceUInt64 *pUserData
+);
+
+typedef struct _SceKernelWaitEvent {
+ SceUID eventId;
+ SceUInt32 eventPattern;
+} SceKernelWaitEvent;
+
+typedef struct _SceKernelResultEvent {
+ SceUID eventId;
+ SceInt32 result;
+ SceUInt32 resultPattern;
+ SceInt32 reserved[1];
+ SceUInt64 userData;
+} SceKernelResultEvent;
+
+SceInt32 sceKernelWaitMultipleEvents(
+ SceKernelWaitEvent *pWaitEventList,
+ SceUInt32 numEvents,
+ SceUInt32 waitMode,
+ SceKernelResultEvent *pResultEventList,
+ SceUInt32 *pTimeout);
+
+SceInt32 sceKernelWaitMultipleEventsCB(
+ SceKernelWaitEvent *pWaitEventList,
+ SceUInt32 numEvents,
+ SceUInt32 waitMode,
+ SceKernelResultEvent *pResultEventList,
+ SceUInt32 *pTimeout);
+
+SceInt32 sceKernelSetEvent(
+ SceUID eventId,
+ SceUInt32 setPattern,
+ SceUInt64 userData);
+
+SceInt32 sceKernelSetEventWithNotifyCallback(
+ SceUID eventId,
+ SceUInt32 setPattern,
+ SceUInt64 userData,
+ SceInt32 notifyArg);
+
+SceInt32 sceKernelPulseEvent(
+ SceUID eventId,
+ SceUInt32 pulsePattern,
+ SceUInt64 userData);
+
+SceInt32 sceKernelPulseEventWithNotifyCallback(
+ SceUID eventId,
+ SceUInt32 pulsePattern,
+ SceUInt64 userData,
+ SceInt32 notifyArg);
+
+SceInt32 sceKernelClearEvent(
+ SceUID eventId,
+ SceUInt32 clearPattern);
+
+
+SceInt32 sceKernelCancelEventWithSetPattern(
+ SceUID eventId,
+ SceUInt32 setPattern,
+ SceUInt64 userData,
+ SceUInt32 *pNumWaitThreads);
+
+
+SceInt32 sceKernelGetEventPattern(
+ SceUID eventId,
+ SceUInt32 *pPattern);
+
+SceInt32 sceKernelCancelEvent(
+ SceUID eventId,
+ SceUInt32 *pNumWaitThreads);
+
+SceInt32 sceKernelGetEventInfo(
+ SceUID eventId,
+ SceKernelEventInfo *pInfo);
+
+/* Reader/writer lock */
+
+typedef struct _SceKernelRWLockOptParam {
+ SceSize size;
+} SceKernelRWLockOptParam;
+
+typedef struct _SceKernelRWLockInfo {
+ SceSize size;
+ SceUID rwLockId;
+ char name[SCE_UID_NAMELEN + 1];
+ SceUInt32 attr;
+ SceInt32 lockCount;
+ SceUID writeOwnerId;
+ SceUInt32 numReadWaitThreads;
+ SceUInt32 numWriteWaitThreads;
+} SceKernelRWLockInfo;
+
+SceUID sceKernelCreateRWLock(
+ const char *pName,
+ SceUInt32 attr,
+ const SceKernelRWLockOptParam*pOptParam);
+
+SceInt32 sceKernelDeleteRWLock(SceUID rwLockId);
+
+SceUID sceKernelOpenRWLock(const char pName);
+
+SceInt32 sceKernelCloseRWLock(SceUID rwLockId);
+
+SceInt32 sceKernelLockReadRWLock(SceUID rwLockId, SceUInt32 *pTimeout);
+SceInt32 sceKernelLockReadRWLockCB(SceUID rwLockId, SceUInt32 *pTimeout);
+
+SceInt32 sceKernelTryLockReadRWLock(SceUID rwLockId);
+
+SceInt32 sceKernelUnlockReadRWLock(SceUID rwLockId);
+
+SceInt32 sceKernelLockWriteRWLock(SceUID rwLockId, SceUInt32 *pTimeout);
+
+SceInt32 sceKernelLockWriteRWLockCB(SceUID rwLockId, SceUInt32 *pTimeout);
+
+SceInt32 sceKernelTryLockWriteRWLock(SceUID rwLockId);
+
+SceInt32 sceKernelUnlockWriteRWLock(SceUID rwLockId);
+
+SceInt32 sceKernelCancelRWLock(
+ SceUID rwLockId,
+ SceUInt32 *pNumReadWaitThreads,
+ SceUInt32 *pNumWriteWaitThreads,
+ SceInt32 flag);
+
+SceInt32 sceKernelGetRWLockInfo(SceUID rwLockId, SceKernelRWLockInfo *pInfo);
+
+/* Thread timer */
+
+typedef struct _SceKernelTimerOptParam {
+ SceSize size;
+} SceKernelTimerOptParam;
+
+typedef struct _SceKernelTimerInfo {
+ SceSize size;
+ SceUID timerId;
+ char name[SCE_UID_NAMELEN + 1];
+ SceUInt32 attr;
+ SceInt32 fActive;
+ SceKernelSysClock baseTime;
+ SceKernelSysClock currentTime;
+ SceKernelSysClock schedule;
+ SceKernelSysClock interval;
+ SceInt32 type;
+ SceInt32 fRepeat;
+ SceUInt32 numWaitThreads;
+ SceInt32 reserved[1];
+} SceKernelTimerInfo;
+
+SceUID sceKernelCreateTimer(
+ const char *pName,
+ SceUInt32 attr,
+ const SceKernelTimerOptParam *pOptParam);
+
+SceInt32 sceKernelDeleteTimer(SceUID timerId);
+
+SceUID sceKernelOpenTimer(const char *pName);
+
+SceInt32 sceKernelCloseTimer(SceUID timerId);
+
+SceInt32 sceKernelStartTimer(SceUID timerId);
+
+SceInt32 sceKernelStopTimer(SceUID timerId);
+
+SceInt32 sceKernelGetTimerBase(SceUID timerId, SceKernelSysClock *pBase);
+
+SceUInt64 sceKernelGetTimerBaseWide(SceUID timerId);
+
+SceInt32 sceKernelGetTimerTime(SceUID timerId, SceKernelSysClock *pClock);
+
+SceUInt64 sceKernelGetTimerTimeWide(SceUID timerId);
+
+SceInt32 sceKernelSetTimerTime(SceUID timerId, SceKernelSysClock *pClock);
+
+SceUInt64 sceKernelSetTimerTimeWide(SceUID timerId, SceUInt64 clock);
+
+SceInt32 sceKernelSetTimerEvent(
+ SceUID timerId,
+ SceInt32 type,
+ SceKernelSysClock *pInterval,
+ SceInt32 fRepeat);
+
+SceInt32 sceKernelCancelTimer(SceUID timerId, SceUInt32 *pNumWaitThreads);
+
+SceInt32 sceKernelGetTimerInfo(SceUID timerId, SceKernelTimerInfo *pInfo);
+
+SceInt32 sceKernelGetTimerEventRemainingTime(SceUID timerId, SceKernelSysClock *pClock);
+
+/* Simple event */
+
+typedef struct _SceKernelSimpleEventOptParam {
+ SceSize size;
+} SceKernelSimpleEventOptParam;
+
+SceUID sceKernelCreateSimpleEvent(
+ const char *pName,
+ SceUInt32 attr,
+ SceUInt32 initPattern,
+ const SceKernelSimpleEventOptParam *pOptParam);
+
+SceInt32 sceKernelDeleteSimpleEvent(SceUID simpleEventId);
+
+SceUID sceKernelOpenSimpleEvent(const char *pName);
+
+SceInt32 sceKernelCloseSimpleEvent(SceUID simpleEventId);
/* Misc. */
@@ -1046,17 +1434,17 @@ typedef struct SceKernelSystemInfo {
SceKernelSysClock idleClock;
SceUInt32 comesOutOfIdleCount;
SceUInt32 threadSwitchCount;
- } cpuInfo[4];
+ } cpuInfo[SCE_KERNEL_MAX_CPU];
} SceKernelSystemInfo;
/**
* Get the system information
*
- * @param info - Pointer to a ::SceKernelSystemInfo structure
+ * @param pInfo - Pointer to a ::SceKernelSystemInfo structure
*
* @return 0 on success, < 0 on error
*/
-int sceKernelGetSystemInfo(SceKernelSystemInfo *info);
+SceInt32 sceKernelGetSystemInfo(SceKernelSystemInfo *pInfo);
/* Misc. */
@@ -1088,22 +1476,52 @@ typedef enum SceKernelIdListType {
*/
SceKernelIdListType sceKernelGetThreadmgrUIDClass(SceUID uid);
+/* Lightweight mutex */
-typedef struct SceKernelLwMutexWork {
+typedef struct SceKernelLwMutexWork {
SceInt64 data[4];
} SceKernelLwMutexWork;
typedef struct SceKernelLwMutexOptParam {
- SceSize size;
+ SceSize size;
} SceKernelLwMutexOptParam;
-int sceKernelCreateLwMutex(SceKernelLwMutexWork *pWork,const char *pName, unsigned int attr, int initCount, const SceKernelLwMutexOptParam *pOptParam);
-int sceKernelDeleteLwMutex(SceKernelLwMutexWork *pWork);
-int sceKernelLockLwMutex(SceKernelLwMutexWork *pWork, int lockCount, unsigned int *pTimeout);
-int sceKernelTryLockLwMutex(SceKernelLwMutexWork *pWork, int lockCount);
-int sceKernelUnlockLwMutex(SceKernelLwMutexWork *pWork, int unlockCount);
+typedef struct _SceKernelLwMutexInfo {
+ SceSize size;
+ SceUID uid;
+ char name[SCE_UID_NAMELEN + 1];
+ SceUInt32 attr;
+ SceKernelLwMutexWork *pWork;
+ SceInt32 initCount;
+ SceInt32 currentCount;
+ SceUID currentOwnerId;
+ SceUInt32 numWaitThreads;
+} SceKernelLwMutexInfo;
+
+SceInt32 sceKernelCreateLwMutex(
+ SceKernelLwMutexWork *pWork,
+ const char *pName,
+ SceUInt32 attr,
+ SceInt32 initCount,
+ const SceKernelLwMutexOptParam *pOptParam);
+
+SceInt32 sceKernelDeleteLwMutex(SceKernelLwMutexWork *pWork);
+
+SceInt32 sceKernelLockLwMutex(SceKernelLwMutexWork *pWork, SceInt32 lockCount, SceUInt32 *pTimeout);
+
+SceInt32 sceKernelLockLwMutexCB(SceKernelLwMutexWork *pWork, SceInt32 lockCount, SceUInt32 *pTimeout);
-typedef struct SceKernelLwCondWork {
+SceInt32 sceKernelTryLockLwMutex(SceKernelLwMutexWork *pWork, SceInt32 lockCount);
+
+SceInt32 sceKernelUnlockLwMutex(SceKernelLwMutexWork *pWork, SceInt32 unlockCount);
+
+SceInt32 sceKernelGetLwMutexInfo(SceKernelLwMutexWork *pWork, SceKernelLwMutexInfo *pInfo);
+
+SceInt32 sceKernelGetLwMutexInfoById(SceUID lwMutexId, SceKernelLwMutexInfo *pInfo);
+
+/* Lightweight condition */
+
+typedef struct SceKernelLwCondWork {
SceInt64 data[4];
} SceKernelLwCondWork;
@@ -1111,10 +1529,37 @@ typedef struct SceKernelLwCondOptParam {
SceSize size;
} SceKernelLwCondOptParam;
-int sceKernelCreateLwCond(SceKernelLwCondWork *pWork, const char *pName, unsigned int attr, SceKernelLwMutexWork *pLwMutex, const SceKernelLwCondOptParam *pOptParam);
-int sceKernelDeleteLwCond(SceKernelLwCondWork *pWork);
-int sceKernelSignalLwCond(SceKernelLwCondWork *pWork);
-int sceKernelWaitLwCond(SceKernelLwCondWork *pWork, unsigned int *pTimeout);
+typedef struct _SceKernelLwCondInfo {
+ SceSize size;
+ SceUID uid;
+ char name[SCE_UID_NAMELEN + 1];
+ SceUInt32 attr;
+ SceKernelLwCondWork *pWork;
+ SceKernelLwMutexWork *pLwMutex;
+ SceUInt32 numWaitThreads;
+} SceKernelLwCondInfo;
+
+SceInt32 sceKernelCreateLwCond(
+ SceKernelLwCondWork *pWork,
+ const char *pName,
+ SceUInt32 attr,
+ SceKernelLwMutexWork *pLwMutex,
+ const SceKernelLwCondOptParam *pOptParam
+);
+
+SceInt32 sceKernelDeleteLwCond(SceKernelLwCondWork *pWork);
+
+SceInt32 sceKernelSignalLwCond(SceKernelLwCondWork *pWork);
+
+SceInt32 sceKernelWaitLwCond(SceKernelLwCondWork *pWork, SceUInt32 *pTimeout);
+
+SceInt32 sceKernelSignalLwCondAll(SceKernelLwCondWork *pWork);
+
+SceInt32 sceKernelSignalLwCondTo(SceKernelLwCondWork *pWork, SceUID threadId);
+
+SceInt32 sceKernelGetLwCondInfo (SceKernelLwCondWork *pWork, SceKernelLwCondInfo *pInfo);
+
+SceInt32 sceKernelGetLwCondInfoById(SceUID lwCondId, SceKernelLwCondInfo *pInfo);
/**
diff --git a/include/user/net/net_syscalls.h b/include/user/net/net_syscalls.h
new file mode 100644
index 0000000..9752be9
--- /dev/null
+++ b/include/user/net/net_syscalls.h
@@ -0,0 +1,16 @@
+#ifndef _PSP2_NET_NET_SYSCALLS_H_
+#define _PSP2_NET_NET_SYSCALLS_H_
+
+#include <psp2/net/net.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int sceNetSyscallConnect(int s, const SceNetSockaddr *name, unsigned int namelen);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PSP2_NET_NET_SYSCALLS_H_ */
diff --git a/include/user/notification_util.h b/include/user/notification_util.h
new file mode 100644
index 0000000..4aa362a
--- /dev/null
+++ b/include/user/notification_util.h
@@ -0,0 +1,80 @@
+#ifndef _DOLCESDK_PSP2_NOTIFICATION_UTIL_H_
+#define _DOLCESDK_PSP2_NOTIFICATION_UTIL_H_
+
+#include <psp2/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Errors
+ */
+#define SCE_NOTIFICATION_UTIL_ERROR_INTERNAL 0x80106301
+
+/**
+ * BGDL-type notification event handler function
+ */
+typedef void (*SceNotificationUtilProgressEventHandler)(SceUInt32 eventId);
+
+typedef struct SceNotificationUtilProgressInitParam {
+ SceWChar16 notificationText[0x40]; // must be null-terminated
+ SceWChar16 notificationSubText[0x40]; // must be null-terminated
+ SceChar8 unk[0x3E6];
+ SceNotificationUtilProgressEventHandler eventHandler;
+ SceInt32 unk_4EC; // can be set to 0
+ SceWChar16 cancelDialogText[0x40]; // must be null-terminated
+} SceNotificationUtilProgressInitParam;
+
+typedef struct SceNotificationUtilProgressUpdateParam {
+ SceWChar16 notificationText[0x40]; // must be null-terminated
+ SceWChar16 notificationSubText[0x40]; // must be null-terminated
+ SceFloat targetProgress;
+ SceChar8 reserved[0x38];
+} SceNotificationUtilProgressUpdateParam;
+
+typedef struct SceNotificationUtilProgressFinishParam {
+ SceWChar16 notificationText[0x40]; // must be null-terminated
+ SceWChar16 notificationSubText[0x40]; // must be null-terminated
+ SceChar8 path[0x3E8];
+} SceNotificationUtilProgressFinishParam;
+
+/**
+ * Initialize notification util for use with BG application.
+ *
+ * Does not need to be called for normal applications.
+ */
+SceInt32 sceNotificationUtilBgAppInitialize(void);
+
+/**
+ * Send notification.
+ *
+ * Text buffer size must be 0x470.
+ */
+SceInt32 sceNotificationUtilSendNotification(const SceWChar16* text);
+
+/**
+ * Clean notifications for calling app from notification history.
+ */
+SceInt32 sceNotificationUtilCleanHistory(void);
+
+/**
+ * Start BGDL-type notification.
+ */
+SceInt32 sceNotificationUtilProgressBegin(SceNotificationUtilProgressInitParam* initParam);
+
+/**
+ * Update BGDL-type notification.
+ */
+SceInt32 sceNotificationUtilProgressUpdate(SceNotificationUtilProgressUpdateParam* updateParam);
+
+/**
+ * Finish BGDL-type notification.
+ */
+SceInt32 sceNotificationUtilProgressFinish(SceNotificationUtilProgressFinishParam* finishParam);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _DOLCESDK_PSP2_NOTIFICATION_UTIL_H_ */
diff --git a/include/user/paf.h b/include/user/paf.h
index 9e8a979..1d81d3b 100644
--- a/include/user/paf.h
+++ b/include/user/paf.h
@@ -10,14 +10,14 @@ extern "C" {
void sce_paf_private_free(void *ptr);
void *sce_paf_private_malloc(size_t size);
-void *sce_paf_private_memclr(void *ptr, size_t num); //!< Set memory block to 0
+void *sce_paf_private_bzero(void *ptr, size_t num);
void *sce_paf_private_memchr(const void *ptr, int value, size_t num);
int sce_paf_private_memcmp(const void *ptr1, const void *ptr2, size_t num);
-int sce_paf_private_memcmp2(const void *ptr1, const void *ptr2, size_t num);
+int sce_paf_private_bcmp(const void *ptr1, const void *ptr2, size_t num);
void *sce_paf_private_memcpy(void *destination, const void *source, size_t num);
void *sce_paf_private_memcpy2(void *destination, const void *source, size_t num);
void *sce_paf_private_memmove(void *destination, const void *source, size_t num);
-void *sce_paf_private_memmove2(void *destination, const void *source, size_t num);
+void *sce_paf_private_bcopy(void *destination, const void *source, size_t num);
void *sce_paf_private_memset(void *ptr, int value, size_t num);
int sce_paf_private_snprintf(char *s, size_t n, const char *format, ...);
int sce_paf_private_strcasecmp(const char *str1, const char *str2);
diff --git a/include/user/power.h b/include/user/power.h
index e42259e..8148139 100644
--- a/include/user/power.h
+++ b/include/user/power.h
@@ -18,21 +18,36 @@ typedef enum ScePowerErrorCode {
} ScePowerErrorCode;
typedef enum ScePowerCallbackType {
- /** indicates the unit is suspending, seems to occur due to inactivity */
- SCE_POWER_CB_SUSPENDING = 0x00010000,
+ /** indicates the power button was pushed, putting the unit into suspend mode */
+ SCE_POWER_CB_POWER_SWITCH = 0x80000000,
+ /** ? screen on after off ? **/
+ SCE_POWER_CB_UNK_1 = 0x00600000,
+ /** ? screen off ? **/
+ SCE_POWER_CB_UNK_2 = 0x00400000,
+ /** indicates the unit has finish resuming from suspend mode */
+ SCE_POWER_CB_RESUME_COMPLETE = 0x00040000,
/** indicates the unit is resuming from suspend mode */
SCE_POWER_CB_RESUMING = 0x00020000,
- /** indicates the unit has finish resuming from suspend mode */
- SCE_POWER_CB_RESUME_COMPLETE = 0x00040000
+ /** indicates the unit is suspending, seems to occur due to inactivity */
+ SCE_POWER_CB_SUSPENDING = 0x00010000,
+ /** indicates the unit is plugged into an AC outlet */
+ SCE_POWER_CB_AC_POWER = 0x00001000,
+ /** indicates the battery is in low state */
+ SCE_POWER_CB_LOWBATTERY = 0x00000100,
+ /** indicates there is a battery present in the unit */
+ SCE_POWER_CB_BATTERY_EXIST = 0x00000080
} ScePowerCallbackType;
-/* Callbacks */
+/* GPU, WLAN/COM configuration setting */
+typedef enum ScePowerConfigurationMode {
+ SCE_POWER_CONFIGURATION_MODE_A = 0x00000080U, /* GPU clock normal, WLAN/COM enabled */
+ SCE_POWER_CONFIGURATION_MODE_B = 0x00000800U, /* GPU clock high, WLAN/COM disabled */
+ SCE_POWER_CONFIGURATION_MODE_C = 0x00010880U, /* GPU clock high, WLAN/COM enabled (drains battery faster) */
+} ScePowerConfigurationMode;
/** Callback function prototype */
typedef void (*ScePowerCallback)(int notifyId, int notifyCount, int powerInfo);
-/* Prototypes */
-
/**
* Registers a ScePower Callback
*
@@ -66,13 +81,17 @@ SceBool scePowerIsBatteryCharging(void);
int scePowerGetBatteryLifePercent(void);
/**
- * Set configuration mode ?
+ * Set power configuration mode between:
*
- * @param mode - The mode to set
+ * Mode A - This is the normal mode at process start-up. The clock frequency of the GPU core is the "normal" clock frequency. The WLAN/COM can be used.
+ * Mode B - This mode accelerates the GPU clock frequency. The clock frequency of the GPU core is the "high" clock frequency. The WLAN/COM cannot be used.
+ * Mode C - This mode accelerates the GPU clock frequency, and also uses the WLAN/COM. The clock frequency of the GPU core is the "high" clock frequency, and use of the WLAN/COM is possible. The screen (touchscreen) brightness, however, is limited. Also, camera cannot be used.
*
- * @return ?
+ * @param conf One of ::ScePowerConfigurationMode
+ *
+ * @return 0 on success
*/
-int scePowerSetConfigurationMode(int mode);
+int scePowerSetConfigurationMode(int conf);
/**
* Check if a suspend is required
@@ -194,6 +213,13 @@ int scePowerRequestStandby(void);
int scePowerRequestSuspend(void);
/**
+ * Request display on
+ *
+ * @return always 0
+ */
+int scePowerRequestDisplayOn(void);
+
+/**
* Request display off
*
* @return always 0
diff --git a/include/user/promoterutil.h b/include/user/promoterutil.h
index 283706c..62de9cd 100644
--- a/include/user/promoterutil.h
+++ b/include/user/promoterutil.h
@@ -7,12 +7,27 @@
extern "C" {
#endif
+/** Avalible types for ::ScePromoterUtilityImportParams **/
+typedef enum ScePromoterUtilityPackageType {
+ SCE_PKG_TYPE_VITA = 0x0001, //!< PSVita Apps
+ SCE_PKG_TYPE_PSM = 0x0003, //!< PlayStation Mobile
+} ScePromoterUtilityPackageType;
+
/** Parameters for scePromoterUtilityUpdateLiveArea() */
typedef struct ScePromoterUtilityLAUpdate {
char titleid[12]; //!< Target app.
char path[128]; //!< Directory of extracted LA update data.
} ScePromoterUtilityLAUpdate;
-
+
+/** Parameters for scePromoterUtilityPromoteImport() */
+typedef struct ScePromoterUtilityImportParams {
+ char path[0x80]; //!< Install path usually (ux0:/temp/game)
+ char titleid[0xC]; //!< Game titleid
+ ScePromoterUtilityPackageType type; //!< Package type
+ uint32_t attribute; //!< Additional Attributes (Appears to be 0x1 on PSM content but 0x00 on Vita contents)
+ char reserved[0x1C];
+} ScePromoterUtilityImportParams;
+
/**
* Init the promoter utility.
* \note Needs to be called before using the other functions.
@@ -47,13 +62,13 @@ int scePromoterUtilityDeletePkg(const char *titleid);
int scePromoterUtilityUpdateLiveArea(ScePromoterUtilityLAUpdate *args);
/**
- * Install a backup from a directory, and add an icon on the LiveArea.
+ * Install Content Manager import contents and create bubbles without checking license files.
*
- * @param[in] *path - the path of the directory where the extracted content of the backup is
+ * @param[in] *params - see ::ScePromoterUtilImportParams
*
* @return 0 on success.
*/
-int scePromoterUtilityPromoteBackup(const char *path);
+int scePromoterUtilityPromoteImport(ScePromoterUtilityImportParams *params);
/**
* Install a package from a directory, and add an icon on the LiveArea.
diff --git a/include/user/pss.h b/include/user/pss.h
index 586f644..1330a6d 100644
--- a/include/user/pss.h
+++ b/include/user/pss.h
@@ -6,7 +6,17 @@
#ifdef __cplusplus
extern "C" {
#endif
+
+typedef struct ScePssCryptoHandle {
+ SceUID fd;
+ uint32_t unk1;
+ SceSize size;
+ uint32_t unk3;
+} ScePssCryptoHandle;
+int pss_crypto_open(ScePssCryptoHandle *handle, char *path);
+char *pss_crypto_read(ScePssCryptoHandle *handle, int *mode);
+int pss_crypto_close(ScePssCryptoHandle *handle);
void *pss_code_mem_alloc(SceSize *);
void pss_code_mem_flush_icache(const void *, SceSize);
void pss_code_mem_lock(void);
diff --git a/include/user/registrymgr.h b/include/user/registrymgr.h
index cc363b5..dbf4946 100644
--- a/include/user/registrymgr.h
+++ b/include/user/registrymgr.h
@@ -59,11 +59,11 @@ int sceRegMgrSetKeyBin(const char *category, const char *name, void *buf, int si
*
* @param category - The path to the directory to be opened (e.g. /CONFIG/SYSTEM)
* @param name - Name of the key
- * @param buf - Pointer to an int buffer to hold the value
+ * @param value - Value to set to
*
* @return 0 on success, < 0 on error
*/
-int sceRegMgrSetKeyInt(const char* category, const char* name, int buf);
+int sceRegMgrSetKeyInt(const char* category, const char* name, int value);
/**
* Set a key's information by category and name
diff --git a/include/user/sblacmgr.h b/include/user/sblacmgr.h
new file mode 100644
index 0000000..17a14f5
--- /dev/null
+++ b/include/user/sblacmgr.h
@@ -0,0 +1,16 @@
+#ifndef _PSP2_SBLACMGR_H_
+#define _PSP2_SBLACMGR_H_
+
+#include <psp2/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int _sceSblACMgrIsGameProgram(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PSP2_SBLACMGR_H_ */
diff --git a/include/user/shellutil.h b/include/user/shellutil.h
index 61d602b..0d84ff6 100644
--- a/include/user/shellutil.h
+++ b/include/user/shellutil.h
@@ -1,6 +1,8 @@
#ifndef _PSP2_SHELLUTIL_H_
#define _PSP2_SHELLUTIL_H_
+#include <psp2/types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -65,6 +67,97 @@ int sceShellUtilLock(SceShellUtilLockType type);
*/
int sceShellUtilUnlock(SceShellUtilLockType type);
+/**
+ * Reboot the device
+ *
+ * @param[in] unk - pass 0
+ */
+void sceShellUtilRequestColdReset(int unk);
+
+/**
+ * Poweroff the device
+ *
+ * @param[in] unk - pass 0
+ */
+void sceShellUtilRequestStandby(int unk);
+
+/**
+ * Show "A serious error has occured" message and reboot
+ *
+ * @param[in] safeModeType - sets type of safemode to reboot into, 0 to reboot normally
+ * @param[in] errorCode - error code to display in the message
+ * @param[in] errorMessageType - ex. 0 "Contact technical support"
+ */
+void sceShellUtilRequestColdResetWithError(int safeModeType, int errorCode, int errorMessageType);
+
+/**
+ * SceTextClipboardStorage is cached memory block with usable size of 0x1FFD bytes
+ * allocated by SceShellSvc on startup. Normally you would access this storage with
+ * clipboard sysmodule, however it can also be accessed directly with SceShellSvc
+ * functions. This memory can be accesed from any part of the system and is managed
+ * by SceShell. For example, you can write to it in one application and access
+ * written data from the other. Or you can write to it in application and access
+ * written data from the plugin.
+ *
+ * @param[in] data - pointer to the data to write
+ * @param[in] size - size of data to write. Must not exceed 0x1FFD.
+ */
+
+SceInt32 sceShellUtilTextClipboardWrite(const void* data, SceSize size);
+
+/**
+ * Read from text clipboard
+ *
+ * @param[in] data - pointer to the buffer where the read data will be placed
+ * @param[in] size - size of data to read
+ * @param[out] textlen - length actually read
+ */
+
+SceInt32 sceShellUtilTextClipboardRead(void* data, SceSize size, SceSize *textlen);
+
+/**
+ * Returns size of the data that was written to clipboard with
+ * sceShellUtilTextClipboardWrite
+ */
+
+SceUInt32 sceShellUtilTextClipboardGetUsedSize(void);
+
+/**
+ * Sets text in time display, UTF-16 (remains until reboot?)
+ */
+
+SceInt32 sceShellUtilSetTimeText(SceWChar16* unk, SceWChar16* text);
+
+/**
+ * Set airplane icon visibility
+ *
+ * @param[in] mode - 0 to hide, 1 to show
+ */
+
+SceInt32 sceShellUtilSetAirplaneIconMode(SceUInt32 mode);
+
+/**
+ * Set Bluetooth icon visibility
+ *
+ * @param[in] mode - 0 to hide, 1 to show
+ */
+
+SceInt32 sceShellUtilSetBtIconMode(SceUInt32 mode);
+
+/**
+ * Set BGM mode
+ *
+ * @param[in] mode - 0 to disable, 1 to enable
+ */
+
+SceInt32 sceShellUtilSetBGMMode(SceUInt32 mode);
+
+/**
+ * Set system language. Takes about 5 sec to apply.
+ */
+
+SceInt32 sceShellUtilSetSystemLanguage(SceUInt32 languageId);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/user/sysmodule.h b/include/user/sysmodule.h
index 858b0a7..8f01169 100644
--- a/include/user/sysmodule.h
+++ b/include/user/sysmodule.h
@@ -89,6 +89,7 @@ typedef enum SceSysmoduleModuleId {
SCE_SYSMODULE_NEAR_DIALOG_UTIL = 0x004A, //!< NearDialogUtil module
SCE_SYSMODULE_LOCATION_EXTENSION = 0x004B, //!< LocationExt module
SCE_SYSMODULE_AVPLAYER = 0x004C, //!< AVPlayer module
+ SCE_SYSMODULE_GAME_UPDATE = 0x004D, //!< Game Update module
SCE_SYSMODULE_MAIL_API = 0x004E, //!< Mail Api module
SCE_SYSMODULE_TELEPORT_CLIENT = 0x004F, //!< Teleport Client module
SCE_SYSMODULE_TELEPORT_SERVER = 0x0050, //!< Teleport Server module
@@ -130,9 +131,10 @@ typedef enum SceSysmoduleInternalModuleId {
SCE_SYSMODULE_INTERNAL_NP_COMMERCE2 = 0x8000001D, //!< NpCommerce2 module
SCE_SYSMODULE_INTERNAL_NP_KDC = 0x8000001E, //!< NpKdc module
SCE_SYSMODULE_INTERNAL_MUSIC_EXPORT = 0x8000001F, //!< Music Export module
- SCE_SYSMODULE_INTERNAL_NP_MESSAGE_DLG_IMPL = 0x80000021, //!< NpMessageDlg module
+ SCE_SYSMODULE_INTERNAL_VIDEO_EXPORT = 0x80000020, //!< Video Export module
+ SCE_SYSMODULE_INTERNAL_NP_MESSAGE_DIALOG_IMPL = 0x80000021, //!< NpMessageDlg module
SCE_SYSMODULE_INTERNAL_NP_MESSAGE_CONTACTS = 0x80000022, //!< NpMessageContacts module
- SCE_SYSMODULE_INTERNAL_DBRECOVERY_UTILITY = 0x80000023, //!< DBRecoveryUtil module
+ SCE_SYSMODULE_INTERNAL_DB_RECOVERY_UTILITY = 0x80000023, //!< DBRecoveryUtil module
SCE_SYSMODULE_INTERNAL_PROMOTER_UTIL = 0x80000024, //!< scePromoterUtil module
SCE_SYSMODULE_INTERNAL_PARTY_MEMBER_LIST = 0x80000026, //!< Party Member List module
SCE_SYSMODULE_INTERNAL_ULT = 0x80000025, //!< Ult module
diff --git a/include/user/udcd.h b/include/user/udcd.h
index fefb048..eec370f 100644
--- a/include/user/udcd.h
+++ b/include/user/udcd.h
@@ -1,6 +1,8 @@
#ifndef _PSP2_UDCD_H_
#define _PSP2_UDCD_H_
+#include <psp2/types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -31,16 +33,16 @@ typedef struct {
uint8_t info[64];
} SceUdcdDeviceInfo;
-typedef struct {
+typedef struct SceUdcdWaitParam {
int unk_00;
- int unk_04;
+ int status;
int unk_08;
int unk_0C;
int unk_10;
const char *driverName;
} SceUdcdWaitParam;
-typedef struct {
+typedef struct SceUdcdDeviceState {
int unk_00;
int state;
int cable;
diff --git a/include/user/vshbridge.h b/include/user/vshbridge.h
index 46cb4a0..a525c04 100644
--- a/include/user/vshbridge.h
+++ b/include/user/vshbridge.h
@@ -9,29 +9,72 @@ extern "C" {
#endif
int _vshSblGetSystemSwVersion(SceKernelFwInfo * data);
-
+
int _vshSblAimgrGetConsoleId(char CID[32]);
-
+
+/**
+ * @param[in] id - mount id
+ * @param[in] path - mount path
+ * @param[in] permission - 1/RO 2/RW
+ * @param[in] buf - work buffer
+ *
+ * @return 0 >= on success, < 0 on error.
+ */
+int _vshIoMount(int id, const char *path, int permission, void* buf);
+
+/**
+ * @param[in] id - mount id
+ * @param[in] force - Set to 1 to force umount
+ * @param[in] unk2 - Unknown, set 0
+ * @param[in] unk3 - Unknown, set 0
+ *
+ * @return 0 >= on success, < 0 on error.
+ */
+int vshIoUmount(int id, int force, int unk2, int unk3);
+
int vshIdStorageIsDirty(void);
int vshIdStorageIsFormatted(void);
int vshIdStorageIsReadOnly(void);
-
+
+/**
+ * @param[in] leafnum - 0x0 ~ 0x80 / leafnum > 0x80 = error
+ * @param[out] buf - Leaf data, size is 512 byte
+ *
+ * @return 0 on success, < 0 on error.
+ */
+int vshIdStorageReadLeaf(int leafnum, void *buf);
+
+/**
+ * @param[in] leafnum - 0x0 ~ 0x80 / leafnum > 0x80 = error
+ * @param[in] buf - Leaf data, size is 512 byte
+ *
+ * @return 0 on success, < 0 on error.
+ */
+int vshIdStorageWriteLeaf(int leafnum, const void *buf);
+
int vshSblAimgrIsCEX(void);
int vshSblAimgrIsDEX(void);
+int vshSblAimgrIsVITA(void);
int vshSblAimgrIsGenuineVITA(void);
+int vshSblAimgrIsDolce(void);
int vshSblAimgrIsGenuineDolce(void);
int vshSblAimgrIsTest(void);
int vshSblAimgrIsTool(void);
int vshSblSsIsDevelopmentMode(void);
-int sceKernelIsPSVitaTV(void);
-
+
int vshSysconHasWWAN(void);
-
+
int vshSysconIsDownLoaderMode(void);
int vshSysconIsIduMode(void);
int vshSysconIsMCEmuCapable(void);
int vshSysconIsShowMode(void);
-
+
+int vshSysconIduModeSet(void);
+int vshSysconIduModeClear(void);
+
+int vshSysconShowModeSet(void);
+int vshSysconShowModeClear(void);
+
int vshMemoryCardGetCardInsertState(void);
int vshRemovableMemoryGetCardInsertState(void);