L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
ipc.h
Go to the documentation of this file.
1
6/*
7 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
8 * Alexander Warg <warg@os.inf.tu-dresden.de>,
9 * Lars Reuther <reuther@os.inf.tu-dresden.de>
10 * economic rights: Technische Universität Dresden (Germany)
11 *
12 * License: see LICENSE.spdx (in this directory or the directories above)
13 */
14#ifndef __L4_IPC_H__
15#define __L4_IPC_H__
16
17#include <l4/sys/types.h>
18#include <l4/sys/consts.h>
19
20#ifdef __PIC__
21# define L4S_PIC_SAVE "push %%ebx; "
22# define L4S_PIC_RESTORE "pop %%ebx; "
23# define L4S_PIC_CLOBBER
24# define L4S_PIC_SYSCALL , [func] "m" (__l4sys_invoke_indirect)
25extern void (*__l4sys_invoke_indirect)(void);
26# define IPC_SYSENTER "# indirect sys invoke \n\t" \
27 "call *%[func] \n\t"
28# define IPC_SYSENTER_ASM call __l4sys_invoke_direct@plt
29#else
34#define IPC_SYSENTER "call __l4sys_invoke_direct \n\t"
39#define IPC_SYSENTER_ASM call __l4sys_invoke_direct
44# define L4S_PIC_SAVE
49# define L4S_PIC_RESTORE
54# define L4S_PIC_CLOBBER ,"ebx"
55# define L4S_PIC_SYSCALL
56
57#endif
58
61 l4_umword_t flags,
62 l4_umword_t slabel,
63 l4_msgtag_t tag,
64 l4_umword_t *rlabel,
66{
67 l4_umword_t dummy, dummy1, dummy2;
68
69 (void)u;
70
71 __asm__ __volatile__
72 (L4S_PIC_SAVE "push %%ebp; " IPC_SYSENTER " pop %%ebp; " L4S_PIC_RESTORE
73 :
74 "=d" (dummy2),
75 "=S" (slabel),
76 "=c" (dummy1),
77 "=D" (dummy),
78 "=a" (tag.raw)
79 :
80 "S" (slabel),
81 "c" (timeout),
82 "a" (tag.raw),
83 "d" (dest | flags)
84 L4S_PIC_SYSCALL
85 :
86 "memory", "cc" L4S_PIC_CLOBBER
87 );
88
89 if (rlabel)
90 *rlabel = slabel;
91
92 return tag;
93}
94
95#endif /* !__L4_IPC_H__ */
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:352
l4_msgtag_t l4_ipc(l4_cap_idx_t dest, l4_utcb_t *utcb, l4_umword_t flags, l4_umword_t slabel, l4_msgtag_t tag, l4_umword_t *rlabel, l4_timeout_t timeout) L4_NOTHROW
Generic L4 object invocation.
Definition ipc.h:19
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:56
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:161
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
Common constants.
Common L4 ABI Data Types.
Message tag data structure.
Definition types.h:266
Timeout pair.
Definition __timeout.h:53