diff options
author | Rinnegatamante | 2017-06-15 11:36:33 +0200 |
---|---|---|
committer | Sunguk Lee | 2017-06-15 18:36:33 +0900 |
commit | b5646d6867a3c279e0a7f5b3db42678f84d7ff15 (patch) | |
tree | b625c863cf3657b5901523e438bddb8330c10a74 /include/user | |
parent | Removed next entry (diff) | |
download | vds-libraries-b5646d6867a3c279e0a7f5b3db42678f84d7ff15.tar.gz |
Named anonymous enums in psp2. (#179)
* Named anonymous enums in psp2.
Named anonymous enums in psp2.
* Properly sorted enums.
* Several modifications (see desc)
Added some missing info, fixed identation in some places, aligned all
enums and comments with spaces as delimiters, replaced decimal negative
errorcode in location.h with hexadecimal one, added some comments and
fixed some documentation comments.
* Minor fixes in identation.
* Yet another minor identation fix.
* Fixed enums in structs.
* Reverted SceBool changes.
* SceBool fix.
* Fix for compilation with g++-
* Added some doc references in jpegenc.
* Fixed some references.
Diffstat (limited to 'include/user')
-rw-r--r-- | include/user/appmgr.h | 75 | ||||
-rw-r--r-- | include/user/ctrl.h | 84 | ||||
-rw-r--r-- | include/user/display.h | 60 | ||||
-rw-r--r-- | include/user/kernel/modulemgr.h | 22 | ||||
-rw-r--r-- | include/user/kernel/processmgr.h | 48 | ||||
-rw-r--r-- | include/user/kernel/sysmem.h | 60 | ||||
-rw-r--r-- | include/user/kernel/threadmgr.h | 155 | ||||
-rw-r--r-- | include/user/npdrmpackage.h | 6 | ||||
-rw-r--r-- | include/user/power.h | 21 | ||||
-rw-r--r-- | include/user/promoterutil.h | 4 | ||||
-rw-r--r-- | include/user/shellutil.h | 46 | ||||
-rw-r--r-- | include/user/sysmodule.h | 34 | ||||
-rw-r--r-- | include/user/udcd.h | 28 | ||||
-rw-r--r-- | include/user/usbd.h | 28 | ||||
-rw-r--r-- | include/user/usbstorvstor.h | 12 |
15 files changed, 341 insertions, 342 deletions
diff --git a/include/user/appmgr.h b/include/user/appmgr.h index 8a4a9d7..d0e8b81 100644 --- a/include/user/appmgr.h +++ b/include/user/appmgr.h @@ -7,50 +7,45 @@ extern "C" { #endif -enum { +typedef enum SceAppMgrErrorCode { //! Busy - SCE_APPMGR_ERROR_BUSY = 0x80802000, - + SCE_APPMGR_ERROR_BUSY = 0x80802000, //! Invalid state - SCE_APPMGR_ERROR_STATE = 0x80802013, - + SCE_APPMGR_ERROR_STATE = 0x80802013, //! NULL pointer SCE_APPMGR_ERROR_NULL_POINTER = 0x80802016, - //!< Invalid param - SCE_APPMGR_ERROR_INVALID = 0x8080201a, - + SCE_APPMGR_ERROR_INVALID = 0x8080201a, //!< Invalid self path - SCE_APPMGR_ERROR_INVALID_SELF_PATH = 0x8080201e, - + SCE_APPMGR_ERROR_INVALID_SELF_PATH = 0x8080201e, //!< argv is too long - SCE_APPMGR_ERROR_TOO_LONG_ARGV = 0x8080201d -}; - -enum { - SCE_APPMGR_SYSTEMEVENT_ON_RESUME = 0x10000003, - SCE_APPMGR_SYSTEMEVENT_ON_STORE_PURCHASE = 0x10000004, - SCE_APPMGR_SYSTEMEVENT_ON_NP_MESSAGE_ARRIVED = 0x10000005, - SCE_APPMGR_SYSTEMEVENT_ON_STORE_REDEMPTION = 0x10000006, -}; - -enum { - SCE_APPMGR_INFOBAR_VISIBILITY_INVISIBLE = 0, - SCE_APPMGR_INFOBAR_VISIBILITY_VISIBLE = 1 -}; - -enum { - SCE_APPMGR_INFOBAR_COLOR_BLACK = 0, - SCE_APPMGR_INFOBAR_COLOR_WHITE = 1 -}; - -enum { - SCE_APPMGR_INFOBAR_TRANSPARENCY_OPAQUE = 0, - SCE_APPMGR_INFOBAR_TRANSPARENCY_TRANSLUCENT = 1 -}; + SCE_APPMGR_ERROR_TOO_LONG_ARGV = 0x8080201d +} SceAppMgrErrorCode; + +typedef enum SceAppMgrSystemEventType { + SCE_APPMGR_SYSTEMEVENT_ON_RESUME = 0x10000003, + SCE_APPMGR_SYSTEMEVENT_ON_STORE_PURCHASE = 0x10000004, + SCE_APPMGR_SYSTEMEVENT_ON_NP_MESSAGE_ARRIVED = 0x10000005, + SCE_APPMGR_SYSTEMEVENT_ON_STORE_REDEMPTION = 0x10000006 +} SceAppMgrSystemEventType; + +typedef enum SceAppMgrInfoBarVisibility { + SCE_APPMGR_INFOBAR_VISIBILITY_INVISIBLE = 0, + SCE_APPMGR_INFOBAR_VISIBILITY_VISIBLE = 1 +} SceAppMgrInfoBarVisibility; + +typedef enum SceAppMgrInfoBarColor { + SCE_APPMGR_INFOBAR_COLOR_BLACK = 0, + SCE_APPMGR_INFOBAR_COLOR_WHITE = 1 +} SceAppMgrInfoBarColor; + +typedef enum SceAppMgrInfoBarTransparency { + SCE_APPMGR_INFOBAR_TRANSPARENCY_OPAQUE = 0, + SCE_APPMGR_INFOBAR_TRANSPARENCY_TRANSLUCENT = 1 +} SceAppMgrInfoBarTransparency; typedef struct SceAppMgrSystemEvent { - int systemEvent; + int systemEvent; //!< One of ::SceAppMgrSystemEventType uint8_t reserved[60]; } SceAppMgrSystemEvent; @@ -58,6 +53,10 @@ typedef struct SceAppMgrAppState SceAppMgrAppState; // Missing struct typedef struct SceAppMgrExecOptParam SceAppMgrExecOptParam; // Missing struct typedef struct SceAppMgrLaunchAppOptParam SceAppMgrLaunchAppOptParam; // Missing struct +typedef struct sceAppMgrLoadExecOptParam { + int reserved[64]; +} sceAppMgrLoadExecOptParam; + #define SCE_APPMGR_MAX_APP_NAME_LENGTH (31) //! Destroy all other apps @@ -89,11 +88,7 @@ int sceAppMgrAcquireBgmPort(void); int sceAppMgrReleaseBgmPort(void); //! Set infobar state -int sceAppMgrSetInfobarState(int visibility, int color, int transparency); - -typedef struct sceAppMgrLoadExecOptParam { - int reserved[256 / 4]; -} sceAppMgrLoadExecOptParam; +int sceAppMgrSetInfobarState(SceAppMgrInfoBarVisibility visibility, SceAppMgrInfoBarColor color, SceAppMgrInfoBarTransparency transparency); int sceAppMgrLoadExec(const char *appPath, char * const argv[], const SceAppMgrExecOptParam *optParam); diff --git a/include/user/ctrl.h b/include/user/ctrl.h index f8f5679..38a0d8a 100644 --- a/include/user/ctrl.h +++ b/include/user/ctrl.h @@ -8,60 +8,60 @@ extern "C" { #endif -enum { - SCE_CTRL_ERROR_INVALID_ARG = 0x80340001, - SCE_CTRL_ERROR_PRIV_REQUIRED = 0x80340002, - SCE_CTRL_ERROR_FATAL = 0x803400FF -}; +typedef enum SceCtrlErrorCode { + SCE_CTRL_ERROR_INVALID_ARG = 0x80340001, + SCE_CTRL_ERROR_PRIV_REQUIRED = 0x80340002, + SCE_CTRL_ERROR_FATAL = 0x803400FF +} SceCtrlErrorCode; /** Enumeration for the digital controller buttons. * L1/R1/L3/R3 only can bind using sceCtrlReadBufferPositiveExt2 */ -enum SceCtrlPadButtons { - SCE_CTRL_SELECT = 0x000001, //!< Select button. - SCE_CTRL_L3 = 0x000002, //!< L3 button. - SCE_CTRL_R3 = 0x000004, //!< R3 button. - SCE_CTRL_START = 0x000008, //!< Start button. - SCE_CTRL_UP = 0x000010, //!< Up D-Pad button. - SCE_CTRL_RIGHT = 0x000020, //!< Right D-Pad button. - SCE_CTRL_DOWN = 0x000040, //!< Down D-Pad button. - SCE_CTRL_LEFT = 0x000080, //!< Left D-Pad button. - SCE_CTRL_LTRIGGER = 0x000100, //!< Left trigger. - SCE_CTRL_RTRIGGER = 0x000200, //!< Right trigger. - SCE_CTRL_L1 = 0x000400, //!< L1 button. - SCE_CTRL_R1 = 0x000800, //!< R1 button. - SCE_CTRL_TRIANGLE = 0x001000, //!< Triangle button. - SCE_CTRL_CIRCLE = 0x002000, //!< Circle button. - SCE_CTRL_CROSS = 0x004000, //!< Cross button. - SCE_CTRL_SQUARE = 0x008000, //!< Square button. - SCE_CTRL_INTERCEPTED = 0x010000, //!< Input not available because intercepted by another application - SCE_CTRL_VOLUP = 0x100000, //!< Volume up button. - SCE_CTRL_VOLDOWN = 0x200000 //!< Volume down button. -}; +typedef enum SceCtrlButtons { + SCE_CTRL_SELECT = 0x000001, //!< Select button. + SCE_CTRL_L3 = 0x000002, //!< L3 button. + SCE_CTRL_R3 = 0x000004, //!< R3 button. + SCE_CTRL_START = 0x000008, //!< Start button. + SCE_CTRL_UP = 0x000010, //!< Up D-Pad button. + SCE_CTRL_RIGHT = 0x000020, //!< Right D-Pad button. + SCE_CTRL_DOWN = 0x000040, //!< Down D-Pad button. + SCE_CTRL_LEFT = 0x000080, //!< Left D-Pad button. + SCE_CTRL_LTRIGGER = 0x000100, //!< Left trigger. + SCE_CTRL_RTRIGGER = 0x000200, //!< Right trigger. + SCE_CTRL_L1 = 0x000400, //!< L1 button. + SCE_CTRL_R1 = 0x000800, //!< R1 button. + SCE_CTRL_TRIANGLE = 0x001000, //!< Triangle button. + SCE_CTRL_CIRCLE = 0x002000, //!< Circle button. + SCE_CTRL_CROSS = 0x004000, //!< Cross button. + SCE_CTRL_SQUARE = 0x008000, //!< Square button. + SCE_CTRL_INTERCEPTED = 0x010000, //!< Input not available because intercepted by another application + SCE_CTRL_VOLUP = 0x100000, //!< Volume up button. + SCE_CTRL_VOLDOWN = 0x200000 //!< Volume down button. +} SceCtrlButtons; /** Enumeration for the controller types. */ -enum SceCtrlExternalInputMode { - SCE_CTRL_TYPE_UNPAIRED = 0, +typedef enum SceCtrlExternalInputMode { + SCE_CTRL_TYPE_UNPAIRED = 0, //!< Unpaired controller SCE_CTRL_TYPE_PHY = 1, //!< Physical controller for VITA SCE_CTRL_TYPE_VIRT = 2, //!< Virtual controller for PSTV SCE_CTRL_TYPE_DS3 = 4, //!< DualShock 3 SCE_CTRL_TYPE_DS4 = 8 //!< DualShock 4 -}; +} SceCtrlExternalInputMode; /** Controller mode. */ -enum SceCtrlPadInputMode { +typedef enum SceCtrlPadInputMode { /** Digital buttons only. */ - SCE_CTRL_MODE_DIGITAL = 0, + SCE_CTRL_MODE_DIGITAL = 0, /** Digital buttons + Analog support. */ - SCE_CTRL_MODE_ANALOG = 1, + SCE_CTRL_MODE_ANALOG = 1, /** Same as ::SCE_CTRL_MODE_ANALOG, but with larger range for analog sticks. */ SCE_CTRL_MODE_ANALOG_WIDE = 2 -}; +} SceCtrlPadInputMode; /** Returned controller data */ typedef struct SceCtrlData { /** The current read frame. */ uint64_t timeStamp; - /** Bit mask containing zero or more of ::CtrlButtons. */ + /** Bit mask containing zero or more of ::SceCtrlButtons. */ unsigned int buttons; /** Left analogue stick, X axis. */ unsigned char lx; @@ -95,41 +95,41 @@ typedef struct SceCtrlRapidFireRule { typedef struct SceCtrlActuator { unsigned char small; //!< Vibration strength of the small motor unsigned char large; //!< Vibration strength of the large motor - uint8_t unk[6]; //!< Unknown + uint8_t unk[6]; //!< Unknown } SceCtrlActuator; /** Structure to pass as argument to ::sceCtrlGetControllerPortInfo */ typedef struct SceCtrlPortInfo { - uint8_t port[5]; //!< Controller type of each ports + uint8_t port[5]; //!< Controller type of each port (See ::SceCtrlExternalInputMode) uint8_t unk[11]; //!< Unknown } SceCtrlPortInfo; /** * Set the controller mode. * - * @param[in] mode - One of ::CtrlMode. + * @param[in] mode - One of ::SceCtrlPadInputMode. * * @return The previous mode, <0 on error. */ -int sceCtrlSetSamplingMode(int mode); +int sceCtrlSetSamplingMode(SceCtrlPadInputMode mode); /** * Set the controller extend mode. * - * @param[in] mode - One of ::CtrlMode. + * @param[in] mode - One of ::SceCtrlPadInputMode. * * @return The previous mode, <0 on error. */ -int sceCtrlSetSamplingModeExt(int mode); +int sceCtrlSetSamplingModeExt(SceCtrlPadInputMode mode); /** * Get the current controller mode. * - * @param[out] pMode - Return value, see ::CtrlMode. + * @param[out] pMode - Return value, see ::SceCtrlPadInputMode. * * @return The current mode, <0 on error. */ -int sceCtrlGetSamplingMode(int *pMode); +int sceCtrlGetSamplingMode(SceCtrlPadInputMode *pMode); /** * Get the controller state information (polling, positive logic). diff --git a/include/user/display.h b/include/user/display.h index 84d1887..58a08d2 100644 --- a/include/user/display.h +++ b/include/user/display.h @@ -7,55 +7,57 @@ extern "C" { #endif -enum { - SCE_DISPLAY_ERROR_OK = 0, - SCE_DISPLAY_ERROR_INVALID_HEAD = 0x80290000, - SCE_DISPLAY_ERROR_INVALID_VALUE = 0x80290001, - SCE_DISPLAY_ERROR_INVALID_ADDR = 0x80290002, - SCE_DISPLAY_ERROR_INVALID_PIXELFORMAT = 0x80290003, - SCE_DISPLAY_ERROR_INVALID_PITCH = 0x80290004, - SCE_DISPLAY_ERROR_INVALID_RESOLUTION = 0x80290005, - SCE_DISPLAY_ERROR_INVALID_UPDATETIMING = 0x80290006, - SCE_DISPLAY_ERROR_NO_FRAME_BUFFER = 0x80290007, - SCE_DISPLAY_ERROR_NO_PIXEL_DATA = 0x80290008 -}; - -#define SCE_DISPLAY_PIXELFORMAT_A8B8G8R8 0x00000000U - -enum { +typedef enum SceDisplayErrorCode { + SCE_DISPLAY_ERROR_OK = 0, + SCE_DISPLAY_ERROR_INVALID_HEAD = 0x80290000, + SCE_DISPLAY_ERROR_INVALID_VALUE = 0x80290001, + SCE_DISPLAY_ERROR_INVALID_ADDR = 0x80290002, + SCE_DISPLAY_ERROR_INVALID_PIXELFORMAT = 0x80290003, + SCE_DISPLAY_ERROR_INVALID_PITCH = 0x80290004, + SCE_DISPLAY_ERROR_INVALID_RESOLUTION = 0x80290005, + SCE_DISPLAY_ERROR_INVALID_UPDATETIMING = 0x80290006, + SCE_DISPLAY_ERROR_NO_FRAME_BUFFER = 0x80290007, + SCE_DISPLAY_ERROR_NO_PIXEL_DATA = 0x80290008 +} SceDisplayErrorCode; + +typedef enum SceDisplayPixelFormat { + SCE_DISPLAY_PIXELFORMAT_A8B8G8R8 = 0x00000000U +} SceDisplayPixelFormat; + +typedef enum SceDisplaySetBufSync { /** Buffer change effective immediately */ SCE_DISPLAY_SETBUF_IMMEDIATE = 0, /** Buffer change effective next frame */ SCE_DISPLAY_SETBUF_NEXTFRAME = 1 -}; +} SceDisplaySetBufSync; /** - * Structure used with sceDisplaySetFrameBuf to set/update framebuffer. + * Structure used with ::sceDisplaySetFrameBuf to set/update framebuffer. * Original screen resolution is 960x544, but the following resolutions * can also be supplied as width and height : * 480x272, 640x368, 720x408 * - * @note - This structure is returned by sceDisplayGetFrameBuf + * @note - This structure is returned by ::sceDisplayGetFrameBuf */ typedef struct SceDisplayFrameBuf { - SceSize size; //!< sizeof(SceDisplayFrameBuf) - void *base; //!< Pointer to framebuffer - unsigned int pitch; //!< pitch pixels - unsigned int pixelformat; //!< use SCE_DISPLAY_PIXELFORMAT_A8B8G8R8 - unsigned int width; //!< framebuffer width - unsigned int height; //!< framebuffer height + SceSize size; //!< sizeof(SceDisplayFrameBuf) + void *base; //!< Pointer to framebuffer + unsigned int pitch; //!< pitch pixels + unsigned int pixelformat; //!< pixel format (one of ::SceDisplayPixelFormat) + unsigned int width; //!< framebuffer width + unsigned int height; //!< framebuffer height } SceDisplayFrameBuf; /** * Set/Update framebuffer parameters * * @param[in] pParam - Pointer to a ::SceDisplayFrameBuf structure. - * @param[in] sync - One of ::DisplaySetBufSync + * @param[in] sync - One of ::SceDisplaySetBufSync * * @return 0 on success, < 0 on error. * @note - If NULL is provided as pParam pointer, output is blacked out. */ -int sceDisplaySetFrameBuf(const SceDisplayFrameBuf *pParam, int sync); +int sceDisplaySetFrameBuf(const SceDisplayFrameBuf *pParam, SceDisplaySetBufSync sync); /** * Get current framebuffer parameters @@ -63,11 +65,11 @@ int sceDisplaySetFrameBuf(const SceDisplayFrameBuf *pParam, int sync); * @param[out] pParam - Pointer to a ::SceDisplayFrameBuf structure * which will receive framebuffer parameters. * - * @param[in] sync - One of ::DisplaySetBufSync + * @param[in] sync - One of ::SceDisplaySetBufSync * * @return 0 on success, < 0 on error. */ -int sceDisplayGetFrameBuf(SceDisplayFrameBuf *pParam, int sync); +int sceDisplayGetFrameBuf(SceDisplayFrameBuf *pParam, SceDisplaySetBufSync sync); /** * Get current number of fps for the current screen mode. diff --git a/include/user/kernel/modulemgr.h b/include/user/kernel/modulemgr.h index 58ce37a..ddf72dc 100644 --- a/include/user/kernel/modulemgr.h +++ b/include/user/kernel/modulemgr.h @@ -21,21 +21,21 @@ extern "C" { #define SCE_KERNEL_STOP_CANCEL SCE_KERNEL_STOP_FAIL /** @} */ -typedef struct +typedef struct SceKernelSegmentInfo { - SceUInt size; //< this structure size (0x18) - SceUInt perms; //< probably rwx in low bits - void *vaddr; //< address in memory - SceUInt memsz; //< size in memory - SceUInt flags; //< meaning unknown - SceUInt res; //< unused? + 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? } SceKernelSegmentInfo; typedef struct { - SceUInt size; //< 0x1B8 for Vita 1.x - SceUInt handle; //< kernel module handle? - SceUInt flags; //< some bits. could be priority or whatnot + 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; @@ -50,7 +50,7 @@ typedef struct SceSize tlsAreaSize; char path[256]; SceKernelSegmentInfo segments[4]; - SceUInt type; //< 6 = user-mode PRX? + SceUInt type; //!< 6 = user-mode PRX? } SceKernelModuleInfo; typedef struct { diff --git a/include/user/kernel/processmgr.h b/include/user/kernel/processmgr.h index 2784d12..8bd2cdd 100644 --- a/include/user/kernel/processmgr.h +++ b/include/user/kernel/processmgr.h @@ -8,28 +8,28 @@ extern "C" { #endif -enum { - SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_HIGH = 32, - SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_DEFAULT = 96, - SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_LOW = 159 -}; - -enum { - SCE_KERNEL_PROCESS_PRIORITY_USER_HIGH = 64, - SCE_KERNEL_PROCESS_PRIORITY_USER_DEFAULT = 96, - SCE_KERNEL_PROCESS_PRIORITY_USER_LOW = 127 -}; - -enum { +typedef enum SceKernelProcessPrioritySystem { + SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_HIGH = 32, + SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_DEFAULT = 96, + SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_LOW = 159 +} SceKernelProcessPrioritySystem; + +typedef enum SceKernelProcessPriorityUser { + SCE_KERNEL_PROCESS_PRIORITY_USER_HIGH = 64, + SCE_KERNEL_PROCESS_PRIORITY_USER_DEFAULT = 96, + SCE_KERNEL_PROCESS_PRIORITY_USER_LOW = 127 +} SceKernelProcessPriorityUser; + +typedef enum SceKernelPowerTickType { /** Cancel all timers */ - SCE_KERNEL_POWER_TICK_DEFAULT = 0, + SCE_KERNEL_POWER_TICK_DEFAULT = 0, /** Cancel automatic suspension timer */ - SCE_KERNEL_POWER_TICK_DISABLE_AUTO_SUSPEND = 1, + SCE_KERNEL_POWER_TICK_DISABLE_AUTO_SUSPEND = 1, /** Cancel OLED-off timer */ - SCE_KERNEL_POWER_TICK_DISABLE_OLED_OFF = 4, + SCE_KERNEL_POWER_TICK_DISABLE_OLED_OFF = 4, /** Cancel OLED dimming timer */ - SCE_KERNEL_POWER_TICK_DISABLE_OLED_DIMMING = 6 -}; + SCE_KERNEL_POWER_TICK_DISABLE_OLED_DIMMING = 6 +} SceKernelPowerTickType; /*** * Exit current Process with specified return code @@ -44,29 +44,29 @@ int sceKernelExitProcess(int res); /*** * Cancel specified idle timers to prevent entering in power save processing. * - * @param[in] type - One of ::KernelPowerTickType + * @param[in] type - One of ::SceKernelPowerTickType * * @return 0 */ -int sceKernelPowerTick(int type); +int sceKernelPowerTick(SceKernelPowerTickType type); /*** * Locks certain timers from triggering. * - * @param[in] type - One of ::KernelPowerTickType + * @param[in] type - One of ::SceKernelPowerTickType * * @return 0 */ -int sceKernelPowerLock(int type); +int sceKernelPowerLock(SceKernelPowerTickType type); /*** * Unlocks certain timers. * - * @param[in] type - One of ::KernelPowerTickType + * @param[in] type - One of ::SceKernelPowerTickType * * @return 0 */ -int sceKernelPowerUnlock(int type); +int sceKernelPowerUnlock(SceKernelPowerTickType type); /*** * Get the process time of the current process. diff --git a/include/user/kernel/sysmem.h b/include/user/kernel/sysmem.h index c517210..1694ab2 100644 --- a/include/user/kernel/sysmem.h +++ b/include/user/kernel/sysmem.h @@ -7,15 +7,13 @@ extern "C" { #endif -typedef int SceKernelMemBlockType; - -enum { - SCE_KERNEL_MEMBLOCK_TYPE_USER_RW = 0x0c20d060, - SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE = 0x0c208060, - 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 -}; +typedef enum SceKernelMemBlockType { + SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE = 0x0c208060, + 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; typedef struct SceKernelAllocMemBlockOpt { SceSize size; @@ -23,14 +21,34 @@ typedef struct SceKernelAllocMemBlockOpt { SceSize alignment; SceUInt32 uidBaseBlock; const char *strBaseBlockName; - int flags; //! Unknown flags 0x10 or 0x30 for sceKernelOpenMemBlock + int flags; //! Unknown flags 0x10 or 0x30 for ::sceKernelOpenMemBlock int reserved[10]; } SceKernelAllocMemBlockOpt; -enum { - SCE_KERNEL_MODEL_VITA = 0x10000, +typedef enum SceKernelModel { + SCE_KERNEL_MODEL_VITA = 0x10000, SCE_KERNEL_MODEL_VITATV = 0x20000 -}; +} SceKernelModel; + +typedef struct SceKernelMemBlockInfo { + SceSize size; + void *mappedBase; + SceSize mappedSize; + int memoryType; + SceUInt32 access; + SceKernelMemBlockType type; +} SceKernelMemBlockInfo; + +typedef enum SceKernelMemoryAccessType { + SCE_KERNEL_MEMORY_ACCESS_X = 0x01, + SCE_KERNEL_MEMORY_ACCESS_W = 0x02, + SCE_KERNEL_MEMORY_ACCESS_R = 0x04 +} SceKernelMemoryAccessType; + +typedef enum SceKernelMemoryType { + SCE_KERNEL_MEMORY_TYPE_NORMAL_NC = 0x80, + SCE_KERNEL_MEMORY_TYPE_NORMAL = 0xD0 +} SceKernelMemoryType; /*** * Allocates a new memory block @@ -63,22 +81,6 @@ int sceKernelFreeMemBlock(SceUID uid); */ int sceKernelGetMemBlockBase(SceUID uid, void **basep); -typedef struct SceKernelMemBlockInfo { - SceSize size; - void *mappedBase; - SceSize mappedSize; - int memoryType; - SceUInt32 access; - SceKernelMemBlockType type; -} SceKernelMemBlockInfo; - -#define SCE_KERNEL_MEMORY_ACCESS_X 0x01 -#define SCE_KERNEL_MEMORY_ACCESS_W 0x02 -#define SCE_KERNEL_MEMORY_ACCESS_R 0x04 - -#define SCE_KERNEL_MEMORY_TYPE_NORMAL_NC 0x80 -#define SCE_KERNEL_MEMORY_TYPE_NORMAL 0xD0 - SceUID sceKernelFindMemBlockByAddr(const void *addr, SceSize size); int sceKernelGetMemBlockInfoByAddr(void *base, SceKernelMemBlockInfo *info); diff --git a/include/user/kernel/threadmgr.h b/include/user/kernel/threadmgr.h index d26272b..346db54 100644 --- a/include/user/kernel/threadmgr.h +++ b/include/user/kernel/threadmgr.h @@ -17,9 +17,9 @@ typedef int (*SceKernelThreadEntry)(SceSize args, void *argp); /** Additional options used when creating threads. */ typedef struct SceKernelThreadOptParam { /** Size of the ::SceKernelThreadOptParam structure. */ - SceSize size; + SceSize size; /** Attributes */ - SceUInt32 attr; + SceUInt32 attr; } SceKernelThreadOptParam; /** Structure to hold the status information for a thread @@ -27,51 +27,51 @@ typedef struct SceKernelThreadOptParam { */ typedef struct SceKernelThreadInfo { /** Size of the structure */ - SceSize size; + SceSize size; /** The UID of the process where the thread belongs */ - SceUID processId; //Needs confirmation + SceUID processId; //Needs confirmation /** Nul terminated name of the thread */ - char name[32]; + char name[32]; /** Thread attributes */ - SceUInt attr; + SceUInt attr; /** Thread status */ - int status; + int status; /** Thread entry point */ SceKernelThreadEntry entry; /** Thread stack pointer */ - void *stack; + void *stack; /** Thread stack size */ - int stackSize; + int stackSize; /** Initial priority */ - int initPriority; + int initPriority; /** Current priority */ - int currentPriority; + int currentPriority; /** Initial CPU affinity mask */ - int initCpuAffinityMask; + int initCpuAffinityMask; /** Current CPU affinity mask */ - int currentCpuAffinityMask; + int currentCpuAffinityMask; /** Current CPU ID */ - int currentCpuId; + int currentCpuId; /** Last executed CPU ID */ - int lastExecutedCpuId; + int lastExecutedCpuId; /** Wait type */ - int waitType; + int waitType; /** Wait id */ - SceUID waitId; + SceUID waitId; /** Exit status of the thread */ - int exitStatus; + int exitStatus; /** Number of clock cycles run */ - SceKernelSysClock runClocks; + SceKernelSysClock runClocks; /** Interrupt preemption count */ - SceUInt intrPreemptCount; + SceUInt intrPreemptCount; /** Thread preemption count */ - SceUInt threadPreemptCount; + SceUInt threadPreemptCount; /** Thread release count */ - SceUInt threadReleaseCount; + SceUInt threadReleaseCount; /** Function notify callback UID */ - SceUID fNotifyCallback; + SceUID fNotifyCallback; /** Reserved */ - int reserved; + int reserved; } SceKernelThreadInfo; /** Statistics about a running thread. @@ -87,8 +87,7 @@ typedef struct SceKernelThreadRunStatus { } SceKernelThreadRunStatus; /* Sure there must be more than this, but haven't seen them */ -typedef enum SceThreadStatus -{ +typedef enum SceThreadStatus { SCE_THREAD_RUNNING = 1, SCE_THREAD_READY = 2, SCE_THREAD_WAITING = 4, @@ -132,7 +131,7 @@ int sceKernelDeleteThread(SceUID thid); /** * Start a created thread * - * @param thid - Thread id from sceKernelCreateThread + * @param thid - Thread id from ::sceKernelCreateThread * @param arglen - Length of the data pointed to by argp, in bytes * @param argp - Pointer to the arguments. */ @@ -211,7 +210,7 @@ int sceKernelChangeCurrentThreadAttr(int unknown, SceUInt attr); /** * Change the threads current priority. * - * @param thid - The ID of the thread (from sceKernelCreateThread or sceKernelGetThreadId) + * @param thid - The ID of the thread (from ::sceKernelCreateThread or ::sceKernelGetThreadId) * @param priority - The new priority (the lower the number the higher the priority) * * @par Example: @@ -369,7 +368,7 @@ int sceKernelDeleteSema(SceUID semaid); * sceKernelSignalSema(semaid, 1); * @endcode * - * @param semaid - The sema id returned from sceKernelCreateSema + * @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) * * @return < 0 On error. @@ -384,7 +383,7 @@ int sceKernelSignalSema(SceUID semaid, int signal); * sceKernelWaitSema(semaid, 1, 0); * @endcode * - * @param semaid - The sema id returned from sceKernelCreateSema + * @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). * @@ -400,7 +399,7 @@ int sceKernelWaitSema(SceUID semaid, int signal, SceUInt *timeout); * sceKernelWaitSemaCB(semaid, 1, 0); * @endcode * - * @param semaid - The sema id returned from sceKernelCreateSema + * @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). * @@ -421,7 +420,7 @@ int sceKernelPollSema(SceUID semaid, int signal); /** * 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 * @return < 0 On error. @@ -444,8 +443,8 @@ int sceKernelGetSemaInfo(SceUID semaid, SceKernelSemaInfo *info); /** Additional options used when creating mutexes. */ typedef struct SceKernelMutexOptParam { /** Size of the ::SceKernelMutexOptParam structure. */ - SceSize size; - int ceilingPriority; + SceSize size; + int ceilingPriority; } SceKernelMutexOptParam; /** Current state of a mutex. @@ -490,7 +489,7 @@ SceUID sceKernelCreateMutex(const char *name, SceUInt attr, int initCount, SceKe /** * Destroy a mutex * - * @param mutexid - The mutex id returned from sceKernelCreateMutex + * @param mutexid - The mutex id returned from ::sceKernelCreateMutex * @return Returns the value 0 if it's successful, otherwise -1 */ int sceKernelDeleteMutex(SceUID mutexid); @@ -506,7 +505,7 @@ int sceKernelOpenMutex(const char *name); /** * Close a mutex * - * @param mutexid - The mutex id returned from sceKernelCreateMutex + * @param mutexid - The mutex id returned from ::sceKernelCreateMutex * @return Returns the value 0 if it's successful, otherwise -1 */ int sceKernelCloseMutex(SceUID mutexid); @@ -514,7 +513,7 @@ int 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) * @return < 0 On error. @@ -524,7 +523,7 @@ int sceKernelLockMutex(SceUID mutexid, int lockCount, unsigned int *timeout); /** * 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) * @return < 0 On error. @@ -534,7 +533,7 @@ int sceKernelLockMutexCB(SceUID mutexid, int lockCount, unsigned int *timeout); /** * 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. */ @@ -543,7 +542,7 @@ int sceKernelTryLockMutex(SceUID mutexid, int 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. */ @@ -552,7 +551,7 @@ int sceKernelUnlockMutex(SceUID mutexid, int 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 * @return < 0 On error. @@ -574,13 +573,13 @@ int sceKernelGetMutexInfo(SceUID mutexid, SceKernelMutexInfo info); /** 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; // Needs confirmation + char name[32]; + SceUInt attr; + SceUInt initPattern; + SceUInt currentPattern; + int numWaitThreads; } SceKernelEventFlagInfo; typedef struct SceKernelEventFlagOptParam { @@ -598,11 +597,11 @@ typedef enum SceEventFlagAttributes { /** Event flag wait types */ typedef enum SceEventFlagWaitTypes { /** Wait for all bits in the pattern to be set */ - SCE_EVENT_WAITAND = 0, + SCE_EVENT_WAITAND = 0, /** Wait for one or more bits in the pattern to be set */ - SCE_EVENT_WAITOR = 1, + SCE_EVENT_WAITOR = 1, /** Clear all the bits when it matches */ - SCE_EVENT_WAITCLEAR = 2, + SCE_EVENT_WAITCLEAR = 2, /** Clear the wait pattern when it matches */ SCE_EVENT_WAITCLEAR_PAT = 4 } SceEventFlagWaitTypes; @@ -627,7 +626,7 @@ SceUID sceKernelCreateEventFlag(const char *name, int attr, int bits, SceKernelE /** * Set an event flag bit pattern. * - * @param evid - The event id returned by sceKernelCreateEventFlag. + * @param evid - The event id returned by ::sceKernelCreateEventFlag. * @param bits - The bit pattern to set. * * @return < 0 On error @@ -647,7 +646,7 @@ int sceKernelClearEventFlag(SceUID evid, unsigned int bits); /** * Poll an event flag for a given bit pattern. * - * @param evid - The event id returned by sceKernelCreateEventFlag. + * @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. @@ -658,7 +657,7 @@ int sceKernelPollEventFlag(int evid, unsigned int bits, unsigned int wait, unsig /** * Wait for an event flag for a given bit pattern. * - * @param evid - The event id returned by sceKernelCreateEventFlag. + * @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. @@ -670,7 +669,7 @@ int sceKernelWaitEventFlag(int evid, unsigned int bits, unsigned int wait, unsig /** * Wait for an event flag for a given bit pattern with callback. * - * @param evid - The event id returned by sceKernelCreateEventFlag. + * @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. @@ -682,7 +681,7 @@ int sceKernelWaitEventFlagCB(int evid, unsigned int bits, unsigned int wait, uns /** * Delete an event flag * - * @param evid - The event id returned by sceKernelCreateEventFlag. + * @param evid - The event id returned by ::sceKernelCreateEventFlag. * * @return < 0 On error */ @@ -744,7 +743,7 @@ SceUID sceKernelCreateCond(const char *name, SceUInt attr, SceUID mutexId, const /** * Destroy a condition variable * - * @param condition variableid - The condition variable id returned from sceKernelCreateCond + * @param condition variableid - The condition variable id returned from ::sceKernelCreateCond * @return Returns the value 0 if it's successful, otherwise -1 */ int sceKernelDeleteCond(SceUID condId); @@ -760,7 +759,7 @@ int sceKernelOpenCond(const char *name); /** * Close a condition variable * - * @param condition variableid - The condition variable id returned from sceKernelCreateCond + * @param condition variableid - The condition variable id returned from ::sceKernelCreateCond * @return Returns the value 0 if it's successful, otherwise -1 */ int sceKernelCloseCond(SceUID condId); @@ -768,7 +767,7 @@ int sceKernelCloseCond(SceUID condId); /** * Waits for a signal of a condition variable * - * @param condId - The condition variable id returned from sceKernelCreateCond + * @param condId - The condition variable id returned from ::sceKernelCreateCond * @param timeout - Timeout in microseconds (assumed) * @return < 0 On error. */ @@ -777,7 +776,7 @@ int sceKernelWaitCond(SceUID condId, unsigned int *timeout); /** * Waits for a signal of a condition variable (with callbacks) * - * @param condId - The condition variable id returned from sceKernelCreateCond + * @param condId - The condition variable id returned from ::sceKernelCreateCond * @param timeout - Timeout in microseconds (assumed) * @return < 0 On error. */ @@ -786,7 +785,7 @@ int sceKernelWaitCondCB(SceUID condId, unsigned int *timeout); /** * Signals a condition variable * - * @param condId - The condition variable id returned from sceKernelCreateCond + * @param condId - The condition variable id returned from ::sceKernelCreateCond * @return < 0 On error. */ int sceKernelSignalCond(SceUID condId); @@ -794,7 +793,7 @@ int sceKernelSignalCond(SceUID condId); /** * Signals a condition variable to all threads waiting for it * - * @param condId - The condition variable id returned from sceKernelCreateCond + * @param condId - The condition variable id returned from ::sceKernelCreateCond * @return < 0 On error. */ int sceKernelSignalCondAll(SceUID condId); @@ -802,8 +801,8 @@ int sceKernelSignalCondAll(SceUID condId); /** * Signals a condition variable to a specific thread waiting for it * - * @param condId - The condition variable id returned from sceKernelCreateCond - * @param threadId - The thread id returned from sceKernelCreateThread + * @param condId - The condition variable id returned from ::sceKernelCreateCond + * @param threadId - The thread id returned from ::sceKernelCreateThread * @return < 0 On error. */ int sceKernelSignalCondTo(SceUID condId, SceUID threadId); @@ -1072,21 +1071,21 @@ int sceKernelGetSystemInfo(SceKernelSystemInfo *info); /** Threadmgr types */ typedef enum SceKernelIdListType { - SCE_KERNEL_TMID_Thread = 1, - SCE_KERNEL_TMID_Semaphore = 2, - SCE_KERNEL_TMID_EventFlag = 3, - SCE_KERNEL_TMID_Mbox = 4, - SCE_KERNEL_TMID_Vpl = 5, - SCE_KERNEL_TMID_Fpl = 6, - SCE_KERNEL_TMID_Mpipe = 7, - SCE_KERNEL_TMID_Callback = 8, + SCE_KERNEL_TMID_Thread = 1, + SCE_KERNEL_TMID_Semaphore = 2, + SCE_KERNEL_TMID_EventFlag = 3, + SCE_KERNEL_TMID_Mbox = 4, + SCE_KERNEL_TMID_Vpl = 5, + SCE_KERNEL_TMID_Fpl = 6, + SCE_KERNEL_TMID_Mpipe = 7, + SCE_KERNEL_TMID_Callback = 8, SCE_KERNEL_TMID_ThreadEventHandler = 9, - SCE_KERNEL_TMID_Alarm = 10, - SCE_KERNEL_TMID_VTimer = 11, - SCE_KERNEL_TMID_SleepThread = 64, - SCE_KERNEL_TMID_DelayThread = 65, - SCE_KERNEL_TMID_SuspendThread = 66, - SCE_KERNEL_TMID_DormantThread = 67, + SCE_KERNEL_TMID_Alarm = 10, + SCE_KERNEL_TMID_VTimer = 11, + SCE_KERNEL_TMID_SleepThread = 64, + SCE_KERNEL_TMID_DelayThread = 65, + SCE_KERNEL_TMID_SuspendThread = 66, + SCE_KERNEL_TMID_DormantThread = 67 } SceKernelIdListType; /** diff --git a/include/user/npdrmpackage.h b/include/user/npdrmpackage.h index 5a41475..4df5eca 100644 --- a/include/user/npdrmpackage.h +++ b/include/user/npdrmpackage.h @@ -8,13 +8,13 @@ extern "C" { #endif /** Options for _sceNpDrmPackageDecrypt */ -typedef struct { +typedef struct _sceNpDrmPackageDecrypt { /** The offset in the encrypted data */ SceOff offset; /** * The identifier specified for _sceNpDrmPackageCheck but NOT ORed - * with (1 << 8) + * with (1 << 8) */ unsigned int identifier; } _sceNpDrmPackageDecrypt_opt; @@ -42,7 +42,7 @@ int _sceNpDrmPackageCheck(const void *buffer, SceSize size, int zero, unsigned i * * @return 0 on success, != 0 on error */ -int _sceNpDrmPackageDecrypt(void * restrict buffer, SceSize size, _sceNpDrmPackageDecrypt_opt * restrict opt); +int _sceNpDrmPackageDecrypt(void * __restrict__ buffer, SceSize size, _sceNpDrmPackageDecrypt_opt * __restrict__ opt); #ifdef __cplusplus } diff --git a/include/user/power.h b/include/user/power.h index 02ba7ff..8a6cadd 100644 --- a/include/user/power.h +++ b/include/user/power.h @@ -8,20 +8,22 @@ extern "C" { #endif -enum { - /*indicates the unit is suspending, seems to occur due to inactivity*/ - SCE_POWER_CB_SUSPENDING = 0x00010000, - /*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 -}; +typedef enum ScePowerCallbackType { + /** indicates the unit is suspending, seems to occur due to inactivity */ + SCE_POWER_CB_SUSPENDING = 0x00010000, + /** 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 +}ScePowerCallbackType; /* Callbacks */ /** Callback function prototype */ typedef void (*ScePowerCallback)(int notifyId, int notifyCount, int powerInfo); +/* Prototypes */ + /** * Registers a ScePower Callback * @@ -40,8 +42,6 @@ int scePowerRegisterCallback(SceUID cbid); */ int scePowerUnregisterCallback(SceUID cbid); -/* Prototypes */ - /** * Returns battery charging status * @@ -232,4 +232,3 @@ int scePowerSetGpuXbarClockFrequency(int freq); #endif #endif /* _PSP2_POWER_H_ */ - diff --git a/include/user/promoterutil.h b/include/user/promoterutil.h index 9e49a0f..283706c 100644 --- a/include/user/promoterutil.h +++ b/include/user/promoterutil.h @@ -9,8 +9,8 @@ extern "C" { /** Parameters for scePromoterUtilityUpdateLiveArea() */ typedef struct ScePromoterUtilityLAUpdate { - char titleid[12]; //!< Target app. - char path[128]; //!< Directory of extracted LA update data. + char titleid[12]; //!< Target app. + char path[128]; //!< Directory of extracted LA update data. } ScePromoterUtilityLAUpdate; /** diff --git a/include/user/shellutil.h b/include/user/shellutil.h index 863cbd7..61d602b 100644 --- a/include/user/shellutil.h +++ b/include/user/shellutil.h @@ -5,27 +5,27 @@ extern "C" { #endif -enum { - SCE_SHELL_UTIL_LOCK_TYPE_PS_BTN = 0x1, - SCE_SHELL_UTIL_LOCK_TYPE_QUICK_MENU = 0x2, - SCE_SHELL_UTIL_LOCK_TYPE_POWEROFF_MENU = 0x4, - SCE_SHELL_UTIL_LOCK_TYPE_UNK8 = 0x8, - SCE_SHELL_UTIL_LOCK_TYPE_USB_CONNECTION = 0x10, - SCE_SHELL_UTIL_LOCK_TYPE_MC_INSERTED = 0x20, - SCE_SHELL_UTIL_LOCK_TYPE_MC_REMOVED = 0x40, - SCE_SHELL_UTIL_LOCK_TYPE_UNK80 = 0x80, - SCE_SHELL_UTIL_LOCK_TYPE_UNK100 = 0x100, - SCE_SHELL_UTIL_LOCK_TYPE_UNK200 = 0x200, - SCE_SHELL_UTIL_LOCK_TYPE_MUSIC_PLAYER = 0x400, - SCE_SHELL_UTIL_LOCK_TYPE_PS_BTN_2 = 0x800, //! without the stop symbol -}; +typedef enum SceShellUtilLockType { + SCE_SHELL_UTIL_LOCK_TYPE_PS_BTN = 0x1, + SCE_SHELL_UTIL_LOCK_TYPE_QUICK_MENU = 0x2, + SCE_SHELL_UTIL_LOCK_TYPE_POWEROFF_MENU = 0x4, + SCE_SHELL_UTIL_LOCK_TYPE_UNK8 = 0x8, + SCE_SHELL_UTIL_LOCK_TYPE_USB_CONNECTION = 0x10, + SCE_SHELL_UTIL_LOCK_TYPE_MC_INSERTED = 0x20, + SCE_SHELL_UTIL_LOCK_TYPE_MC_REMOVED = 0x40, + SCE_SHELL_UTIL_LOCK_TYPE_UNK80 = 0x80, + SCE_SHELL_UTIL_LOCK_TYPE_UNK100 = 0x100, + SCE_SHELL_UTIL_LOCK_TYPE_UNK200 = 0x200, + SCE_SHELL_UTIL_LOCK_TYPE_MUSIC_PLAYER = 0x400, + SCE_SHELL_UTIL_LOCK_TYPE_PS_BTN_2 = 0x800 //! without the stop symbol +} SceShellUtilLockType; -enum { - SCE_SHELL_UTIL_LOCK_MODE_LOCK = 0x1, - SCE_SHELL_UTIL_LOCK_MODE_UNLOCK = 0x2, -}; +typedef enum SceShellUtilLockMode { + SCE_SHELL_UTIL_LOCK_MODE_LOCK = 1, + SCE_SHELL_UTIL_LOCK_MODE_UNLOCK = 2 +} SceShellUtilLockMode; -typedef void (SceShellUtilEventHandler)(int result, int mode, int type, void *userData); +typedef void (SceShellUtilEventHandler)(int result, SceShellUtilLockMode mode, SceShellUtilLockType type, void *userData); /** * Init events @@ -50,20 +50,20 @@ int sceShellUtilRegisterEventHandler(SceShellUtilEventHandler *handler, void *us /** * Lock event * - * @param[in] type - One of ::ShellUtilLockType + * @param[in] type - One of ::SceShellUtilLockType * * @return 0 on success, < 0 on error. */ -int sceShellUtilLock(int type); +int sceShellUtilLock(SceShellUtilLockType type); /** * Unlock event * - * @param[in] type - One of ::ShellUtilLockType + * @param[in] type - One of ::SceShellUtilLockType * * @return 0 on success, < 0 on error. */ -int sceShellUtilUnlock(int type); +int sceShellUtilUnlock(SceShellUtilLockType type); #ifdef __cplusplus } diff --git a/include/user/sysmodule.h b/include/user/sysmodule.h index 8cc2a37..23319cb 100644 --- a/include/user/sysmodule.h +++ b/include/user/sysmodule.h @@ -7,15 +7,15 @@ extern "C" { #endif -enum { - SCE_SYSMODULE_LOADED = 0, - SCE_SYSMODULE_ERROR_INVALID_VALUE = 0x805A1000, - SCE_SYSMODULE_ERROR_UNLOADED = 0x805A1001, - SCE_SYSMODULE_ERROR_FATAL = 0x805A10FF, -}; +typedef enum SceSysmoduleErrorCode { + SCE_SYSMODULE_LOADED = 0, + SCE_SYSMODULE_ERROR_INVALID_VALUE = 0x805A1000, + SCE_SYSMODULE_ERROR_UNLOADED = 0x805A1001, + SCE_SYSMODULE_ERROR_FATAL = 0x805A10FF, +} SceSysmoduleErrorCode; /* module IDs */ -enum { +typedef enum SceSysmoduleModuleId { SCE_SYSMODULE_INVALID = 0x0000, SCE_SYSMODULE_NET = 0x0001, SCE_SYSMODULE_HTTP = 0x0002, @@ -72,21 +72,21 @@ enum { SCE_SYSMODULE_NEAR_DIALOG_UTIL = 0x004a, SCE_SYSMODULE_LOCATION_EXTENSION = 0x004b, SCE_SYSMODULE_AVPLAYER = 0x004c -}; +} SceSysmoduleModuleId; /* internal module IDs */ -enum { +typedef enum SceSysmoduleInternalModuleId { SCE_SYSMODULE_PAF = 0x80000008, SCE_SYSMODULE_PROMOTER_UTIL = 0x80000024 -}; +} SceSysmoduleInternalModuleId; -int sceSysmoduleLoadModule(SceUInt16 id); -int sceSysmoduleUnloadModule(SceUInt16 id); -int sceSysmoduleIsLoaded(SceUInt16 id); -int sceSysmoduleLoadModuleInternal(SceUInt32 id); -int sceSysmoduleUnloadModuleInternal(SceUInt32 id); -int sceSysmoduleIsLoadedInternal(SceUInt32 id); -int sceSysmoduleLoadModuleInternalWithArg(SceUInt32 id, SceSize args, void *argp, void *unk); +int sceSysmoduleLoadModule(SceSysmoduleModuleId id); +int sceSysmoduleUnloadModule(SceSysmoduleModuleId id); +int sceSysmoduleIsLoaded(SceSysmoduleModuleId id); +int sceSysmoduleLoadModuleInternal(SceSysmoduleInternalModuleId id); +int sceSysmoduleUnloadModuleInternal(SceSysmoduleInternalModuleId id); +int sceSysmoduleIsLoadedInternal(SceSysmoduleInternalModuleId id); +int sceSysmoduleLoadModuleInternalWithArg(SceSysmoduleInternalModuleId id, SceSize args, void *argp, void *unk); #ifdef __cplusplus } diff --git a/include/user/udcd.h b/include/user/udcd.h index 789d717..2915312 100644 --- a/include/user/udcd.h +++ b/include/user/udcd.h @@ -5,20 +5,20 @@ extern "C" { #endif -/* - * USB Status - */ -#define SCE_UDCD_STATUS_CONNECTION_NEW 0x0001 -#define SCE_UDCD_STATUS_CONNECTION_ESTABLISHED 0x0002 -#define SCE_UDCD_STATUS_CONNECTION_SUSPENDED 0x0004 -#define SCE_UDCD_STATUS_CABLE_DISCONNECTED 0x0010 -#define SCE_UDCD_STATUS_CABLE_CONNECTED 0x0020 -#define SCE_UDCD_STATUS_DEACTIVATED 0x0100 -#define SCE_UDCD_STATUS_ACTIVATED 0x0200 -#define SCE_UDCD_STATUS_IS_CHARGING 0x0400 -#define SCE_UDCD_STATUS_USE_USB_CHARGING 0x0800 -#define SCE_UDCD_STATUS_UNKNOWN_1000 0x1000 -#define SCE_UDCD_STATUS_UNKNOWN_2000 0x2000 +/** USB Status */ +typedef enum SceUdcdStatus { + SCE_UDCD_STATUS_CONNECTION_NEW = 0x0001, + SCE_UDCD_STATUS_CONNECTION_ESTABLISHED = 0x0002, + SCE_UDCD_STATUS_CONNECTION_SUSPENDED = 0x0004, + SCE_UDCD_STATUS_CABLE_DISCONNECTED = 0x0010, + SCE_UDCD_STATUS_CABLE_CONNECTED = 0x0020, + SCE_UDCD_STATUS_DEACTIVATED = 0x0100, + SCE_UDCD_STATUS_ACTIVATED = 0x0200, + SCE_UDCD_STATUS_IS_CHARGING = 0x0400, + SCE_UDCD_STATUS_USE_USB_CHARGING = 0x0800, + SCE_UDCD_STATUS_UNKNOWN_1000 = 0x1000, + SCE_UDCD_STATUS_UNKNOWN_2000 = 0x2000 +} SceUdcdStatus; typedef struct { uint8_t info[64]; diff --git a/include/user/usbd.h b/include/user/usbd.h index 2399abe..bc3e746 100644 --- a/include/user/usbd.h +++ b/include/user/usbd.h @@ -7,19 +7,21 @@ extern "C" { #endif -#define SCE_USBD_ERROR_ACCESS 0x80240003 -#define SCE_USBD_ERROR_BUSY 0x80240006 -#define SCE_USBD_ERROR_FATAL 0x802400ff -#define SCE_USBD_ERROR_INTERRUPTED 0x8024000a -#define SCE_USBD_ERROR_INVALID_ARG 0x80240002 -#define SCE_USBD_ERROR_IO 0x80240001 -#define SCE_USBD_ERROR_NO_DEVICE 0x80240004 -#define SCE_USBD_ERROR_NO_MEM 0x8024000b -#define SCE_USBD_ERROR_NOT_FOUND 0x80240005 -#define SCE_USBD_ERROR_NOT_SUPPORTED 0x8024000c -#define SCE_USBD_ERROR_OVERFLOW 0x80240008 -#define SCE_USBD_ERROR_PIPE 0x80240009 -#define SCE_USBD_ERROR_TIMEOUT 0x80240007 +typedef enum SceUsbdErrorCode { + SCE_USBD_ERROR_IO = 0x80240001, + SCE_USBD_ERROR_INVALID_ARG = 0x80240002, + SCE_USBD_ERROR_ACCESS = 0x80240003, + SCE_USBD_ERROR_NO_DEVICE = 0x80240004, + SCE_USBD_ERROR_NOT_FOUND = 0x80240005, + SCE_USBD_ERROR_BUSY = 0x80240006, + SCE_USBD_ERROR_TIMEOUT = 0x80240007, + SCE_USBD_ERROR_OVERFLOW = 0x80240008, + SCE_USBD_ERROR_PIPE = 0x80240009, + SCE_USBD_ERROR_INTERRUPTED = 0x8024000a, + SCE_USBD_ERROR_NO_MEM = 0x8024000b, + SCE_USBD_ERROR_NOT_SUPPORTED = 0x8024000c, + SCE_USBD_ERROR_FATAL = 0x802400ff +} SceUsbdErrorCode; typedef struct SceUsbdDeviceInfo { unsigned int unk0; diff --git a/include/user/usbstorvstor.h b/include/user/usbstorvstor.h index c71eb66..664133b 100644 --- a/include/user/usbstorvstor.h +++ b/include/user/usbstorvstor.h @@ -5,10 +5,10 @@ extern "C" { #endif -enum { - SCE_USBSTOR_VSTOR_TYPE_FAT = 0, - SCE_USBSTOR_VSTOR_TYPE_CDROM = 5, -}; +typedef enum SceUsbstorVstorType { + SCE_USBSTOR_VSTOR_TYPE_FAT = 0, + SCE_USBSTOR_VSTOR_TYPE_CDROM = 5 +} SceUsbstorVstorType; /** * Set image file path @@ -32,11 +32,11 @@ int sceUsbstorVStorSetDeviceInfo(const char *name, const char *version); /** * Start USB virtual storage * - * @param[in] type - One of ::UsbStorVstorType + * @param[in] type - One of ::SceUsbStorVstorType * * @return 0 on success, < 0 on error. */ -int sceUsbstorVStorStart(int type); +int sceUsbstorVStorStart(SceUsbStorVstorType type); /** * Stop USB virtual storage |