libtransistor
A userland library for the Nintendo Switch
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros
ipc_helpers.h File Reference

Functions and macros to make using IPC a little easier. More...

#include <libtransistor/ipc.h>
#include <libtransistor/util.h>
#include <string.h>
Include dependency graph for ipc_helpers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ipc_buffer_from_reference(ptr, type)   ipc_make_buffer((ptr), sizeof(*(ptr)), type)
 
#define ipc_msg_raw_data_from_reference(msg, ptr)
 
#define ipc_buffer_from_value(val, type)   ipc_make_buffer(&(val), sizeof(val), type)
 
#define ipc_msg_raw_data_from_value(msg, val)
 
#define ipc_msg_set_buffers(msg, obj_arr, ptr_arr)
 
#define ipc_msg_copy_handle_from_value(msg, handle)
 
#define ipc_msg_copy_handle_from_reference(msg, handle)
 

Detailed Description

Functions and macros to make using IPC a little easier.

Macro Definition Documentation

#define ipc_msg_copy_handle_from_reference (   msg,
  handle 
)
Value:
(msg).num_copy_handles = 1; \
(msg).copy_handles = handle;
#define ipc_msg_copy_handle_from_value (   msg,
  handle 
)
Value:
(msg).num_copy_handles = 1; \
(msg).copy_handles = &(handle);
#define ipc_msg_raw_data_from_reference (   msg,
  ptr 
)
Value:
msg.raw_data_size = sizeof(*(ptr)); \
msg.raw_data = (uint32_t*) (ptr);
#define ipc_msg_raw_data_from_value (   msg,
  val 
)
Value:
msg.raw_data_size = sizeof(val); \
msg.raw_data = (uint32_t*) (&(val));
#define ipc_msg_set_buffers (   msg,
  obj_arr,
  ptr_arr 
)
Value:
ipc_buffer_t *(ptr_arr)[ARRAY_LENGTH(obj_arr)]; \
for(size_t i = 0; i < ARRAY_LENGTH(obj_arr); i++) { \
(ptr_arr)[i] = &(obj_arr)[i]; \
} \
(msg).num_buffers = ARRAY_LENGTH(obj_arr); \
(msg).buffers = (ptr_arr);
Buffer for transfer over IPC.
Definition: ipc.h:62