L4Re - L4 Runtime Environment
consts.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  * Björn Döbel <doebel@os.inf.tu-dresden.de>,
10  * Torsten Frenzel <frenzel@os.inf.tu-dresden.de>
11  * economic rights: Technische Universität Dresden (Germany)
12  *
13  * This file is part of TUD:OS and distributed under the terms of the
14  * GNU General Public License 2.
15  * Please see the COPYING-GPL-2 file for details.
16  *
17  * As a special exception, you may use this file as part of a free software
18  * library without restriction. Specifically, if other files instantiate
19  * templates or use macros or inline functions from this file, or you compile
20  * this file and link it with other files to produce an executable, this
21  * file does not by itself cause the resulting executable to be covered by
22  * the GNU General Public License. This exception does not however
23  * invalidate any other reasons why the executable file might be covered by
24  * the GNU General Public License.
25  */
26 #ifndef __L4_SYS__INCLUDE__CONSTS_H__
27 #define __L4_SYS__INCLUDE__CONSTS_H__
28 
29 #include <l4/sys/compiler.h>
30 #include <l4/sys/l4int.h>
31 
40 {
48  L4_SYSF_NONE = 0x00,
49 
58  L4_SYSF_SEND = 0x01,
59 
69  L4_SYSF_RECV = 0x02,
70 
81 
89  L4_SYSF_REPLY = 0x08,
90 
98 
106 
114 
122 };
123 
129 {
131  L4_CAP_SHIFT = 12UL,
134  L4_CAP_OFFSET = 1UL << L4_CAP_SHIFT,
139  L4_CAP_MASK = ~0UL << (L4_CAP_SHIFT - 1),
141  L4_INVALID_CAP = ~0UL << (L4_CAP_SHIFT - 1),
142 
143  L4_INVALID_CAP_BIT = 1UL << (L4_CAP_SHIFT - 1),
144 };
145 
146 enum l4_sched_consts_t
147 {
148  L4_SCHED_MIN_PRIO = 0,
149  L4_SCHED_MAX_PRIO = 255,
150 };
151 
158 {
165  L4_FP_ALL_SPACES = 0x80000000UL,
166 
173  L4_FP_DELETE_OBJ = 0xc0000000UL,
174 
181 };
182 
188 {
190 
196 
197  // send
200 
201  // receive
207 
213 };
214 
220 {
224  L4_BDR_OFFSET_MASK = (1UL << 20) - 1,
225 };
226 
241 {
260 
262  L4_BASE_CAPS_LAST_P1,
264  L4_BASE_CAPS_LAST = L4_BASE_CAPS_LAST_P1 - 1
265 };
266 
277 #define L4_PAGESIZE (1UL << L4_PAGESHIFT)
278 
286 #define L4_PAGEMASK (~(L4_PAGESIZE - 1))
287 
295 #define L4_LOG2_PAGESIZE L4_PAGESHIFT
296 
304 #define L4_SUPERPAGESIZE (1UL << L4_SUPERPAGESHIFT)
305 
313 #define L4_SUPERPAGEMASK (~(L4_SUPERPAGESIZE - 1))
314 
321 #define L4_LOG2_SUPERPAGESIZE L4_SUPERPAGESHIFT
322 
333 L4_INLINE l4_addr_t l4_trunc_page(l4_addr_t address) L4_NOTHROW;
334 L4_INLINE l4_addr_t l4_trunc_page(l4_addr_t address) L4_NOTHROW
335 { return address & L4_PAGEMASK; }
336 
344 L4_INLINE l4_addr_t l4_trunc_size(l4_addr_t address, unsigned char bits) L4_NOTHROW;
345 L4_INLINE l4_addr_t l4_trunc_size(l4_addr_t address, unsigned char bits) L4_NOTHROW
346 { return address & (~0UL << bits); }
347 
358 L4_INLINE l4_addr_t l4_round_page(l4_addr_t address) L4_NOTHROW;
359 L4_INLINE l4_addr_t l4_round_page(l4_addr_t address) L4_NOTHROW
360 { return (address + L4_PAGESIZE - 1) & L4_PAGEMASK; }
361 
369 L4_INLINE l4_addr_t l4_round_size(l4_umword_t value, unsigned char bits) L4_NOTHROW;
370 L4_INLINE l4_addr_t l4_round_size(l4_umword_t value, unsigned char bits) L4_NOTHROW
371 { return (value + (1UL << bits) - 1) & (~0UL << bits); }
372 
380 };
381 
386 #define L4_INVALID_PTR ((void *)L4_INVALID_ADDR)
387 
388 #ifndef NULL
389 #ifndef __cplusplus
390 # define NULL ((void *)0)
394 #else
395 # define NULL 0
396 #endif
397 #endif
398 
399 #endif /* ! __L4_SYS__INCLUDE__CONSTS_H__ */
Identify a message item as map item.
Definition: consts.h:189
l4_addr_consts_t
Address related constants.
Definition: consts.h:377
Capability selector for the base icu object.
Definition: consts.h:253
Flag that indicates that the unmap operation on a capability shall try to delete the corresponding ob...
Definition: consts.h:173
Offset of two consecutive capability selectors.
Definition: consts.h:133
Invalid capability selector.
Definition: consts.h:141
l4_addr_t l4_round_page(l4_addr_t address) L4_NOTHROW
Round address up to the next page.
Definition: consts.h:359
l4_addr_t l4_round_size(l4_umword_t value, unsigned char bits) L4_NOTHROW
Round value up to the next alignment with bits size.
Definition: consts.h:370
Capability selector for the current task.
Definition: consts.h:243
Default flags (call to a kernel object).
Definition: consts.h:48
Wait flags (combines receive and open wait).
Definition: consts.h:105
#define L4_PAGEMASK
Mask for the page number.
Definition: consts.h:286
l4_addr_t l4_trunc_page(l4_addr_t address) L4_NOTHROW
Round an address down to the next lower page boundary.
Definition: consts.h:334
Reply-and-wait flags.
Definition: consts.h:121
Bit offset for the capability-buffer index.
Definition: consts.h:223
l4_addr_t l4_trunc_size(l4_addr_t address, unsigned char bits) L4_NOTHROW
Round an address down to the next lower flex page with size bits.
Definition: consts.h:345
Reply flag.
Definition: consts.h:89
The receiver requests to receive a local ID instead of a mapping whenever possible.
Definition: consts.h:212
L4 compiler related defines.
l4_default_caps_t
Default capabilities setup for the initial tasks.
Definition: consts.h:240
#define L4_PAGESIZE
Minimal page size (in bytes).
Definition: consts.h:277
Call flags (combines send and receive).
Definition: consts.h:97
Flag to tell the unmap operation to unmap all child mappings including the mapping in the invoked tas...
Definition: consts.h:165
Capability selector for the log object.
Definition: consts.h:251
Bit offset for the IO-buffer index.
Definition: consts.h:222
l4_buffer_desc_consts_t
Constants for buffer descriptors.
Definition: consts.h:219
Capability selector for the debugger cap.
Definition: consts.h:259
Capability index shift.
Definition: consts.h:131
Receive-phase flag.
Definition: consts.h:69
unsigned long l4_umword_t
Unsigned machine word.
Definition: l4int.h:52
Capability selector for the pager gate.
Definition: consts.h:249
l4_syscall_flags_t
Capability selector flags.
Definition: consts.h:39
Counterpart to L4_FP_ALL_SPACES, unmap only child mappings.
Definition: consts.h:180
l4_msg_item_consts_t
Constants for message items.
Definition: consts.h:187
Invalid address.
Definition: consts.h:379
Mask to get only the relevant bits of an l4_cap_idx_t.
Definition: consts.h:139
l4_cap_consts_t
Constants related to capability selectors.
Definition: consts.h:128
Capability selector for the scheduler cap.
Definition: consts.h:255
Bit offset for the memory-buffer index.
Definition: consts.h:221
Capability selector for the factory.
Definition: consts.h:245
Send-and-wait flags.
Definition: consts.h:113
Flag as grant instead of map operation.
Definition: consts.h:198
Denote that the following item shall be put into the same receive item as this one.
Definition: consts.h:195
Open-wait flag.
Definition: consts.h:80
l4_unmap_flags_t
Flags for the unmap operation.
Definition: consts.h:157
Capability selector for the IO-MMU cap.
Definition: consts.h:257
Mark the receive buffer to be a small receive item that describes a buffer for a single capability...
Definition: consts.h:206
Capability selector for the first thread.
Definition: consts.h:247
unsigned long l4_addr_t
Address type.
Definition: l4int.h:45
Flag as usual map operation.
Definition: consts.h:199
Last capability index used for base capabilities.
Definition: consts.h:264
Send-phase flag.
Definition: consts.h:58
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition: compiler.h:185