Lines Matching refs:mq
27 struct msgqueue_entry *mq; in mqe_alloc() local
29 if ((mq = msgq->free) != NULL) in mqe_alloc()
30 msgq->free = mq->next; in mqe_alloc()
32 return mq; in mqe_alloc()
41 static void mqe_free(MsgQueue_t *msgq, struct msgqueue_entry *mq) in mqe_free() argument
43 if (mq) { in mqe_free()
44 mq->next = msgq->free; in mqe_free()
45 msgq->free = mq; in mqe_free()
85 struct msgqueue_entry *mq = msgq->qe; in msgqueue_msglength() local
88 for (mq = msgq->qe; mq; mq = mq->next) in msgqueue_msglength()
89 length += mq->msg.length; in msgqueue_msglength()
103 struct msgqueue_entry *mq; in msgqueue_getmsg() local
105 for (mq = msgq->qe; mq && msgno; mq = mq->next, msgno--); in msgqueue_getmsg()
107 return mq ? &mq->msg : NULL; in msgqueue_getmsg()
120 struct msgqueue_entry *mq = mqe_alloc(msgq); in msgqueue_addmsg() local
123 if (mq) { in msgqueue_addmsg()
129 mq->msg.msg[i] = va_arg(ap, unsigned int); in msgqueue_addmsg()
132 mq->msg.length = length; in msgqueue_addmsg()
133 mq->msg.fifo = 0; in msgqueue_addmsg()
134 mq->next = NULL; in msgqueue_addmsg()
140 *mqp = mq; in msgqueue_addmsg()
143 return mq != NULL; in msgqueue_addmsg()
153 struct msgqueue_entry *mq, *mqnext; in msgqueue_flush() local
155 for (mq = msgq->qe; mq; mq = mqnext) { in msgqueue_flush()
156 mqnext = mq->next; in msgqueue_flush()
157 mqe_free(msgq, mq); in msgqueue_flush()