3 * \brief L4 IPC System Calls, ARM
7 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
8 * Alexander Warg <warg@os.inf.tu-dresden.de>
9 * economic rights: Technische Universität Dresden (Germany)
11 * This file is part of TUD:OS and distributed under the terms of the
12 * GNU General Public License 2.
13 * Please see the COPYING-GPL-2 file for details.
15 * As a special exception, you may use this file as part of a free software
16 * library without restriction. Specifically, if other files instantiate
17 * templates or use macros or inline functions from this file, or you compile
18 * this file and link it with other files to produce an executable, this
19 * file does not by itself cause the resulting executable to be covered by
20 * the GNU General Public License. This exception does not however
21 * invalidate any other reasons why the executable file might be covered by
22 * the GNU General Public License.
26 #include_next <l4/sys/ipc.h>
30 #include <l4/sys/compiler.h>
31 #include <l4/sys/syscall_defs.h>
34 l4_ipc_call(l4_cap_idx_t dest, l4_utcb_t *utcb,
36 l4_timeout_t timeout) L4_NOTHROW
38 register l4_umword_t _dest __asm__("r2") = dest | L4_SYSF_CALL;
39 register l4_umword_t _timeout __asm__("r3") = timeout.raw;
40 register l4_umword_t _flags __asm__("r4") = 0;
41 register l4_msgtag_t _tag __asm__("r0") = tag;
44 ("@ l4_ipc_call(start) \n\t"
47 "@ l4_ipc_call(end) \n\t"
54 [sc] "i" (L4_SYSCALL_INVOKE),
59 : "cc", "memory", "lr");
60 tag.raw = _tag.raw; // because gcc doesn't return out of registers variables
65 l4_ipc_reply_and_wait(l4_utcb_t *utcb, l4_msgtag_t tag,
67 l4_timeout_t timeout) L4_NOTHROW
69 register l4_umword_t _dest __asm__("r2") = L4_INVALID_CAP | L4_SYSF_REPLY_AND_WAIT;
70 register l4_umword_t _timeout __asm__("r3") = timeout.raw;
71 register l4_msgtag_t _tag __asm__("r0") = tag;
72 register l4_umword_t _flags __asm__("r4") = 0;
76 ("@ l4_ipc_reply_and_wait(start) \n\t"
79 "@ l4_ipc_reply_and_wait(end) \n\t"
86 [sc] "i" (L4_SYSCALL_INVOKE),
92 "cc", "memory", "lr");
94 tag.raw = _tag.raw; // because gcc doesn't return out of registers variables
100 l4_ipc_send_and_wait(l4_cap_idx_t dest, l4_utcb_t *utcb,
103 l4_timeout_t timeout) L4_NOTHROW
105 register l4_umword_t _dest __asm__("r2") = dest | L4_SYSF_SEND_AND_WAIT;
106 register l4_umword_t _timeout __asm__("r3") = timeout.raw;
107 register l4_msgtag_t _tag __asm__("r0") = tag;
108 register l4_umword_t _flags __asm__("r4") = 0;
112 ("@ l4_ipc_reply_and_wait(start) \n\t"
115 "@ l4_ipc_reply_and_wait(end) \n\t"
122 [sc] "i" (L4_SYSCALL_INVOKE),
128 "cc", "memory", "lr");
130 tag.raw = _tag.raw; // because gcc doesn't return out of registers variables
134 L4_INLINE l4_msgtag_t
135 l4_ipc_send(l4_cap_idx_t dest, l4_utcb_t *utcb,
137 l4_timeout_t timeout) L4_NOTHROW
139 register l4_umword_t _dest __asm__("r2") = dest | L4_SYSF_SEND;
140 register l4_umword_t _timeout __asm__("r3") = timeout.raw;
141 register l4_umword_t _flags __asm__("r4") = 0;
142 register l4_msgtag_t _tag __asm__("r0") = tag;
146 ("@ l4_ipc_send(start) \n\t"
149 "@ l4_ipc_send(end) \n\t"
156 [sc] "i" (L4_SYSCALL_INVOKE),
162 "cc", "memory", "lr");
163 tag.raw = _tag.raw; // because gcc doesn't return out of registers variables
167 L4_INLINE l4_msgtag_t
168 l4_ipc_wait(l4_utcb_t *utcb, l4_umword_t *src,
169 l4_timeout_t timeout) L4_NOTHROW
172 register l4_umword_t _r __asm__("r2") = L4_INVALID_CAP | L4_SYSF_WAIT;
173 register l4_umword_t _timeout __asm__("r3") = timeout.raw;
174 register l4_msgtag_t _tag __asm__("r0");
175 register l4_umword_t _flags __asm__("r4") = 0;
180 ("@ l4_ipc_wait(start) \n\t"
183 "@ l4_ipc_wait(end) \n\t"
190 [sc] "i"(L4_SYSCALL_INVOKE),
197 "cc", "memory", "lr");
199 rtag.raw = _tag.raw; // because gcc doesn't return out of registers variables
203 L4_INLINE l4_msgtag_t
204 l4_ipc_receive(l4_cap_idx_t src, l4_utcb_t *utcb,
205 l4_timeout_t timeout) L4_NOTHROW
208 register l4_umword_t _r __asm__("r2") = src | L4_SYSF_RECV;
209 register l4_umword_t _timeout __asm__("r3") = timeout.raw;
210 register l4_msgtag_t _tag __asm__("r0");
211 register l4_umword_t _flags __asm__("r4") = 0;
217 ("@ l4_ipc_receive(start) \n\t"
220 "@ l4_ipc_receive(end) \n\t"
227 [sc] "i"(L4_SYSCALL_INVOKE),
233 "cc", "memory", "lr");
234 rtag.raw = _tag.raw; // because gcc doesn't return out of registers variables
238 // todo: let all calls above use this single call
239 L4_INLINE l4_msgtag_t
240 l4_ipc(l4_cap_idx_t dest, l4_utcb_t *utcb,
245 l4_timeout_t timeout) L4_NOTHROW
247 register l4_umword_t _dest __asm__("r2") = dest | flags;
248 register l4_umword_t _timeout __asm__("r3") = timeout.raw;
249 register l4_msgtag_t _tag __asm__("r0") = tag;
250 register l4_umword_t _lab __asm__("r4") = slabel;
254 ("@ l4_ipc_reply_and_wait(start) \n\t"
257 "@ l4_ipc_reply_and_wait(end) \n\t"
264 [sc] "i" (L4_SYSCALL_INVOKE),
270 "cc", "memory", "lr");
272 tag.raw = _tag.raw; // because gcc doesn't return out of registers variables
277 #include <l4/sys/ipc-impl.h>