1 |
|
/* syscall.h - Public interface to the L4 system calls for ia32. |
2 |
|
Copyright (C) 2003 Free Software Foundation, Inc. |
3 |
|
Written by Marcus Brinkmann <marcus@gnu.org>. |
4 |
|
|
5 |
|
This file is part of the GNU L4 library. |
6 |
|
|
7 |
|
The GNU L4 library is free software; you can redistribute it and/or |
8 |
|
modify it under the terms of the GNU Lesser General Public License |
9 |
|
as published by the Free Software Foundation; either version 2.1 of |
10 |
|
the License, or (at your option) any later version. |
11 |
|
|
12 |
|
The GNU L4 library is distributed in the hope that it will be |
13 |
|
useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
14 |
|
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
|
GNU Lesser General Public License for more details. |
16 |
|
|
17 |
|
You should have received a copy of the GNU Lesser General Public |
18 |
|
License along with the GNU L4 library; if not, write to the Free |
19 |
|
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
20 |
|
02111-1307, USA. */ |
21 |
|
|
22 |
#ifndef _L4_SYSCALL_H |
#ifndef _L4_SYSCALL_H |
23 |
# error "Never use <l4/bits/syscall.h> directly; include <l4/syscall.h> instead." |
# error "Never use <l4/bits/syscall.h> directly; include <l4/syscall.h> instead." |
24 |
#endif |
#endif |
25 |
|
|
26 |
#ifndef _L4_EXTERN_INLINE |
|
|
#define _L4_EXTERN_INLINE extern __inline |
|
|
#endif |
|
|
|
|
|
|
|
27 |
/* Return the pointer to the kernel interface page, the API version, |
/* Return the pointer to the kernel interface page, the API version, |
28 |
the API flags, and the kernel ID. */ |
the API flags, and the kernel ID. */ |
|
_L4_EXTERN_INLINE l4_kip_t |
|
|
l4_kernel_interface (l4_api_version_t *api_version, l4_api_flags_t *api_flags, |
|
|
l4_kernel_id_t *kernel_id) __attribute__ ((__pure__)); |
|
29 |
|
|
30 |
_L4_EXTERN_INLINE l4_kip_t |
static inline l4_kip_t |
31 |
|
__attribute__((__always_inline__, __const__)) |
32 |
l4_kernel_interface (l4_api_version_t *api_version, l4_api_flags_t *api_flags, |
l4_kernel_interface (l4_api_version_t *api_version, l4_api_flags_t *api_flags, |
33 |
l4_kernel_id_t *kernel_id) |
l4_kernel_id_t *kernel_id) |
34 |
{ |
{ |
46 |
} |
} |
47 |
|
|
48 |
|
|
49 |
_L4_EXTERN_INLINE void |
static inline void |
50 |
|
__attribute__((__always_inline__)) |
51 |
l4_exchange_registers (l4_thread_id_t *dest, l4_word_t *control, |
l4_exchange_registers (l4_thread_id_t *dest, l4_word_t *control, |
52 |
l4_word_t *sp, l4_word_t *ip, l4_word_t *flags, |
l4_word_t *sp, l4_word_t *ip, l4_word_t *flags, |
53 |
l4_word_t *user_defined_handle, l4_thread_id_t *pager) |
l4_word_t *user_defined_handle, l4_thread_id_t *pager) |
93 |
} |
} |
94 |
|
|
95 |
|
|
96 |
_L4_EXTERN_INLINE l4_word_t |
static inline l4_word_t |
97 |
|
__attribute__((__always_inline__)) |
98 |
l4_thread_control (l4_thread_id_t dest, l4_thread_id_t space, |
l4_thread_control (l4_thread_id_t dest, l4_thread_id_t space, |
99 |
l4_thread_id_t scheduler, l4_thread_id_t pager, |
l4_thread_id_t scheduler, l4_thread_id_t pager, |
100 |
void *utcb_loc) |
void *utcb_loc) |
115 |
} |
} |
116 |
|
|
117 |
|
|
118 |
_L4_EXTERN_INLINE l4_clock_t |
static inline l4_clock_t |
119 |
|
__attribute__((__always_inline__)) |
120 |
l4_system_clock (void) |
l4_system_clock (void) |
121 |
{ |
{ |
122 |
l4_clock_t time; |
l4_clock_t time; |
130 |
} |
} |
131 |
|
|
132 |
|
|
133 |
_L4_EXTERN_INLINE void |
static inline void |
134 |
|
__attribute__((__always_inline__)) |
135 |
l4_thread_switch (l4_thread_id_t dest) |
l4_thread_switch (l4_thread_id_t dest) |
136 |
{ |
{ |
137 |
__asm__ __volatile__ ("call *__l4_thread_switch" |
__asm__ __volatile__ ("call *__l4_thread_switch" |
140 |
} |
} |
141 |
|
|
142 |
|
|
143 |
_L4_EXTERN_INLINE l4_word_t |
static inline l4_word_t |
144 |
|
__attribute__((__always_inline__)) |
145 |
l4_schedule (l4_thread_id_t dest, l4_word_t time_control, |
l4_schedule (l4_thread_id_t dest, l4_word_t time_control, |
146 |
l4_word_t proc_control, l4_word_t prio, |
l4_word_t proc_control, l4_word_t prio, |
147 |
l4_word_t preempt_control, l4_word_t *old_time_control) |
l4_word_t preempt_control, l4_word_t *old_time_control) |
162 |
} |
} |
163 |
|
|
164 |
|
|
165 |
_L4_EXTERN_INLINE void |
static inline void |
166 |
|
__attribute__((__always_inline__)) |
167 |
l4_unmap (l4_word_t control) |
l4_unmap (l4_word_t control) |
168 |
{ |
{ |
169 |
l4_word_t mr0; |
l4_word_t mr0; |
182 |
} |
} |
183 |
|
|
184 |
|
|
185 |
_L4_EXTERN_INLINE l4_word_t |
static inline l4_word_t |
186 |
|
__attribute__((__always_inline__)) |
187 |
l4_space_control (l4_thread_id_t space, l4_word_t control, |
l4_space_control (l4_thread_id_t space, l4_word_t control, |
188 |
l4_fpage_t kip_area, l4_fpage_t utcb_area, |
l4_fpage_t kip_area, l4_fpage_t utcb_area, |
189 |
l4_thread_id_t redirector, l4_word_t *old_control) |
l4_thread_id_t redirector, l4_word_t *old_control) |
204 |
} |
} |
205 |
|
|
206 |
|
|
207 |
_L4_EXTERN_INLINE l4_msg_tag_t |
static inline l4_msg_tag_t |
208 |
|
__attribute__((__always_inline__)) |
209 |
l4_ipc (l4_thread_id_t to, l4_thread_id_t from_spec, |
l4_ipc (l4_thread_id_t to, l4_thread_id_t from_spec, |
210 |
l4_word_t timeouts, l4_thread_id_t *from) |
l4_word_t timeouts, l4_thread_id_t *from) |
211 |
{ |
{ |
239 |
} |
} |
240 |
|
|
241 |
|
|
242 |
_L4_EXTERN_INLINE l4_msg_tag_t |
static inline l4_msg_tag_t |
243 |
|
__attribute__((__always_inline__)) |
244 |
l4_lipc (l4_thread_id_t to, l4_thread_id_t from_spec, |
l4_lipc (l4_thread_id_t to, l4_thread_id_t from_spec, |
245 |
l4_word_t timeouts, l4_thread_id_t *from) |
l4_word_t timeouts, l4_thread_id_t *from) |
246 |
{ |
{ |
274 |
} |
} |
275 |
|
|
276 |
|
|
277 |
_L4_EXTERN_INLINE l4_word_t |
static inline l4_word_t |
278 |
|
__attribute__((__always_inline__)) |
279 |
l4_processor_control (l4_word_t proc, l4_word_t control, l4_word_t int_freq, |
l4_processor_control (l4_word_t proc, l4_word_t control, l4_word_t int_freq, |
280 |
l4_word_t ext_freq, l4_word_t voltage) |
l4_word_t ext_freq, l4_word_t voltage) |
281 |
{ |
{ |
294 |
} |
} |
295 |
|
|
296 |
|
|
297 |
_L4_EXTERN_INLINE void |
static inline void |
298 |
|
__attribute__((__always_inline__)) |
299 |
l4_memory_control (l4_word_t control, l4_word_t *attributes) |
l4_memory_control (l4_word_t control, l4_word_t *attributes) |
300 |
{ |
{ |
301 |
l4_word_t tag; |
l4_word_t tag; |