L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
memdesc.h
Go to the documentation of this file.
1
6/*
7 * (c) 2007-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
8 * Alexander Warg <warg@os.inf.tu-dresden.de>
9 * economic rights: Technische Universität Dresden (Germany)
10 *
11 * This file is part of TUD:OS and distributed under the terms of the
12 * GNU General Public License 2.
13 * Please see the COPYING-GPL-2 file for details.
14 *
15 * As a special exception, you may use this file as part of a free software
16 * library without restriction. Specifically, if other files instantiate
17 * templates or use macros or inline functions from this file, or you compile
18 * this file and link it with other files to produce an executable, this
19 * file does not by itself cause the resulting executable to be covered by
20 * the GNU General Public License. This exception does not however
21 * invalidate any other reasons why the executable file might be covered by
22 * the GNU General Public License.
23 */
24#ifndef __L4SYS__MEMDESC_H__
25#define __L4SYS__MEMDESC_H__
26
27#include <l4/sys/kip.h>
28
56
65
75
76
91
92
100
108unsigned
110
123void
125 l4_addr_t start,
126 l4_addr_t end,
127 unsigned type,
128 unsigned virt,
129 unsigned sub_type) L4_NOTHROW;
130
140
150
160
173
183
184/*************************************************************************
185 * Implementations
186 *************************************************************************/
187
191{
192 return (l4_kernel_info_mem_desc_t *)(((l4_addr_t)kip)
193 + (kip->mem_info >> (sizeof(l4_umword_t) * 4)));
194}
195
197unsigned
199{
200 return kip->mem_info & ((1UL << (sizeof(l4_umword_t)*4)) -1);
201}
202
204void
206 l4_addr_t start,
207 l4_addr_t end,
208 unsigned type,
209 unsigned virt,
210 unsigned sub_type) L4_NOTHROW
211{
212 md->l = (start & ~0x3ffUL) | (type & 0x0f) | ((sub_type << 4) & 0x0f0)
213 | (virt ? 0x200 : 0x0);
214 md->h = end;
215}
216
217
224
231
238
242{
243 return (md->l & 0xf0) >> 4;
244}
245
252
253#endif /* ! __L4SYS__MEMDESC_H__ */
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:51
unsigned long l4_addr_t
Address type.
Definition l4int.h:45
l4_umword_t l4_kernel_info_get_mem_desc_subtype(l4_kernel_info_mem_desc_t *md) L4_NOTHROW
Get sub-type of memory region.
Definition memdesc.h:241
l4_mem_archspecific_sub_type_common_t
Memory sub types for l4_mem_type_archspecific descriptors.
Definition memdesc.h:71
l4_kernel_info_mem_desc_t * l4_kernel_info_get_mem_descs(l4_kernel_info_t *kip) L4_NOTHROW
Get pointer to memory descriptors from KIP.
Definition memdesc.h:190
l4_mem_info_sub_type_t
Memory sub types for l4_mem_type_info descriptors.
Definition memdesc.h:62
l4_umword_t l4_kernel_info_get_mem_desc_is_virtual(l4_kernel_info_mem_desc_t *md) L4_NOTHROW
Get virtual flag of the memory descriptor.
Definition memdesc.h:248
void l4_kernel_info_set_mem_desc(l4_kernel_info_mem_desc_t *md, l4_addr_t start, l4_addr_t end, unsigned type, unsigned virt, unsigned sub_type) L4_NOTHROW
Populate a memory descriptor.
Definition memdesc.h:205
l4_umword_t l4_kernel_info_get_mem_desc_end(l4_kernel_info_mem_desc_t *md) L4_NOTHROW
Get end address of the region described by the memory descriptor.
Definition memdesc.h:227
unsigned l4_kernel_info_get_num_mem_descs(l4_kernel_info_t *kip) L4_NOTHROW
Get number of memory descriptors in KIP.
Definition memdesc.h:198
l4_mem_type_t
Type of a memory descriptor.
Definition memdesc.h:45
l4_umword_t l4_kernel_info_get_mem_desc_type(l4_kernel_info_mem_desc_t *md) L4_NOTHROW
Get type of the memory region.
Definition memdesc.h:234
l4_umword_t l4_kernel_info_get_mem_desc_start(l4_kernel_info_mem_desc_t *md) L4_NOTHROW
Get start address of the region described by the memory descriptor.
Definition memdesc.h:220
@ l4_mem_archspecific_acpi_tables
Firmware ACPI tables.
Definition memdesc.h:72
@ l4_mem_archspecific_acpi_nvs
Firmware reserved address space.
Definition memdesc.h:73
@ l4_mem_info_acpi_rsdp
Physical address of the ACPI root pointer.
Definition memdesc.h:63
@ l4_mem_type_archspecific
Architecture specific memory (e.g., ACPI memory)
Definition memdesc.h:54
@ l4_mem_type_conventional
Conventional memory.
Definition memdesc.h:47
@ l4_mem_type_info
Info from the boot loader.
Definition memdesc.h:52
@ l4_mem_type_undefined
Undefined, unused descriptor.
Definition memdesc.h:46
@ l4_mem_type_dedicated
Dedicated memory (some device memory)
Definition memdesc.h:49
@ l4_mem_type_reserved
Reserved memory for kernel etc.
Definition memdesc.h:48
@ l4_mem_type_bootloader
Memory owned by the boot loader.
Definition memdesc.h:53
@ l4_mem_type_shared
Shared memory (not implemented)
Definition memdesc.h:50
#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
Memory descriptor data structure.
Definition memdesc.h:85
L4 Kernel Interface Page.
Definition __kip-32bit.h:39
Kernel Info Page access functions.