Inter Process Communication helpers.
More...
Go to the source code of this file.
Inter Process Communication helpers.
◆ IPC_BufferRights
IPC buffer access rights.
Enumerator |
---|
IPC_BUFFER_R | Readable.
|
IPC_BUFFER_W | Writable.
|
IPC_BUFFER_RW | Readable and Writable.
|
◆ IPC_Desc_Buffer()
Creates a header describing a buffer from the main memory.
- Parameters
-
size | Size of the buffer. Max 0x0FFFFFFF. |
rights | The rights of the buffer for the destination process. |
- Returns
- The created buffer header.
The next value is a pointer to the buffer.
◆ IPC_Desc_CurProcessId()
static u32 IPC_Desc_CurProcessId |
( |
void |
| ) |
|
|
inlinestatic |
Returns the code to ask the kernel to fill the handle with the current process ID.
- Returns
- The code to request the current process ID.
The next value is a placeholder that will be replaced by the current process ID by the kernel.
◆ IPC_Desc_MoveHandles()
static u32 IPC_Desc_MoveHandles |
( |
unsigned |
number | ) |
|
|
inlinestatic |
Creates the header to transfer handle ownership.
- Parameters
-
number | The number of handles following this header. Max 64. |
- Returns
- The created handle transfer header.
The #number next values are handles that will be duplicated and closed by the other process.
- Note
- Zero values will have no effect.
◆ IPC_Desc_PXIBuffer()
static u32 IPC_Desc_PXIBuffer |
( |
size_t |
size, |
|
|
unsigned |
buffer_id, |
|
|
bool |
is_read_only |
|
) |
| |
|
inlinestatic |
Creates a header describing a buffer to be sent over PXI.
- Parameters
-
size | Size of the buffer. Max 0x00FFFFFF. |
buffer_id | The Id of the buffer. Max 0xF. |
is_read_only | true if the buffer is read-only. If false, the buffer is considered to have read-write access. |
- Returns
- The created PXI buffer header.
The next value is a phys-address of a table located in the BASE memregion.
◆ IPC_Desc_SharedHandles()
static u32 IPC_Desc_SharedHandles |
( |
unsigned |
number | ) |
|
|
inlinestatic |
Creates a header to share handles.
- Parameters
-
number | The number of handles following this header. Max 64. |
- Returns
- The created shared handles header.
The #number next values are handles that will be shared between the two processes.
- Note
- Zero values will have no effect.
◆ IPC_Desc_StaticBuffer()
static u32 IPC_Desc_StaticBuffer |
( |
size_t |
size, |
|
|
unsigned |
buffer_id |
|
) |
| |
|
inlinestatic |
Creates a header describing a static buffer.
- Parameters
-
size | Size of the buffer. Max ?0x03FFFF?. |
buffer_id | The Id of the buffer. Max 0xF. |
- Returns
- The created static buffer header.
The next value is a pointer to the buffer. It will be copied to TLS offset 0x180 + static_buffer_id*8.
◆ IPC_MakeHeader()
static u32 IPC_MakeHeader |
( |
u16 |
command_id, |
|
|
unsigned |
normal_params, |
|
|
unsigned |
translate_params |
|
) |
| |
|
inlinestatic |
Creates a command header to be used for IPC.
- Parameters
-
command_id | ID of the command to create a header for. |
normal_params | Size of the normal parameters in words. Up to 63. |
translate_params | Size of the translate parameters in words. Up to 63. |
- Returns
- The created IPC header.
Normal parameters are sent directly to the process while the translate parameters might go through modifications and checks by the kernel. The translate parameters are described by headers generated with the IPC_Desc_* functions.
- Note
- While #normal_params is equivalent to the number of normal parameters, #translate_params includes the size occupied by the translate parameters headers.