L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
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
149
155{
166 L4_CAP_MASK = ~0UL << (L4_CAP_SHIFT - 1),
169
170 L4_INVALID_CAP_BIT = 1UL << (L4_CAP_SHIFT - 1),
171};
172
173enum l4_sched_consts_t
174{
175 L4_SCHED_MIN_PRIO = 0,
176 L4_SCHED_MAX_PRIO = 255,
177};
178
185{
198 L4_FP_ALL_SPACES = 0x80000000UL,
199
209 L4_FP_DELETE_OBJ = 0xc0000000UL,
210
217 L4_FP_OTHER_SPACES = 0x0UL
219
287
293{
297 L4_BDR_OFFSET_MASK = (1UL << 20) - 1,
298};
299
369
380#define L4_PAGESIZE (1UL << L4_PAGESHIFT)
381
389#define L4_PAGEMASK (~(L4_PAGESIZE - 1))
390
398#define L4_LOG2_PAGESIZE L4_PAGESHIFT
399
407#define L4_SUPERPAGESIZE (1UL << L4_SUPERPAGESHIFT)
408
416#define L4_SUPERPAGEMASK (~(L4_SUPERPAGESIZE - 1))
417
424#define L4_LOG2_SUPERPAGESIZE L4_SUPERPAGESHIFT
425
439
447L4_INLINE l4_addr_t l4_trunc_size(l4_addr_t address, unsigned char bits) L4_NOTHROW;
449{ return address & (~0UL << bits); }
450
464
472L4_INLINE l4_addr_t l4_round_size(l4_addr_t value, unsigned char bits) L4_NOTHROW;
474{ return (value + (1UL << bits) - 1) & (~0UL << bits); }
475
484L4_INLINE unsigned l4_bytes_to_mwords(unsigned size) L4_NOTHROW;
486{ return (size + sizeof(l4_umword_t) - 1) / sizeof(l4_umword_t); }
487
496
501#define L4_INVALID_PTR ((void *)L4_INVALID_ADDR)
502
503#ifndef NULL
504#ifndef __cplusplus
505# define NULL ((void *)0)
509#else
510# define NULL 0
511#endif
512#endif
513
514#endif /* ! __L4_SYS__INCLUDE__CONSTS_H__ */
L4 compiler related defines.
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:51
unsigned long l4_addr_t
Address type.
Definition l4int.h:45
l4_default_caps_t
Default capabilities setup for the initial tasks.
Definition consts.h:314
l4_cap_consts_t
Constants related to capability selectors.
Definition consts.h:155
@ L4_BASE_IOMMU_CAP
Capability selector for the IO-MMU cap.
Definition consts.h:347
@ L4_BASE_THREAD_CAP
Capability selector for the first thread.
Definition consts.h:320
@ L4_BASE_DEBUGGER_CAP
Capability selector for the debugger cap.
Definition consts.h:355
@ L4_BASE_PAGER_CAP
Capability selector for the pager gate.
Definition consts.h:328
@ L4_BASE_FACTORY_CAP
Capability selector for the factory.
Definition consts.h:318
@ L4_BASE_CAPS_LAST
Last capability index used for base capabilities.
Definition consts.h:367
@ L4_BASE_SCHEDULER_CAP
Capability selector for the scheduler cap.
Definition consts.h:340
@ L4_BASE_TASK_CAP
Capability selector for the current task.
Definition consts.h:316
@ L4_BASE_ARM_SMCCC_CAP
Capability selector for the ARM SMCCC cap.
Definition consts.h:362
@ L4_BASE_LOG_CAP
Capability selector for the log object.
Definition consts.h:336
@ L4_BASE_ICU_CAP
Capability selector for the base icu object.
Definition consts.h:338
@ L4_CAP_SIZE
Definition consts.h:159
@ L4_CAP_OFFSET
Offset of two consecutive capability selectors.
Definition consts.h:161
@ L4_CAP_MASK
Mask to get only the relevant bits of an l4_cap_idx_t.
Definition consts.h:166
@ L4_CAP_SHIFT
Capability index shift.
Definition consts.h:157
@ L4_INVALID_CAP
Invalid capability selector.
Definition consts.h:168
l4_syscall_flags_t
Capability selector flags.
Definition consts.h:62
@ L4_SYSF_SEND_AND_WAIT
Send-and-wait flags.
Definition consts.h:139
@ L4_SYSF_WAIT
Wait flags (combines receive and open wait).
Definition consts.h:131
@ L4_SYSF_REPLY
Reply flag.
Definition consts.h:115
@ L4_SYSF_CALL
Call flags (combines send and receive).
Definition consts.h:123
@ L4_SYSF_SEND
Send-phase flag.
Definition consts.h:84
@ L4_SYSF_REPLY_AND_WAIT
Reply-and-wait flags.
Definition consts.h:147
@ L4_SYSF_RECV
Receive-phase flag.
Definition consts.h:95
@ L4_SYSF_OPEN_WAIT
Open-wait flag.
Definition consts.h:106
@ L4_SYSF_NONE
Empty set of flags.
Definition consts.h:71
unsigned l4_bytes_to_mwords(unsigned size) L4_NOTHROW
Determine how many machine words (l4_umword_t) are required to store a buffer of 'size' bytes.
Definition consts.h:485
l4_addr_consts_t
Address related constants.
Definition consts.h:492
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:437
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:448
l4_addr_t l4_round_page(l4_addr_t address) L4_NOTHROW
Round address up to the next page.
Definition consts.h:462
#define L4_PAGESIZE
Minimal page size (in bytes).
Definition consts.h:380
#define L4_PAGEMASK
Mask for the page number.
Definition consts.h:389
l4_addr_t l4_round_size(l4_addr_t value, unsigned char bits) L4_NOTHROW
Round value up to the next alignment with bits size.
Definition consts.h:473
@ L4_INVALID_ADDR
Invalid address.
Definition consts.h:494
l4_msg_item_consts_t
Constants for message items.
Definition consts.h:225
@ L4_MAP_ITEM_GRANT
Flag as grant instead of map operation.
Definition consts.h:257
@ L4_ITEM_MAP
Identify a message item as map item.
Definition consts.h:226
@ L4_RCV_ITEM_LOCAL_ID
The receiver requests to receive a local ID instead of a mapping whenever possible.
Definition consts.h:285
@ L4_ITEM_CONT
Denote that the following item shall be put into the same receive item as this one.
Definition consts.h:232
@ L4_MAP_ITEM_MAP
Flag as usual map operation.
Definition consts.h:259
@ L4_RCV_ITEM_SINGLE_CAP
Mark the receive buffer to be a small receive item that describes a buffer for a single object capabi...
Definition consts.h:266
l4_unmap_flags_t
Flags for the unmap operation.
Definition consts.h:185
@ L4_FP_DELETE_OBJ
Flag that indicates that an unmap operation on object capabilities shall try to delete the correspond...
Definition consts.h:209
@ L4_FP_ALL_SPACES
Flag to tell the unmap operation to revoke permissions from all child mappings including the mapping ...
Definition consts.h:198
@ L4_FP_OTHER_SPACES
Counterpart to L4_FP_ALL_SPACES; revoke permissions from child mappings only.
Definition consts.h:217
l4_buffer_desc_consts_t
Constants for buffer descriptors.
Definition consts.h:293
@ L4_BDR_IO_SHIFT
Bit offset for the IO-buffer index.
Definition consts.h:295
@ L4_BDR_MEM_SHIFT
Bit offset for the memory-buffer index.
Definition consts.h:294
@ L4_BDR_OBJ_SHIFT
Bit offset for the capability-buffer index.
Definition consts.h:296
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:188
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:62