Lines Matching defs:queue
155 * Return offset of a specific queue entry (data) from the beginning of a
169 #define SIG_WRITE_FIELD(channel, queue, sig_hdr, FIELD) \
171 sig_queue_offset(&channel->chan_hdr, queue) + \
176 static int sig_read_header(struct visorchannel *channel, u32 queue,
184 sig_queue_offset(&channel->chan_hdr, queue),
188 static int sig_read_data(struct visorchannel *channel, u32 queue,
192 int signal_data_offset = sig_data_offset(&channel->chan_hdr, queue,
199 static int sig_write_data(struct visorchannel *channel, u32 queue,
203 int signal_data_offset = sig_data_offset(&channel->chan_hdr, queue,
210 static int signalremove_inner(struct visorchannel *channel, u32 queue,
216 error = sig_read_header(channel, queue, &sig_hdr);
223 error = sig_read_data(channel, queue, &sig_hdr, sig_hdr.tail, msg);
232 error = SIG_WRITE_FIELD(channel, queue, &sig_hdr, tail);
235 error = SIG_WRITE_FIELD(channel, queue, &sig_hdr, num_received);
243 * channel/queue
245 * @queue: the queue the message will be removed from
250 int visorchannel_signalremove(struct visorchannel *channel, u32 queue,
258 rc = signalremove_inner(channel, queue, msg);
261 rc = signalremove_inner(channel, queue, msg);
268 static bool queue_empty(struct visorchannel *channel, u32 queue)
272 if (sig_read_header(channel, queue, &sig_hdr))
278 * visorchannel_signalempty() - checks if the designated channel/queue contains
281 * @queue: the queue in the channel to query
284 * channel/queue are present
286 bool visorchannel_signalempty(struct visorchannel *channel, u32 queue)
292 return queue_empty(channel, queue);
294 rc = queue_empty(channel, queue);
300 static int signalinsert_inner(struct visorchannel *channel, u32 queue,
306 err = sig_read_header(channel, queue, &sig_hdr);
312 err = SIG_WRITE_FIELD(channel, queue, &sig_hdr, num_overflows);
317 err = sig_write_data(channel, queue, &sig_hdr, sig_hdr.head, msg);
326 err = SIG_WRITE_FIELD(channel, queue, &sig_hdr, head);
329 err = SIG_WRITE_FIELD(channel, queue, &sig_hdr, num_sent);
411 * channel/queue
413 * @queue: the queue the message will be added to
418 int visorchannel_signalinsert(struct visorchannel *channel, u32 queue,
426 rc = signalinsert_inner(channel, queue, msg);
429 rc = signalinsert_inner(channel, queue, msg);