#ifndef _SYS_IPC_H #define _SYS_IPC_H #include #include /* Processes */ enum Process { NO_PROCESS, SYSTEM, ANY = 0xFFFFFFFF }; /* Message encodings */ typedef union MessageContent MessageContent; union MessageContent { /* Generics */ char raw[16]; void *ptr; uint32_t num; } __attribute__((__transparent_union__)); /* Structure for a message */ typedef struct Message Message; struct Message { pid_t from; uint16_t type; MessageContent msg; Message *next; } __attribute__((packed)); Message *nb_send_msg(pid_t to, uint16_t type, MessageContent *msg); Message *send_msg(pid_t to, uint16_t type, MessageContent *msg); pid_t nb_recv_msg(Message *buf, pid_t from); pid_t recv_msg(Message *buf, pid_t from); #endif