L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
mem_alloc.h
Go to the documentation of this file.
1
5/*
6 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>
7 * economic rights: Technische Universität Dresden (Germany)
8 *
9 * This file is part of TUD:OS and distributed under the terms of the
10 * GNU General Public License 2.
11 * Please see the COPYING-GPL-2 file for details.
12 *
13 * As a special exception, you may use this file as part of a free software
14 * library without restriction. Specifically, if other files instantiate
15 * templates or use macros or inline functions from this file, or you compile
16 * this file and link it with other files to produce an executable, this
17 * file does not by itself cause the resulting executable to be covered by
18 * the GNU General Public License. This exception does not however
19 * invalidate any other reasons why the executable file might be covered by
20 * the GNU General Public License.
21 */
22#pragma once
23
24#include <l4/re/env.h>
25#include <l4/sys/consts.h>
26
27#include <l4/re/c/dataspace.h>
28
36
43 L4RE_MA_CONTINUOUS = 0x01,
44 L4RE_MA_PINNED = 0x02,
45 L4RE_MA_SUPER_PAGES = 0x04,
46};
47
48
80l4re_ma_alloc(long size, l4re_ds_t const mem,
81 unsigned long flags) L4_NOTHROW;
82
116L4_CV L4_INLINE long
117l4re_ma_alloc_align(long size, l4re_ds_t const mem,
118 unsigned long flags, unsigned long align) L4_NOTHROW;
119
138L4_CV long
140 l4re_ds_t const mem, unsigned long flags,
141 unsigned long align) L4_NOTHROW;
142
143/***************** Implementation *****************/
144
145L4_CV L4_INLINE long
146l4re_ma_alloc(long size, l4re_ds_t const mem,
147 unsigned long flags) L4_NOTHROW
148{
149 return l4re_ma_alloc_align_srv(l4re_global_env->mem_alloc, size, mem,
150 flags, 0);
151}
152
153L4_CV L4_INLINE long
154l4re_ma_alloc_align(long size, l4re_ds_t const mem,
155 unsigned long flags, unsigned long align) L4_NOTHROW
156{
157 return l4re_ma_alloc_align_srv(l4re_global_env->mem_alloc, size, mem,
158 flags, align);
159}
160
Data space C interface.
Environment interface.
l4_cap_idx_t l4re_ds_t
Dataspace type.
Definition dataspace.h:39
l4re_ma_flags
Flags for requesting memory at the memory allocator.
Definition mem_alloc.h:42
long l4re_ma_alloc(long size, l4re_ds_t const mem, unsigned long flags) L4_NOTHROW
Allocate memory.
Definition mem_alloc.h:146
long l4re_ma_alloc_align(long size, l4re_ds_t const mem, unsigned long flags, unsigned long align) L4_NOTHROW
Allocate memory.
Definition mem_alloc.h:154
long l4re_ma_alloc_align_srv(l4_cap_idx_t srv, long size, l4re_ds_t const mem, unsigned long flags, unsigned long align) L4_NOTHROW
Allocate memory.
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:359
#define L4_CV
Define calling convention.
Definition linkage.h:44
#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
#define EXTERN_C_BEGIN
Start section with C types and functions.
Definition compiler.h:192
#define EXTERN_C_END
End section with C types and functions.
Definition compiler.h:193
l4_cap_idx_t mem_alloc
Memory allocator object-capability.
Definition env.h:113