17 static inline ipc_buffer_t ipc_make_buffer(
void *addr,
size_t size, uint32_t type) {
25 static inline ipc_buffer_t ipc_buffer_from_string(
const char *
string, uint32_t type) {
27 buf.addr = (
void*)
string;
28 buf.
size = strlen(
string) + 1;
39 #define ipc_buffer_from_reference(ptr, type) ipc_make_buffer((ptr), sizeof(*(ptr)), type)
40 #define ipc_msg_raw_data_from_reference(msg, ptr) \
41 msg.raw_data_size = sizeof(*(ptr)); \
42 msg.raw_data = (uint32_t*) (ptr);
44 #define ipc_buffer_from_value(val, type) ipc_make_buffer(&(val), sizeof(val), type)
45 #define ipc_msg_raw_data_from_value(msg, val) \
46 msg.raw_data_size = sizeof(val); \
47 msg.raw_data = (uint32_t*) (&(val));
49 #define ipc_msg_set_buffers(msg, obj_arr, ptr_arr) \
50 ipc_buffer_t *(ptr_arr)[ARRAY_LENGTH(obj_arr)]; \
51 for(size_t i = 0; i < ARRAY_LENGTH(obj_arr); i++) { \
52 (ptr_arr)[i] = &(obj_arr)[i]; \
54 (msg).num_buffers = ARRAY_LENGTH(obj_arr); \
55 (msg).buffers = (ptr_arr);
57 #define ipc_msg_copy_handle_from_value(msg, handle) \
58 (msg).num_copy_handles = 1; \
59 (msg).copy_handles = &(handle);
61 #define ipc_msg_copy_handle_from_reference(msg, handle) \
62 (msg).num_copy_handles = 1; \
63 (msg).copy_handles = handle;
ipc_request_t ipc_default_request
An IPC request with default values set.
Various utililty functions.
Represents an unmarshalled outgoing IPC request.
Definition: ipc.h:74
Buffer for transfer over IPC.
Definition: ipc.h:62
Interprocess Communication data structures and functions.
uint64_t size
Size in bytes.
Definition: ipc.h:64