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 * License: see LICENSE.spdx (in this directory or the directories above)
14 */
15#ifndef __L4_SYS__INCLUDE__CONSTS_H__
16#define __L4_SYS__INCLUDE__CONSTS_H__
17
18#include <l4/sys/arch/consts.h>
19#include <l4/sys/compiler.h>
20#include <l4/sys/l4int.h>
21
55#define L4_SYSF_NONE 0x00
56
68#define L4_SYSF_SEND 0x01
69
79#define L4_SYSF_RECV 0x02
80
90#define L4_SYSF_OPEN_WAIT 0x04
91
99#define L4_SYSF_REPLY 0x08
100
107#define L4_SYSF_CALL (L4_SYSF_SEND | L4_SYSF_RECV)
108
115#define L4_SYSF_WAIT (L4_SYSF_OPEN_WAIT | L4_SYSF_RECV)
116
123#define L4_SYSF_SEND_AND_WAIT (L4_SYSF_OPEN_WAIT | L4_SYSF_CALL)
124
131#define L4_SYSF_REPLY_AND_WAIT (L4_SYSF_WAIT | L4_SYSF_SEND | L4_SYSF_REPLY)
132
137#define L4_CAP_SHIFT 12UL
139#define L4_CAP_SIZE (1UL << L4_CAP_SHIFT)
144#define L4_CAP_OFFSET (1UL << L4_CAP_SHIFT)
150#define L4_CAP_MASK (~0UL << (L4_CAP_SHIFT - 2))
152#define L4_INVALID_CAP (~0UL << (L4_CAP_SHIFT - 1))
153
154#define L4_INVALID_CAP_BIT (1UL << (L4_CAP_SHIFT - 1))
155
172#define L4_REPLY_CAP_BIT (1UL << (L4_CAP_SHIFT - 2))
173
175#define L4_INVALID_REPLY_CAP (~0UL << (L4_CAP_SHIFT - 2))
176
177enum l4_sched_consts_t
178{
179 L4_SCHED_MIN_PRIO = 1,
180 L4_SCHED_MAX_PRIO = 255,
181};
182
202 L4_FP_ALL_SPACES = 0x80000000UL,
203
216 L4_FP_DELETE_OBJ = 0xc0000000UL,
217
225};
226
317
323{
327 L4_BDR_OFFSET_MASK = (1UL << 20) - 1,
328};
329
399
410#define L4_PAGESIZE (1UL << L4_PAGESHIFT)
411
419#define L4_PAGEMASK (~(L4_PAGESIZE - 1))
420
428#define L4_LOG2_PAGESIZE L4_PAGESHIFT
429
437#define L4_SUPERPAGESIZE (1UL << L4_SUPERPAGESHIFT)
438
446#define L4_SUPERPAGEMASK (~(L4_SUPERPAGESIZE - 1))
447
454#define L4_LOG2_SUPERPAGESIZE L4_SUPERPAGESHIFT
455
469
477L4_INLINE l4_addr_t l4_trunc_size(l4_addr_t address, unsigned char bits) L4_NOTHROW;
479{ return address & (~0UL << bits); }
480
494
502L4_INLINE l4_addr_t l4_round_size(l4_addr_t value, unsigned char bits) L4_NOTHROW;
504{ return (value + (1UL << bits) - 1) & (~0UL << bits); }
505
514L4_INLINE unsigned l4_bytes_to_mwords(unsigned size) L4_NOTHROW;
516{ return (size + sizeof(l4_umword_t) - 1) / sizeof(l4_umword_t); }
517
526
531#define L4_INVALID_PTR ((void *)L4_INVALID_ADDR)
532
533#ifndef NULL
534#ifndef __cplusplus
535# define NULL ((void *)0)
539#elif __cplusplus >= 201103L
540# define NULL nullptr
541#else
542# define NULL 0
543#endif
544#endif
545
546#endif /* ! __L4_SYS__INCLUDE__CONSTS_H__ */
L4 compiler related defines.
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
unsigned long l4_addr_t
Address type.
Definition l4int.h:34
l4_default_caps_t
Default capabilities setup for the initial tasks.
Definition consts.h:344
#define L4_CAP_SHIFT
Capability index shift.
Definition consts.h:137
@ L4_BASE_IOMMU_CAP
Capability selector for the IO-MMU cap.
Definition consts.h:377
@ L4_BASE_THREAD_CAP
Capability selector for the first thread.
Definition consts.h:350
@ L4_BASE_DEBUGGER_CAP
Capability selector for the debugger cap.
Definition consts.h:385
@ L4_BASE_PAGER_CAP
Capability selector for the pager gate.
Definition consts.h:358
@ L4_BASE_FACTORY_CAP
Capability selector for the factory.
Definition consts.h:348
@ L4_BASE_CAPS_LAST
Last capability index used for base capabilities.
Definition consts.h:397
@ L4_BASE_SCHEDULER_CAP
Capability selector for the scheduler cap.
Definition consts.h:370
@ L4_BASE_TASK_CAP
Capability selector for the current task.
Definition consts.h:346
@ L4_BASE_ARM_SMCCC_CAP
Capability selector for the ARM SMCCC cap.
Definition consts.h:392
@ L4_BASE_LOG_CAP
Capability selector for the log object.
Definition consts.h:366
@ L4_BASE_ICU_CAP
Capability selector for the base icu object.
Definition consts.h:368
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:515
l4_addr_consts_t
Address related constants.
Definition consts.h:522
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:467
l4_addr_t l4_trunc_size(l4_addr_t address, unsigned char bits) L4_NOTHROW
Round an address down to the next lower flexpage with size bits.
Definition consts.h:478
l4_addr_t l4_round_page(l4_addr_t address) L4_NOTHROW
Round address up to the next page.
Definition consts.h:492
#define L4_PAGESIZE
Minimal page size (in bytes).
Definition consts.h:410
#define L4_PAGEMASK
Mask for the page number.
Definition consts.h:419
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:503
@ L4_INVALID_ADDR
Invalid address.
Definition consts.h:524
l4_msg_item_consts_t
Constants for message items.
Definition consts.h:232
@ L4_MAP_ITEM_GRANT
Flag as grant instead of map operation.
Definition consts.h:264
@ L4_RCV_ITEM_FORWARD_MAPPINGS
This flag specifies if received capabilities shall be mapped to a particular task instead of the invo...
Definition consts.h:279
@ L4_ITEM_MAP
Identify a message item as map item.
Definition consts.h:233
@ L4_RCV_ITEM_LOCAL_ID
The receiver requests to receive a local ID instead of a mapping whenever possible.
Definition consts.h:315
@ L4_ITEM_CONT
Denote that the following item shall be put into the same receive item as this one.
Definition consts.h:239
@ L4_MAP_ITEM_MAP
Flag as usual map operation.
Definition consts.h:266
@ 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:294
l4_unmap_flags_t
Flags for the unmap operation.
Definition consts.h:189
@ L4_FP_DELETE_OBJ
Flag that indicates that an unmap operation on object capabilities shall try to delete the correspond...
Definition consts.h:216
@ L4_FP_ALL_SPACES
Flag to tell the unmap operation to revoke permissions from all child mappings including the mapping ...
Definition consts.h:202
@ L4_FP_OTHER_SPACES
Counterpart to L4_FP_ALL_SPACES; revoke permissions from child mappings only.
Definition consts.h:224
l4_buffer_desc_consts_t
Constants for buffer descriptors.
Definition consts.h:323
@ L4_BDR_IO_SHIFT
Bit offset for the IO-buffer index.
Definition consts.h:325
@ L4_BDR_MEM_SHIFT
Bit offset for the memory-buffer index.
Definition consts.h:324
@ L4_BDR_OBJ_SHIFT
Bit offset for the capability-buffer index.
Definition consts.h:326
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:167
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
Fixed sized integer types, generic version.