IPC: Difference between revisions
mNo edit summary |
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 | 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 | ||
| | | 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: | ||
|} | |} | ||
Each translate parameter starts with a translation descriptor: | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! | ! Bits | ||
! Description | ! Description | ||
|- | |- | ||
| 1-3 | |||
| type | |||
| 1 | |||
| | |||
|} | |} | ||