20 #ifndef SRC_SVM_MESSAGE_QUEUE_H_ 21 #define SRC_SVM_MESSAGE_QUEUE_H_
svm_msg_q_ring_t * rings
rings with message data
svm_msg_q_msg_t svm_msg_q_alloc_msg(svm_msg_q_t *mq, u32 nbytes)
Allocate message buffer.
void * svm_msg_q_msg_data(svm_msg_q_t *mq, svm_msg_q_msg_t *msg)
Get data for message in queu.
struct svm_msg_q_ svm_msg_q_t
struct svm_msg_q_ring_ svm_msg_q_ring_t
svm_msg_q_t * svm_msg_q_alloc(svm_msg_q_cfg_t *cfg)
Allocate message queue.
struct svm_msg_q_cfg_ svm_msg_q_cfg_t
volatile u32 cursize
current size of the ring
int svm_msg_q_add(svm_msg_q_t *mq, svm_msg_q_msg_t msg, int nowait)
Producer enqueue one message to queue.
struct svm_msg_q_ring_cfg_ svm_msg_q_ring_cfg_t
u32 n_rings
number of msg rings
u32 head
current head (for dequeue)
svm_queue_t * q
queue for exchanging messages
int svm_msg_q_sub(svm_msg_q_t *mq, svm_msg_q_msg_t *msg, svm_q_conditional_wait_t cond, u32 time)
Consumer dequeue one message from queue.
u32 elt_index
index in ring
u32 ring_index
ring index, could be u8
u8 * data
chunk of memory for msg data
svm_msg_q_ring_cfg_t * ring_cfgs
array of ring cfgs
u32 q_nitems
msg queue size (not rings)
void svm_msg_q_free_msg(svm_msg_q_t *mq, svm_msg_q_msg_t *msg)
Free message buffer.
struct _svm_queue svm_queue_t
u32 elsize
size of an element
u32 tail
current tail (for enqueue)
int consumer_pid
pid of msg consumer
void svm_msg_q_free(svm_msg_q_t *mq)
Free message queue.
u32 nitems
max size of the ring