SceDeci4pSDfMgr: Difference between revisions

From Vita Development Wiki
Jump to navigation Jump to search
(→‎Types: Fix structure field names)
(→‎Types: Correct structure field names and descriptions again)
Line 54: Line 54:
typedef struct _SceSDfMgrOpenParam {
typedef struct _SceSDfMgrOpenParam {
     SceSize size;        //<! Size of this structure (0x1C)
     SceSize size;        //<! Size of this structure (0x1C)
     SceUInt32 clientId;  //<! Unique identifier, usually equal to uProtocol | 0x1000'0000
     SceUInt32 clientId;  //<! SDfMgr client ID (used as protocol ID for this service)
     SceUInt32 uProtocol; //<! Protocol ID
     SceUInt32 uAliasId; //<! Protocol alias ID
     SceUInt32 uVersion;  //<! Protocol version
     SceUInt32 uVersion;  //<! Protocol version
     SceUInt32 uVersionLimit;
     SceUInt32 uVersionLimit;
     SceUInt16 unk14;
     SceUInt16 unk14;
     SceUInt16 flags;     //<! Bitflag: 0x1 makes the initial "status" 0x3 instead of 0x1, 0x2 makes a call to dcmpSendStatusProtocolAlias, ...
     SceUInt16 flags;
     char* name;          //<! Protocol name - example: DCMP
     char* name;          //<! Protocol name - example: DCMP
} SceSDfMgrOpenParam;
} SceSDfMgrOpenParam;
/* For flags */
#define SCE_SDFMGR_OPENPARAM_FLAG_ALIAS_PROTOCOL  (0x0002) /* If present, register 'uAliasId' as an alias ID for protocol 'clientId' */


typedef void (* SceSDfMgrBreakHook)(void);
typedef void (* SceSDfMgrBreakHook)(void);

Revision as of 17:51, 18 February 2024

Module

This module exists only in non-secure world. The SELF can be found in os0:kd/deci4p_sdfmgr.skprx.

Version World Privilege
0.990-3.65 Non-secure Kernel

Libraries

Known NIDs

Version Name World Visibility NID
0.990-3.65 SceDeci4pSDfMgrForKernel Non-secure Kernel 0xA1386CB2

Types

//Error codes (guessed names)
#define SCE_DECI_SYS_ERROR_INVALID_ARGUMENT (-2146893823)      //<! 0x80090001
#define SCE_DECI_SYS_ERROR_INVALID_SOCKET (-2146893822)        //<! 0x80090002 - ExSend returns INVALID_ARGUMENT on a bad socket though :x
#define SCE_DECI_SYS_ERROR_ALREADY_REGISTERED (-2146893821)    //<! 0x80090003
#define SCE_DECI_SYS_ERROR_NO_ENTRY (-2146893820)              //<! 0x80090004 - no free entry to create socket remaining
#define SCE_DECI_SYS_ERROR_ILLEGAL_ADDR (-2146893819)          //<! 0x80090005 - unexpected NULL provided
#define SCE_DECI_SYS_ERROR_INVALID_ARGUMENT_SIZE (-2146893818) //<! 0x80090006
#define SCE_DECI_SYS_ERROR_BLOCKED (-2146893817)               //<! 0x80090007
#define SCE_DECI_SYS_ERROR_UNKNOWN_A (-2146893814)             //<! 0x8009000A
#define SCE_DECI_SYS_ERROR_NO_HOST_IF (-2146893811)            //<! 0x8009000D - no Host Interface

#define SCE_SDFMGR_EXCP_TYPE_PABT  (0)
#define SCE_SDFMGR_EXCP_TYPE_DABT  (1)
#define SCE_SDFMGR_EXCP_TYPE_UNDEF (2)
#define SCE_SDFMGR_EXCP_TYPE_BUS   (3)

typedef int (* SceSDfMgrExceptionCallback)(SceExcpmgrExceptionContext *context, SceUInt32 pc, SceUInt32 cpsr);

typedef SceInt32 SceSDfMgrSocketId;

#define SCE_DFMGR_EVENT_READ      (1) // Protocol data available to read
#define SCE_DFMGR_EVENT_READDONE  (2) // Protocol data read
#define SCE_DFMGR_EVENT_WRITE     (3) // Protocol data available to send
#define SCE_DFMGR_EVENT_WRITEDONE (4) // Protocol data sent
#define SCE_DFMGR_EVENT_CHSTATUS  (5) // Protocol status change?
#define SCE_DFMGR_EVENT_ERROR     (6) // ?Protocol? error occured

typedef void (* SceSDfMgrEventHandler)(SceUInt32 event, void* eventData, void* pCommon); //<! pCommon is the data passed to Open/ExOpen

typedef struct _SceSDfMgrOpenParam {
    SceSize size;        //<! Size of this structure (0x1C)
    SceUInt32 clientId;  //<! SDfMgr client ID (used as protocol ID for this service)
    SceUInt32 uAliasId;  //<! Protocol alias ID
    SceUInt32 uVersion;  //<! Protocol version
    SceUInt32 uVersionLimit;
    SceUInt16 unk14;
    SceUInt16 flags;
    char* name;           //<! Protocol name - example: DCMP
} SceSDfMgrOpenParam;

/* For flags */
#define SCE_SDFMGR_OPENPARAM_FLAG_ALIAS_PROTOCOL  (0x0002) /* If present, register 'uAliasId' as an alias ID for protocol 'clientId' */

typedef void (* SceSDfMgrBreakHook)(void);

SceDeci4pSDfMgrForKernel

sceSDfMgrOpenForKernel

Version NID
0.990-3.60 0xA55F5F0D

Acquires an interrupt-suspending lock and calls sceSDfMgrExOpenForKernel.

SceSDfMgrSocketId sceSDfMgrOpenForKernel(SceSDfMgrEventHandler eventHandler, const SceSDfMgrOpenParam* openParam, void* pCommon);

sceSDfMgrExOpenForKernel

Version NID
0.990-3.60 0xCF4A3E03

Opens a SDfMgr socket. openParam is not retained and can be disposed of after this call.

SceSDfMgrSocketId sceSDfMgrExOpenForKernel(SceSDfMgrEventHandler eventHandler, const SceSDfMgrOpenParam* openParam, void* pCommon);

sceSDfMgrExSendForKernel

Version NID
0.990-3.60 0xDAFE03AD

Sends up to bufLen bytes from buffer, and returns number of bytes sent on success.

Note that buffer is not const: this is not a typo. buffer may be written to under specific conditions.

SceSSize sceSDfMgrExSendForKernel(SceSDfMgrSocketId sock, void* buffer, SceSize bufLen);

sceSDfMgrExReqSendForKernel

Version NID
0.990-3.60 0xB44083E1

sceSDfMgrExRecvForKernel

Version NID
0.990-3.60 0xF43F5941

Receives up to bufLen bytes in buffer, and returns number of bytes received on success.

SceSSize sceSDfMgrExRecvForKernel(SceSDfMgrSocketId sock, void* buffer, SceSize bufLen);

sceSDfMgrCloseForKernel

Version NID
0.990-3.60 0x86CFC8C6

Acquires an interrupt-suspending lock and calls sceSDfMgrExCloseForKernel.

SceInt32 sceSDfMgrCloseForKernel(SceSDfMgrSocketId sock);

sceSDfMgrExCloseForKernel

Version NID
0.990-3.60 0x90E8D453

Close a SDfMgr socket.

SceInt32 sceSDfMgrExCloseForKernel(SceSDfMgrSocketId sock);

sceSDfMgrBreakSystemForKernel

Version NID
0.990-3.60 0xEDFBA012

Sets up some internal state and calls SceKernelIntrMgr#sceKernelGenerateSoftIntrForDriver(0, 1, 0).

SceInt32 sceSDfMgrBreakSystemForKernel(void);

sceSDfMgrContinueSystemForKernel

Version NID
0.990-3.60 0x9A653F19

Sets up some internal state and calls sceKernelGenerateSoftIntrForDriver(0, 1, 0).

SceInt32 sceSDfMgrContinueSystemForKernel(void);

SceDeci4pSDfMgrForKernel_A963E333

Version NID
0.990-3.60 0xA963E333

Calls sceSDfMgrExReqSend(sock), then may call an Host Interface function and/or call sceKernelGenerateSoftIntrForDriver(1, 0, targetLUT[sceKernelCpuId()]) where targetLUT = {1, 2, 4, 8}.

SceInt32 SceDeci4pSDfMgrForKernel_A963E333(SceSDfMgrSocketId sock);

SceDeci4pSDfMgrForKernel_98AEC60E

Version NID
0.990-3.60 0x98AEC60E

SceDeci4pSDfMgrForKernel_FFC95B63

Version NID
0.990-3.60 0xFFC95B63

Equivalent to SceDeci4pDfMgrForDebugger_6D26CC56.

Writes val as a 3-byte unsigned integer to ptr.

void SceDeci4pSDfMgrForKernel_FFC95B63(void* ptr, SceUInt32 val);

SceDeci4pSDfMgrForKernel_68903C1D

Version NID
0.990-3.60 0x68903C1D

Equivalent to SceDeci4pDfMgrForDebugger_CACAB5F9.

Reads value at ptr as a 3-byte unsigned integer and returns it.

SceUInt32 SceDeci4pSDfMgrForKernel_68903C1D(void* ptr);

SceDeci4pSDfMgrForKernel_81E7C5BD

Version NID
0.990-3.60 0x81E7C5BD

Special memset variant. len will be aligned down to meet 4-byte alignment requirement (i.e. bottom 2 bits of len are ignored).

void* SceDeci4pSDfMgrForKernel_81E7C5BD(void* dst, int ch, size_t len);

SceDeci4pSDfMgrForKernel_5996E2DB

Version NID
0.990-3.60 0x5996E2DB

Equivalent to memcpy.

void* SceDeci4pSDfMgrForKernel_8A3B06F2(void* dst, void* src, size_t len);

SceDeci4pSDfMgrForKernel_8A3B06F2

Version NID
0.990-3.60 0x8A3B06F2

Equivalent to memset.

void* SceDeci4pSDfMgrForKernel_8A3B06F2(void* dst, int ch, size_t len);

SceDeci4pSDfMgrForKernel_CCD56670

Version NID
0.990 0xCCD56670
3.60 not present

Equivalent to memchr.

void* SceDeci4pSDfMgrForKernel_CCD56670(void* s, int ch, size_t len);

SceDeci4pSDfMgrForKernel_501CE61D

Version NID
0.990-3.60 0x501CE61D

This is a printf-like function.

size_t SceDeci4pSDfMgrForKernel_501CE61D(char* fmt, ...);

SceDeci4pSDfMgrForKernel_0A6437B6

Version NID
0.990-3.60 0x0A6437B6

A potential name for is function is sceSDfMgrIsSystemInBreakForKernel.

Returns respectively 1 or 0 depending on whether sceSDfMgrBreakSystem or sceSDfMgrContinueSystem was called last.

SceBool SceDeci4pSDfMgrForKernel_0A6437B6(void);

sceSDfMgrUnregisterExcpHandlerForKernel

Version NID
0.990-3.60 0xB050A0D5

Temp name was sceSDfMgrUnregisterCpuExcpCallbackForKernel. This name is a deduction from sceSDfMgrRegisterExcpHandlerForKernel.

Unregisters an exception handler previously registered using sceSDfMgrRegisterExcpHandlerForKernel. Call it using the same arguments as provided to sceSDfMgrRegisterExcpHandlerForKernel.

SceInt32 sceSDfMgrUnregisterExcpHandlerForKernel(SceSDfMgrExceptionCallback func, SceUInt32 type);

sceSDfMgrRegisterExcpHandlerForKernel

Version NID
0.990-3.60 0x6BF5553C

Temp name was sceSDfMgrRegisterCpuExcpCallbackForKernel.

Used by SceDeci4pSDbgp.

SceInt32 sceSDfMgrRegisterExcpHandlerForKernel(SceSDfMgrExceptionCallback func, SceUInt32 type);

sceSDfMgrRegisterBreakHookForKernel

Version NID
0.990-3.60 0xB22B42FB

Registers a function to be called when some exceptions or interrupts happen.

SceInt32 sceSDfMgrRegisterBreakHookForKernel(SceSDfMgrBreakHook hook);

sceSDfMgrUnregisterBreakHookForKernel

Version NID
0.990-3.60 0xE53400AE

This is a guessed name. This name is a deduction from sceSDfMgrRegisterBreakHookForKernel.

Unregisters a break hook previously registered using sceSDfMgrRegisterBreakHookForKernel. Call it using the same argument as provided to sceSDfMgrRegisterBreakHookForKernel.

SceInt32 sceSDfMgrUnregisterBreakHookForKernel(SceSDfMgrBreakHook hook);

sceSDfMgrPollForKernel

Version NID
3.60 0x152D98DF

sceSDfMgrGetMemoryTypeForKernel

Version NID
3.60 0x35238B8A

This is a guessed name.

If DIP switch 210 is set, returns SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_RW, else returns SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_GAME_RW.

SceUInt32 sceSDfMgrGetMemoryTypeForKernel(void);
         SceDeci4pSDfMgrForKernel_11340BD4: 0x11340BD4
         SceDeci4pSDfMgrForKernel_3A25594F: 0x3A25594F
         SceDeci4pSDfMgrForKernel_4D974C08: 0x4D974C08
         SceDeci4pSDfMgrForKernel_4EA65698: 0x4EA65698
         SceDeci4pSDfMgrForKernel_58D7597A: 0x58D7597A
         SceDeci4pSDfMgrForKernel_59C077B3: 0x59C077B3
         SceDeci4pSDfMgrForKernel_682D0EFB: 0x682D0EFB
         SceDeci4pSDfMgrForKernel_BFB482D8: 0xBFB482D8
         SceDeci4pSDfMgrForKernel_C38EA67A: 0xC38EA67A
         SceDeci4pSDfMgrForKernel_FCF211FB: 0xFCF211FB