Lines Matching refs:msgq

25 static struct msgqueue_entry *mqe_alloc(MsgQueue_t *msgq)  in mqe_alloc()  argument
29 if ((mq = msgq->free) != NULL) in mqe_alloc()
30 msgq->free = mq->next; in mqe_alloc()
41 static void mqe_free(MsgQueue_t *msgq, struct msgqueue_entry *mq) in mqe_free() argument
44 mq->next = msgq->free; in mqe_free()
45 msgq->free = mq; in mqe_free()
54 void msgqueue_initialise(MsgQueue_t *msgq) in msgqueue_initialise() argument
58 msgq->qe = NULL; in msgqueue_initialise()
59 msgq->free = &msgq->entries[0]; in msgqueue_initialise()
62 msgq->entries[i].next = &msgq->entries[i + 1]; in msgqueue_initialise()
64 msgq->entries[NR_MESSAGES - 1].next = NULL; in msgqueue_initialise()
73 void msgqueue_free(MsgQueue_t *msgq) in msgqueue_free() argument
83 int msgqueue_msglength(MsgQueue_t *msgq) in msgqueue_msglength() argument
85 struct msgqueue_entry *mq = msgq->qe; in msgqueue_msglength()
88 for (mq = msgq->qe; mq; mq = mq->next) in msgqueue_msglength()
101 struct message *msgqueue_getmsg(MsgQueue_t *msgq, int msgno) in msgqueue_getmsg() argument
105 for (mq = msgq->qe; mq && msgno; mq = mq->next, msgno--); in msgqueue_getmsg()
118 int msgqueue_addmsg(MsgQueue_t *msgq, int length, ...) in msgqueue_addmsg() argument
120 struct msgqueue_entry *mq = mqe_alloc(msgq); in msgqueue_addmsg()
136 mqp = &msgq->qe; in msgqueue_addmsg()
151 void msgqueue_flush(MsgQueue_t *msgq) in msgqueue_flush() argument
155 for (mq = msgq->qe; mq; mq = mqnext) { in msgqueue_flush()
157 mqe_free(msgq, mq); in msgqueue_flush()
159 msgq->qe = NULL; in msgqueue_flush()