IPC: Difference between revisions

Neobrain (talk | contribs)
mNo edit summary
Neobrain (talk | contribs)
No edit summary
Line 1: Line 1:
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).


Every IPC command sent to services starts with a u32 header code, and parameters, if any, are written after this header. They are decomposed into the following parts:
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:
{| class="wikitable" border="1"
|-
!  Word
!  Size
!  Description
|-
| 0
| 1
| Header code
|-
| 1
| x
| Normal parameters
|-
| x
| y
| Translate parameters
|}
 
The IPC command header has the following structure:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 8: Line 28:
|-
|-
| 0-5
| 0-5
| Number of translate parameters (=y)
| Total size in words of the translate parameters (=y). Note that this is in general different from the number of translate parameters
|-
|-
| 6-11
| 6-11
Line 20: Line 40:
|}
|}


The entire command has the following structure:
Each translate parameter starts with a translation descriptor:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Word
Bits
!  Size
!  Description
!  Description
|-
|-
| 0
| 1-3
| 1
| type
| Header code
|-
| 1
| x
| Normal parameters
|-
| x
| y
| Translate parameters
|}
|}