2019-06-27 17:00:23 -05:00
|
|
|
#ifndef MAILBOXES_H
|
|
|
|
#define MAILBOXES_H
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
void* msg;
|
|
|
|
uint32_t from;
|
|
|
|
uint32_t to;
|
|
|
|
uint32_t size;
|
|
|
|
} Message;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint32_t rd;
|
|
|
|
uint32_t wr;
|
|
|
|
uint16_t size;
|
|
|
|
Message* msg_store;
|
2019-09-01 13:52:32 -05:00
|
|
|
char name[20];
|
2019-06-27 17:00:23 -05:00
|
|
|
} Mailbox;
|
|
|
|
|
2019-09-01 13:52:32 -05:00
|
|
|
uint32_t mailbox_new(uint16_t size,char* name);
|
2019-06-27 17:00:23 -05:00
|
|
|
void mailbox_send_msg(Message* msg);
|
2019-06-29 09:04:34 -05:00
|
|
|
void mailbox_get_msg(uint32_t box, Message* recv_msg, uint32_t buffer_sz);
|
2019-09-05 09:39:13 -05:00
|
|
|
uint32_t mailbox_find_by_name(char* name);
|
2019-06-29 09:04:34 -05:00
|
|
|
|
2019-06-27 17:00:23 -05:00
|
|
|
#endif
|