IPC: Difference between revisions

Neobrain (talk | contribs)
Neobrain (talk | contribs)
Command -> Message (since replies use the same format)
Line 23: Line 23:
The majority of 3DS inter-process communication is implemented as services.
The majority of 3DS inter-process communication is implemented as services.


= Command Structure =
= Message Structure =


IPC commands are written to the [[Thread Local Storage]] at offset 0x80 and submitted using [[SVC|svcSendSyncRequest]]. If the kernel was able to dispatch the request, the server reply will be written to TLS+0x80. Often the second word of the response data is the error code (or 0 if success).
IPC commands are written to the [[Thread Local Storage]] at offset 0x80 and submitted using [[SVC|svcSendSyncRequest]]. If the kernel was able to dispatch the request, the server reply will be written to TLS+0x80. Often the second word of the response data is the error code (or 0 if success). IPC commands and IPC replies follow the same structure.


Every IPC command sent to IPC server processes starts with a u32 header code. Parameters, if any, are written following this header. There are "normal parameters", which are fixed-size words, and there are "translate parameters", which are of flexible size and each of which begins with a header. The entire command has the following structure:
Every IPC message starts with a u32 header code. Parameters, if any, are written following this header. There are "normal parameters", which are fixed-size words, and there are "translate parameters", which are of flexible size and each of which begins with a header. The entire command has the following structure:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 47: Line 47:
|}
|}


The IPC command header has the following structure:
The IPC message header has the following structure:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-