L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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/consts.h>
15
16#include <l4/re/c/dataspace.h>
17
25
32 L4RE_MA_CONTINUOUS = 0x01,
33 L4RE_MA_PINNED = 0x02,
34 L4RE_MA_SUPER_PAGES = 0x04,
35};
36
37
69l4re_ma_alloc(long size, l4re_ds_t const mem,
70 unsigned long flags) L4_NOTHROW;
71
105L4_CV L4_INLINE long
106l4re_ma_alloc_align(long size, l4re_ds_t const mem,
107 unsigned long flags, unsigned long align) L4_NOTHROW;
108
127L4_CV long
129 l4re_ds_t const mem, unsigned long flags,
130 unsigned long align) L4_NOTHROW;
131
132/***************** Implementation *****************/
133
134L4_CV L4_INLINE long
135l4re_ma_alloc(long size, l4re_ds_t const mem,
136 unsigned long flags) L4_NOTHROW
137{
138 return l4re_ma_alloc_align_srv(l4re_global_env->mem_alloc, size, mem,
139 flags, 0);
140}
141
142L4_CV L4_INLINE long
143l4re_ma_alloc_align(long size, l4re_ds_t const mem,
144 unsigned long flags, unsigned long align) L4_NOTHROW
145{
146 return l4re_ma_alloc_align_srv(l4re_global_env->mem_alloc, size, mem,
147 flags, align);
148}
149
Data space C interface.
Environment interface.
l4_cap_idx_t l4re_ds_t
Dataspace type.
Definition dataspace.h:28
l4re_ma_flags
Flags for requesting memory at the memory allocator.
Definition mem_alloc.h:31
long l4re_ma_alloc(long size, l4re_ds_t const mem, unsigned long flags) L4_NOTHROW
Allocate memory.
Definition mem_alloc.h:135
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:143
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:335
#define __END_DECLS
End section with C types and functions.
Definition compiler.h:167
#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:159
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
#define __BEGIN_DECLS
Start section with C types and functions.
Definition compiler.h:164
l4_cap_idx_t mem_alloc
Memory allocator object-capability.
Definition env.h:102