3 #include <l4/sys/compiler.h> // __BEGIN_DECLS
4 #include <l4/sys/types.h> // l4_cap_idx_t
5 #include <l4/shmc/shmc.h> // l4shmc*()
6 #include <l4/ankh/session.h> // AnkhSessionDescriptor
7 #include <l4/shmc/ringbuf.h>
12 * Initialize Ankh client library.
14 * Call this before everything else.
16 L4_CV void l4ankh_init(void) L4_NOTHROW;
19 * Open SHM connection using shm name and buffer size
21 L4_CV int l4ankh_open(char *shm_name, int bufsize) L4_NOTHROW;
24 * Get the connection's info area.
26 L4_CV struct AnkhSessionDescriptor *l4ankh_get_info(void) L4_NOTHROW;
28 /*************************
30 *************************/
33 * Prepare to send data.
35 * Attaches to the underlying ringbuf's send signal.
36 * Call before sending any data.
38 L4_CV int l4ankh_prepare_send(l4_cap_idx_t owner) L4_NOTHROW;
41 * Send packet giving buffer and size.
44 * \param size buffer size
45 * \param block block if buffer full
47 L4_CV int l4ankh_send(char *data, unsigned size, char block) L4_NOTHROW;
50 /*************************
52 *************************/
55 * Prepare packet reception.
57 * Attaches to the underlying ringbuf's recv signal.
58 * Call before receiving any data.
60 L4_CV int l4ankh_prepare_recv(l4_cap_idx_t owner) L4_NOTHROW;
62 // XXX: interface - send() has a block parameter, recv() has
63 // two different versions -- FIX
65 * Receive data, block if buffer empty.
67 L4_CV int l4ankh_recv_blocking(char *buffer, unsigned *size) L4_NOTHROW;
70 * Receive data, return error if none available
72 L4_CV int l4ankh_recv_nonblocking(char *buffer, unsigned *size) L4_NOTHROW;
75 * Get access to the underlying send buffer.
77 * This can be used to access the underlying buffer and perform
78 * more sophisticated operations that are needed only by special
79 * clients (L4Linux, ...).
81 L4_CV l4shmc_ringbuf_t *l4ankh_get_sendbuf(void) L4_NOTHROW;
84 * Get access to the underlying recv buffer.
86 * This can be used to access the underlying buffer and perform
87 * more sophisticated operations that are needed only by special
88 * clients (L4Linux, ...).
90 L4_CV l4shmc_ringbuf_t *l4ankh_get_recvbuf(void) L4_NOTHROW;