SceDeci4pSDfMgr: Difference between revisions

From Vita Development Wiki
Jump to navigation Jump to search
(Add sceSDfMgrExOpen and sceSDfMgrOpen)
(→‎sceSDfMgrExReqSendForKernel: Add description and prototype)
 
(32 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Module ==
== Module ==


This module exists only in non-secure world. The SELF can be found in <code>os0:kd/deci4p_sdfmgr.skprx</code>.
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version !! World !! Privilege
! Version !! World !! Privilege
|-
|-
| 3.60-3.65 || Non-secure || Kernel
| 0.990-3.65 || Non-secure || Kernel
|}
|}


Line 22: Line 23:


<source lang="C">
<source lang="C">
//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_PABT  (0)
#define SCE_SDFMGR_EXCP_TYPE_DABT  (1)
#define SCE_SDFMGR_EXCP_TYPE_DABT  (1)
Line 31: Line 43:
typedef SceInt32 SceSDfMgrSocketId;
typedef SceInt32 SceSDfMgrSocketId;


#define SCE_SDFMGR_EVENT_TYPE_1  (1) //recieved something
#define SCE_DFMGR_EVENT_READ      (1) // Protocol data available to read
#define SCE_SDFMGR_EVENT_TYPE_2 (2)
#define SCE_DFMGR_EVENT_READDONE (2) // Protocol data read
#define SCE_SDFMGR_EVENT_TYPE_3  (3) //something to send
#define SCE_DFMGR_EVENT_WRITE    (3) // Protocol data available to send
#define SCE_SDFMGR_EVENT_TYPE_4  (4)
#define SCE_DFMGR_EVENT_WRITEDONE (4) // Protocol data sent
#define SCE_SDFMGR_EVENT_TYPE_5 (5)
#define SCE_DFMGR_EVENT_CHSTATUS (5) // Protocol status change?
#define SCE_SDFMGR_EVENT_TYPE_6  (6)
#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 void (* SceSDfMgrEventHandler)(SceUInt32 event, void* eventData, void* pCommon); //<! pCommon is the data passed to Open/ExOpen


typedef struct _SceSDfMgrOpenParam {
typedef struct _SceSDfMgrOpenParam {
     SceSize size;         //<! Size of this structure (0x1C)
     SceSize size;       //<! Size of this structure (0x1C)
     SceUInt32 clientId;   //<! Unique number, used to identify called - must not be 0
     SceUInt32 clientId; //<! SDfMgr client ID (used as protocol ID for this service)
     SceUInt32 unk8;
     SceUInt32 uAliasId; //<! Protocol alias ID
     SceUInt32 unkC;
     SceUInt32 uVersion; //<! Protocol version
     SceUInt32 unk10;
     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;          //<! Name of the "caller" - 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);
</source>
</source>


== SceDeci4pSDfMgrForKernel ==
== SceDeci4pSDfMgrForKernel ==


=== SceDeci4pSDfMgrForKernel_A55F5F0D ===
=== sceSDfMgrOpenForKernel ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.990-3.60 || 0xA55F5F0D
|}
 
Acquires an interrupt-suspending lock and calls [[SceDeci4pSDfMgr#sceSDfMgrExOpenForKernel|sceSDfMgrExOpenForKernel]].
 
<source lang="C">SceSDfMgrSocketId sceSDfMgrOpenForKernel(SceSDfMgrEventHandler eventHandler, const SceSDfMgrOpenParam* openParam, void* pCommon);</source>
 
=== sceSDfMgrExOpenForKernel ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || 0xA55F5F0D
| 0.990-3.60 || 0xCF4A3E03
|}
|}
Potential name is <code>sceSDfMgrOpen</code>. Acquires an interrupt-suspending lock and calls [[SceDeci4pSDfMgr#sceSDfMgrExOpen|sceSDfMgrExOpen]].
<source lang="C">SceSDfMgrSocketId SceDeci4pSDfMgrForKernel_A55F5F0D(SceSDfMgrEventHandler eventHandler, const SceSDfMgrOpenParam* openParam, void* pCommon);</source>


=== sceSDfMgrExOpen ===
Opens a SDfMgr socket. <code>openParam</code> is not retained and can be disposed of after this call.
 
<source lang="C">SceSDfMgrSocketId sceSDfMgrExOpenForKernel(SceSDfMgrEventHandler eventHandler, const SceSDfMgrOpenParam* openParam, void* pCommon);</source>
 
=== sceSDfMgrExSendForKernel ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || 0xCF4A3E03
| 0.990-3.60 || 0xDAFE03AD
|}
|}
Open a SDfMgr socket. <code>openParam</code> is not retained and can be disposed of after this call.
<source lang="C">SceSDfMgrSocketId sceSDfMgrExOpen(SceSDfMgrEventHandler eventHandler, const SceSDfMgrOpenParam* openParam, void* pCommon);</source>


=== sceSDfMgrBreakSystem ===
Sends up to <code>bufLen</code> bytes from <code>buffer</code>, and returns number of bytes sent on success.
 
Note that <code>buffer</code> is not '''<code>const</code>''': this is not a typo. <code>buffer</code> may be written to under specific conditions.
 
<source lang="C">SceSSize sceSDfMgrExSendForKernel(SceSDfMgrSocketId sock, void* buffer, SceSize bufLen);</source>
 
=== sceSDfMgrExReqSendForKernel ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || 0xEDFBA012
| 0.990-3.60 || 0xB44083E1
|}
 
Create data sending request on socket. This causes a <code>SCE_DFMGR_EVENT_WRITE</code> event to be received by the socket's event handler.
 
To send data on a Deci4p socket, first call <code>sceSDfMgrExReqSendForKernel</code>, then call <code>sceSDfMgrExSendForKernel</code> in the <code>SCE_DFMGR_EVENT_WRITE</code> event handler.
 
<source lang="c">
int sceSDfMgrExReqSendForKernel(SceSDfMgrSocketId sock);
</source>
 
=== sceSDfMgrExRecvForKernel ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.990-3.60 || 0xF43F5941
|}
 
Receives up to <code>bufLen</code> bytes in <code>buffer</code>, and returns number of bytes received on success.
 
<source lang="C">SceSSize sceSDfMgrExRecvForKernel(SceSDfMgrSocketId sock, void* buffer, SceSize bufLen);</source>
 
=== sceSDfMgrCloseForKernel ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.990-3.60 || 0x86CFC8C6
|}
 
Acquires an interrupt-suspending lock and calls [[SceDeci4pSDfMgr#sceSDfMgrExCloseForKernel|sceSDfMgrExCloseForKernel]].
 
<source lang="C">SceInt32 sceSDfMgrCloseForKernel(SceSDfMgrSocketId sock);</source>
 
=== sceSDfMgrExCloseForKernel ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.990-3.60 || 0x90E8D453
|}
 
Close a SDfMgr socket.
 
<source lang="C">SceInt32 sceSDfMgrExCloseForKernel(SceSDfMgrSocketId sock);</source>
 
=== sceSDfMgrBreakSystemForKernel ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.990-3.60 || 0xEDFBA012
|}
 
Sets up some internal state and calls <code>[[SceKernelIntrMgr#sceKernelGenerateSoftIntrForDriver]](0, 1, 0)</code>.
 
<source lang="C">SceInt32 sceSDfMgrBreakSystemForKernel(void);</source>
 
=== sceSDfMgrContinueSystemForKernel ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.990-3.60 || 0x9A653F19
|}
 
Sets up some internal state and calls <code>sceKernelGenerateSoftIntrForDriver(0, 1, 0)</code>.
 
<source lang="C">SceInt32 sceSDfMgrContinueSystemForKernel(void);</source>
 
=== SceDeci4pSDfMgrForKernel_A963E333 ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.990-3.60 || 0xA963E333
|}
 
Calls <code>[[SceDeci4pSDfMgr#sceSDfMgrExReqSend|sceSDfMgrExReqSend]](sock)</code>, then may call an Host Interface function and/or call <code>sceKernelGenerateSoftIntrForDriver(1, 0, targetLUT[sceKernelCpuId()])</code> where <code>targetLUT = {1, 2, 4, 8}</code>.
 
<source lang="C">SceInt32 SceDeci4pSDfMgrForKernel_A963E333(SceSDfMgrSocketId sock);</source>
 
=== SceDeci4pSDfMgrForKernel_98AEC60E ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.990-3.60 || 0x98AEC60E
|}
|}
Calls <code>sceKernelGenerateSoftIntrForDriver(0, 1, 0)</code>.
<source lang="C">SceInt32 sceSDfMgrBreakSystem();</source>


=== SceDeci4pSDfMgrForKernel_FFC95B63 ===
=== SceDeci4pSDfMgrForKernel_FFC95B63 ===
Line 89: Line 210:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || 0xFFC95B63
| 0.990-3.60 || 0xFFC95B63
|}
|}
Equivalent to [[SceDeci4pDfMgr#SceDeci4pDfMgrForDebugger_6D26CC56|SceDeci4pDfMgrForDebugger_6D26CC56]].
Equivalent to [[SceDeci4pDfMgr#SceDeci4pDfMgrForDebugger_6D26CC56|SceDeci4pDfMgrForDebugger_6D26CC56]].
Writes <code>val</code> as a 3-byte unsigned integer to <code>ptr</code>.
Writes <code>val</code> as a 3-byte unsigned integer to <code>ptr</code>.
<source lang="C">void SceDeci4pSDfMgrForKernel_FFC95B63(void* ptr, SceUInt32 val);</source>
<source lang="C">void SceDeci4pSDfMgrForKernel_FFC95B63(void* ptr, SceUInt32 val);</source>


Line 100: Line 224:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || 0x68903C1D
| 0.990-3.60 || 0x68903C1D
|}
|}
Equivalent to [[SceDeci4pDfMgr#SceDeci4pDfMgrForDebugger_CACAB5F9|SceDeci4pDfMgrForDebugger_CACAB5F9]].
Equivalent to [[SceDeci4pDfMgr#SceDeci4pDfMgrForDebugger_CACAB5F9|SceDeci4pDfMgrForDebugger_CACAB5F9]].
Reads value at <code>ptr</code> as a 3-byte unsigned integer and returns it.
Reads value at <code>ptr</code> as a 3-byte unsigned integer and returns it.
<source lang="C">SceUInt32 SceDeci4pSDfMgrForKernel_68903C1D(void* ptr);</source>
<source lang="C">SceUInt32 SceDeci4pSDfMgrForKernel_68903C1D(void* ptr);</source>
=== SceDeci4pSDfMgrForKernel_81E7C5BD ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.990-3.60 || 0x81E7C5BD
|}
Special <code>memset</code> variant. <code>len</code> will be aligned '''down''' to meet 4-byte alignment requirement (i.e. bottom 2 bits of <code>len</code> are ignored).
<source lang="C">void* SceDeci4pSDfMgrForKernel_81E7C5BD(void* dst, int ch, size_t len);</source>


=== SceDeci4pSDfMgrForKernel_5996E2DB ===
=== SceDeci4pSDfMgrForKernel_5996E2DB ===
Line 111: Line 250:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || 0x5996E2DB
| 0.990-3.60 || 0x5996E2DB
|}
|}


Equivalent to <code>memcpy</code>.
Equivalent to <code>memcpy</code>.
<source lang="C">void* SceDeci4pSDfMgrForKernel_8A3B06F2(void* dst, void* src, size_t len);</source>
<source lang="C">void* SceDeci4pSDfMgrForKernel_8A3B06F2(void* dst, void* src, size_t len);</source>


Line 122: Line 262:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || 0x8A3B06F2
| 0.990-3.60 || 0x8A3B06F2
|}
|}


Equivalent to <code>memset</code>.
Equivalent to <code>memset</code>.
<source lang="C">void* SceDeci4pSDfMgrForKernel_8A3B06F2(void* dst, int ch, size_t len);</source>
<source lang="C">void* SceDeci4pSDfMgrForKernel_8A3B06F2(void* dst, int ch, size_t len);</source>
=== SceDeci4pSDfMgrForKernel_CCD56670 ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.990 || 0xCCD56670
|-
| 3.60 || not present
|}
Equivalent to <code>memchr</code>.
<source lang="C">void* SceDeci4pSDfMgrForKernel_CCD56670(void* s, int ch, size_t len);</source>
=== SceDeci4pSDfMgrForKernel_501CE61D ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.990-3.60 || 0x501CE61D
|}
This is a <code>printf</code>-like function.
<source lang="C">size_t SceDeci4pSDfMgrForKernel_501CE61D(char* fmt, ...);</source>
=== SceDeci4pSDfMgrForKernel_0A6437B6 ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.990-3.60 || 0x0A6437B6
|}
A potential name for is function is <code>sceSDfMgrIsSystemInBreakForKernel</code>.
Returns respectively 1 or 0 depending on whether [[SceDeci4pSDfMgr#sceSDfMgrBreakSystem|sceSDfMgrBreakSystem]] or [[SceDeci4pSDfMgr#sceSDfMgrContinueSystem|sceSDfMgrContinueSystem]] was called last.
<source lang="C">SceBool SceDeci4pSDfMgrForKernel_0A6437B6(void);</source>


=== sceSDfMgrUnregisterExcpHandlerForKernel ===
=== sceSDfMgrUnregisterExcpHandlerForKernel ===
Line 133: Line 314:
! Version !! NID
! Version !! NID
|-
|-
| 0.990 || 0xB050A0D5
| 0.990-3.60 || 0xB050A0D5
|}
|}


Guessed name was <code>sceSDfMgrUnregisterCpuExcpCallbackForKernel</code>.
Temp name was <code>sceSDfMgrUnregisterCpuExcpCallbackForKernel</code>. This name is a deduction from [[SceDeci4pSDfMgr#sceSDfMgrRegisterExcpHandlerForKernel|sceSDfMgrRegisterExcpHandlerForKernel]].
This name is a deduction from [[SceDeci4pSDfMgr#sceSDfMgrRegisterExcpHandlerForKernel|sceSDfMgrRegisterExcpHandlerForKernel]].


Unregisters an exception handler previously registered using [[SceDeci4pSDfMgr#sceSDfMgrRegisterExcpHandlerForKernel|sceSDfMgrRegisterExcpHandlerForKernel]].
Unregisters an exception handler previously registered using [[SceDeci4pSDfMgr#sceSDfMgrRegisterExcpHandlerForKernel|sceSDfMgrRegisterExcpHandlerForKernel]]. Call it using the same arguments as provided to [[SceDeci4pSDfMgr#sceSDfMgrRegisterExcpHandlerForKernel|sceSDfMgrRegisterExcpHandlerForKernel]].


<source lang="C">
<source lang="C">SceInt32 sceSDfMgrUnregisterExcpHandlerForKernel(SceSDfMgrExceptionCallback func, SceUInt32 type);</source>
//Returns 0x80090001 if type >= 4, or func isn't the already registered callback
SceInt32 sceSDfMgrUnregisterExcpHandlerForKernel(SceSDfMgrExceptionCallback func, SceUInt32 type);
</source>


=== sceSDfMgrRegisterExcpHandlerForKernel ===
=== sceSDfMgrRegisterExcpHandlerForKernel ===
Line 154: Line 331:
|}
|}


Guessed name was <code>sceSDfMgrRegisterCpuExcpCallbackForKernel</code>.
Temp name was <code>sceSDfMgrRegisterCpuExcpCallbackForKernel</code>.


Used by [[SceDeci4pSDbgp]].
Used by [[SceDeci4pSDbgp]].


<source lang="C">
<source lang="C">SceInt32 sceSDfMgrRegisterExcpHandlerForKernel(SceSDfMgrExceptionCallback func, SceUInt32 type);</source>
//Returns 0x80090001 if type >= 4
 
//Returns 0x80090003 if a callback is already registered for this type
=== sceSDfMgrRegisterBreakHookForKernel ===
SceInt32 sceSDfMgrRegisterExcpHandlerForKernel(SceSDfMgrExceptionCallback func, SceUInt32 type);
{| class="wikitable"
</source>
|-
! Version !! NID
|-
| 0.990-3.60 || 0xB22B42FB
|}
 
Registers a function to be called when some exceptions or interrupts happen.
 
<source lang="C">SceInt32 sceSDfMgrRegisterBreakHookForKernel(SceSDfMgrBreakHook hook);</source>
 
=== sceSDfMgrUnregisterBreakHookForKernel ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.990-3.60 || 0xE53400AE
|}
 
This is a guessed name. This name is a deduction from [[SceDeci4pSDfMgr#sceSDfMgrRegisterBreakHookForKernel|sceSDfMgrRegisterBreakHookForKernel]].
 
Unregisters a break hook previously registered using [[SceDeci4pSDfMgr#sceSDfMgrRegisterBreakHookForKernel|sceSDfMgrRegisterBreakHookForKernel]]. Call it using the same argument as provided to [[SceDeci4pSDfMgr#sceSDfMgrRegisterBreakHookForKernel|sceSDfMgrRegisterBreakHookForKernel]].
 
<source lang="C">SceInt32 sceSDfMgrUnregisterBreakHookForKernel(SceSDfMgrBreakHook hook);</source>
 
=== sceSDfMgrPollForKernel ===
{| class="wikitable"
|-
! Version !! NID
|-
| 3.60 || 0x152D98DF
|}
 
=== sceSDfMgrGetMemoryTypeForKernel ===
{| class="wikitable"
|-
! 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.
 
<source lang="C">SceUInt32 sceSDfMgrGetMemoryTypeForKernel(void);</source>


          SceDeci4pSDfMgrForKernel_0A6437B6: 0x0A6437B6
           SceDeci4pSDfMgrForKernel_11340BD4: 0x11340BD4
           SceDeci4pSDfMgrForKernel_11340BD4: 0x11340BD4
          SceDeci4pSDfMgrForKernel_152D98DF: 0x152D98DF
          SceUInt32 SceDeci4pSDfMgrForKernel_35238B8A(void); // sceDeci4pSDfMgrGetMemoryTypeForKernel
           SceDeci4pSDfMgrForKernel_3A25594F: 0x3A25594F
           SceDeci4pSDfMgrForKernel_3A25594F: 0x3A25594F
           SceDeci4pSDfMgrForKernel_4D974C08: 0x4D974C08
           SceDeci4pSDfMgrForKernel_4D974C08: 0x4D974C08
           SceDeci4pSDfMgrForKernel_4EA65698: 0x4EA65698
           SceDeci4pSDfMgrForKernel_4EA65698: 0x4EA65698
          SceDeci4pSDfMgrForKernel_501CE61D: 0x501CE61D
           SceDeci4pSDfMgrForKernel_58D7597A: 0x58D7597A
           SceDeci4pSDfMgrForKernel_58D7597A: 0x58D7597A
           SceDeci4pSDfMgrForKernel_59C077B3: 0x59C077B3
           SceDeci4pSDfMgrForKernel_59C077B3: 0x59C077B3
           SceDeci4pSDfMgrForKernel_682D0EFB: 0x682D0EFB
           SceDeci4pSDfMgrForKernel_682D0EFB: 0x682D0EFB
          SceDeci4pSDfMgrForKernel_81E7C5BD: 0x81E7C5BD
          SceDeci4pSDfMgrForKernel_86CFC8C6: 0x86CFC8C6
          SceDeci4pSDfMgrForKernel_90E8D453: 0x90E8D453
          SceDeci4pSDfMgrForKernel_98AEC60E: 0x98AEC60E
          SceDeci4pSDfMgrForKernel_9A653F19: 0x9A653F19
          SceDeci4pSDfMgrForKernel_A963E333: 0xA963E333 // trigger some SGI
          SceDeci4pSDfMgrForKernel_B050A0D5: 0xB050A0D5
          SceDeci4pSDfMgrForKernel_B22B42FB: 0xB22B42FB
          SceDeci4pSDfMgrForKernel_B44083E1: 0xB44083E1
           SceDeci4pSDfMgrForKernel_BFB482D8: 0xBFB482D8
           SceDeci4pSDfMgrForKernel_BFB482D8: 0xBFB482D8
           SceDeci4pSDfMgrForKernel_C38EA67A: 0xC38EA67A
           SceDeci4pSDfMgrForKernel_C38EA67A: 0xC38EA67A
          SceDeci4pSDfMgrForKernel_DAFE03AD: 0xDAFE03AD // maybe write sdbgsdio
          SceDeci4pSDfMgrForKernel_E53400AE: 0xE53400AE
          SceDeci4pSDfMgrForKernel_F43F5941: 0xF43F5941 // maybe read sdbgsdio
           SceDeci4pSDfMgrForKernel_FCF211FB: 0xFCF211FB
           SceDeci4pSDfMgrForKernel_FCF211FB: 0xFCF211FB


[[Category:ARM]]
[[Category:Kernel]]
[[Category:Modules]]
[[Category:Modules]]
[[Category:Kernel]]
[[Category:Library]]

Latest revision as of 15:25, 8 September 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

Create data sending request on socket. This causes a SCE_DFMGR_EVENT_WRITE event to be received by the socket's event handler.

To send data on a Deci4p socket, first call sceSDfMgrExReqSendForKernel, then call sceSDfMgrExSendForKernel in the SCE_DFMGR_EVENT_WRITE event handler.

int sceSDfMgrExReqSendForKernel(SceSDfMgrSocketId sock);

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