25 #include <nucleus/pipe.h>
26 #include <nucleus/heap.h>
30 #define P_NORMAL XNPIPE_NORMAL
31 #define P_URGENT XNPIPE_URGENT
33 #define P_MINOR_AUTO XNPIPE_MINOR_AUTO
35 #define P_EVENT_INPUT 1
36 #define P_EVENT_OUTPUT 2
37 #define P_EVENT_CLOSE 3
38 #define P_EVENT_NOBUF 4
40 typedef struct rt_pipe_placeholder {
42 } RT_PIPE_PLACEHOLDER;
48 #define XENO_PIPE_MAGIC 0x55550202
53 typedef xnpipe_mh_t RT_PIPE_MSG;
55 #define P_MSGPTR(msg) xnpipe_m_data(msg)
56 #define P_MSGSIZE(msg) xnpipe_m_size(msg)
58 typedef struct rt_pipe {
64 #define link2rtpipe(ln) container_of(ln, RT_PIPE, link)
72 int (*monitor)(
struct rt_pipe *pipe,
int event,
long arg);
82 char name[XNOBJECT_NAME_LEN];
84 #ifdef CONFIG_XENO_OPT_PERVASIVE
90 #define rlink2pipe(ln) container_of(ln, RT_PIPE, rlink)
98 typedef RT_PIPE_PLACEHOLDER RT_PIPE;
150 int (*fn)(RT_PIPE *pipe,
int event,
long arg));
154 int rt_pipe_bind(RT_PIPE *pipe,
158 static inline int rt_pipe_unbind(RT_PIPE *pipe)
160 pipe->opaque = XN_NO_HANDLE;
166 #ifdef CONFIG_XENO_OPT_NATIVE_PIPE
168 int __native_pipe_pkg_init(
void);
170 void __native_pipe_pkg_cleanup(
void);
172 static inline void __native_pipe_flush_rq(xnqueue_t *rq)
174 xeno_flush_rq_norelease(RT_PIPE, rq, pipe);
179 #define __native_pipe_pkg_init() ({ 0; })
180 #define __native_pipe_pkg_cleanup() do { } while(0)
181 #define __native_pipe_flush_rq(rq) do { } while(0)
int rt_pipe_flush(RT_PIPE *pipe, int mode)
Flush the i/o queues associated with the kernel endpoint of a message pipe.
Definition: pipe.c:1083
int rt_pipe_monitor(RT_PIPE *pipe, int(*fn)(RT_PIPE *pipe, int event, long arg))
Monitor a message pipe asynchronously.
Definition: pipe.c:1165
int rt_pipe_delete(RT_PIPE *pipe)
Delete a message pipe.
Definition: pipe.c:37
This file is part of the Xenomai project.
ssize_t rt_pipe_stream(RT_PIPE *pipe, const void *buf, size_t size)
Stream bytes to a pipe.
Definition: pipe.c:54
int rt_pipe_free(RT_PIPE *pipe, RT_PIPE_MSG *msg)
Free a message pipe buffer.
Definition: pipe.c:1032
RT_PIPE_MSG * rt_pipe_alloc(RT_PIPE *pipe, size_t size)
Allocate a message pipe buffer.
Definition: pipe.c:992
int rt_pipe_create(RT_PIPE *pipe, const char *name, int minor, size_t poolsize)
Create a message pipe.
Definition: pipe.c:24
ssize_t rt_pipe_send(RT_PIPE *pipe, RT_PIPE_MSG *msg, size_t size, int mode)
Send a message through a pipe.
Definition: pipe.c:734
ssize_t rt_pipe_write(RT_PIPE *pipe, const void *buf, size_t size, int mode)
Write a message to a pipe.
Definition: pipe.c:48
ssize_t rt_pipe_read(RT_PIPE *pipe, void *buf, size_t size, RTIME timeout)
Read a message from a pipe.
Definition: pipe.c:42
This file is part of the Xenomai project.
ssize_t rt_pipe_receive(RT_PIPE *pipe, RT_PIPE_MSG **msg, RTIME timeout)
Receive a message from a pipe.
Definition: pipe.c:520