blob: f0d82f4677879bbd37255341785df97b5f3f623d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
typedef struct MSGQueue {
uint16_t idx_r;
uint16_t idx_w;
uint16_t size;
unsigned char **array;
spinlock_t lock;
wait_queue_head_t wq;
} MSGQueue;
int msgq_create(MSGQueue *msgq, uint16_t size);
void msgq_destroy(MSGQueue *msgq);
uint16_t msgq_len(MSGQueue *msgq);
uint16_t msgq_size(MSGQueue *msgq);
int msgq_push(MSGQueue *msgq, unsigned char *buffer);
unsigned char *msgq_pop(MSGQueue *msgq);
|