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 * License: see LICENSE.spdx (in this directory or the directories above)
10 */
11#pragma once
12
13#include <l4/re/env.h>
14#include <l4/sys/compiler.h>
15#include <l4/sys/consts.h>
16
17#include <l4/re/c/dataspace.h>
18
24
26
33 L4RE_MA_CONTINUOUS = 0x01,
34 L4RE_MA_PINNED = 0x02,
35 L4RE_MA_SUPER_PAGES = 0x04,
36};
37
38
70l4re_ma_alloc(long size, l4re_ds_t const mem,
71 unsigned long flags) L4_NOTHROW;
72
106L4_CV L4_INLINE long
107l4re_ma_alloc_align(long size, l4re_ds_t const mem,
108 unsigned long flags, unsigned long align) L4_NOTHROW;
109
128L4_CV long
130 l4re_ds_t const mem, unsigned long flags,
131 unsigned long align) L4_NOTHROW;
132
133/***************** Implementation *****************/
134
135L4_CV L4_INLINE long
136l4re_ma_alloc(long size, l4re_ds_t const mem,
137 unsigned long flags) L4_NOTHROW
138{
139 return l4re_ma_alloc_align_srv(l4re_global_env->mem_alloc, size, mem,
140 flags, 0);
141}
142
143L4_CV L4_INLINE long
144l4re_ma_alloc_align(long size, l4re_ds_t const mem,
145 unsigned long flags, unsigned long align) L4_NOTHROW
146{
147 return l4re_ma_alloc_align_srv(l4re_global_env->mem_alloc, size, mem,
148 flags, align);
149}
150
L4 compiler related defines.
Data space C interface.
Environment interface.
L4_BEGIN_DECLS typedef l4_cap_idx_t l4re_ds_t
Dataspace type.
Definition dataspace.h:29
l4re_ma_flags
Flags for requesting memory at the memory allocator.
Definition mem_alloc.h:32
long l4re_ma_alloc(long size, l4re_ds_t const mem, unsigned long flags) L4_NOTHROW
Allocate memory.
Definition mem_alloc.h:136
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:144
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:336
#define L4_CV
Define calling convention.
Definition linkage.h:33
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:161
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
#define L4_BEGIN_DECLS
Start section with C types and functions.
Definition compiler.h:165
#define L4_END_DECLS
End section with C types and functions.
Definition compiler.h:166
Common constants.