25 #include <nucleus/synch.h>
26 #include <nucleus/heap.h>
30 #define Q_PRIO XNSYNCH_PRIO
31 #define Q_FIFO XNSYNCH_FIFO
33 #define Q_SHARED 0x200
40 #define Q_BROADCAST 0x2
42 typedef struct rt_queue_info {
56 char name[XNOBJECT_NAME_LEN];
60 typedef struct rt_queue_placeholder {
66 } RT_QUEUE_PLACEHOLDER;
68 #if defined(__KERNEL__) || defined(__XENO_SIM__)
72 #define XENO_QUEUE_MAGIC 0x55550707
74 typedef struct rt_queue {
90 char name[XNOBJECT_NAME_LEN];
92 #ifdef CONFIG_XENO_OPT_PERVASIVE
98 #define rlink2queue(ln) container_of(ln, RT_QUEUE, rlink)
104 typedef struct rt_queue_msg {
108 volatile unsigned refcount;
112 #define link2rtmsg(ln) container_of(ln, rt_queue_msg_t, link)
120 #ifdef CONFIG_XENO_OPT_NATIVE_QUEUE
122 int __native_queue_pkg_init(
void);
124 void __native_queue_pkg_cleanup(
void);
126 static inline void __native_queue_flush_rq(xnqueue_t *rq)
128 xeno_flush_rq_norelease(RT_QUEUE, rq, queue);
131 ssize_t rt_queue_receive_inner(RT_QUEUE *q,
void **bufp,
132 xntmode_t timeout_mode, RTIME timeout);
134 int rt_queue_delete_inner(RT_QUEUE *q,
135 void __user *mapaddr);
139 #define __native_queue_pkg_init() ({ 0; })
140 #define __native_queue_pkg_cleanup() do { } while(0)
141 #define __native_queue_flush_rq(rq) do { } while(0)
151 typedef RT_QUEUE_PLACEHOLDER RT_QUEUE;
220 RT_QUEUE_INFO *info);
int rt_queue_bind(RT_QUEUE *q, const char *name, RTIME timeout)
Bind to a shared message queue.
Definition: queue.c:71
int rt_queue_free(RT_QUEUE *q, void *buf)
Free a message queue buffer.
Definition: queue.c:120
int rt_queue_flush(RT_QUEUE *q)
Flush a message queue.
Definition: queue.c:219
int rt_queue_unbind(RT_QUEUE *q)
Unbind from a shared message queue.
Definition: queue.c:82
ssize_t rt_queue_read_until(RT_QUEUE *q, void *bufp, size_t size, RTIME timeout)
Read a message from a queue (with absolute timeout date).
Definition: queue.c:198
void * rt_queue_alloc(RT_QUEUE *q, size_t size)
Allocate a message queue buffer.
Definition: queue.c:111
ssize_t rt_queue_receive(RT_QUEUE *q, void **bufp, RTIME timeout)
Receive a message from a queue.
Definition: queue.c:153
int rt_queue_send(RT_QUEUE *q, void *buf, size_t size, int mode)
Send a message to a queue.
Definition: queue.c:125
This file is part of the Xenomai project.
int rt_queue_create(RT_QUEUE *q, const char *name, size_t poolsize, size_t qlimit, int mode)
Create a message queue.
Definition: queue.c:49
ssize_t rt_queue_receive_until(RT_QUEUE *q, void **bufp, RTIME timeout)
Receive a message from a queue (with absolute timeout date).
Definition: queue.c:168
ssize_t rt_queue_read(RT_QUEUE *q, void *bufp, size_t size, RTIME timeout)
Read a message from a queue.
Definition: queue.c:183
int rt_queue_inquire(RT_QUEUE *q, RT_QUEUE_INFO *info)
Inquire about a message queue.
Definition: queue.c:213
int rt_queue_delete(RT_QUEUE *q)
Delete a message queue.
Definition: queue.c:96
This file is part of the Xenomai project.
int rt_queue_write(RT_QUEUE *q, const void *buf, size_t size, int mode)
Write a message to a queue.
Definition: queue.c:139