Loading...
Searching...
No Matches
mem_alloc.h
Go to the documentation of this file.
/*
* (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>
* economic rights: Technische Universität Dresden (Germany)
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/re/env.h>
#include <l4/sys/compiler.h>
#include <l4/sys/consts.h>
#include <l4/re/c/dataspace.h>
L4_BEGIN_DECLS
enum l4re_ma_flags {
L4RE_MA_CONTINUOUS = 0x01,
L4RE_MA_PINNED = 0x02,
L4RE_MA_SUPER_PAGES = 0x04,
};
L4_CV L4_INLINE long
l4re_ma_alloc(long size, l4re_ds_t const mem,
unsigned long flags) L4_NOTHROW;
L4_CV L4_INLINE long
l4re_ma_alloc_align(long size, l4re_ds_t const mem,
unsigned long flags, unsigned long align) L4_NOTHROW;
L4_CV 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;
/***************** Implementation *****************/
L4_CV L4_INLINE long
l4re_ma_alloc(long size, l4re_ds_t const mem,
unsigned long flags) L4_NOTHROW
{
return l4re_ma_alloc_align_srv(l4re_global_env->mem_alloc, size, mem,
flags, 0);
}
L4_CV L4_INLINE long
l4re_ma_alloc_align(long size, l4re_ds_t const mem,
unsigned long flags, unsigned long align) L4_NOTHROW
{
return l4re_ma_alloc_align_srv(l4re_global_env->mem_alloc, size, mem,
flags, align);
}
L4_END_DECLS
compiler.h
L4 compiler related defines.
dataspace.h
Data space C interface.
env.h
Environment interface.
l4re_ds_t
L4_BEGIN_DECLS typedef l4_cap_idx_t l4re_ds_t
Dataspace type.
Definition dataspace.h:29
l4re_ma_flags
l4re_ma_flags
Flags for requesting memory at the memory allocator.
Definition mem_alloc.h:32
l4re_ma_alloc
long l4re_ma_alloc(long size, l4re_ds_t const mem, unsigned long flags) L4_NOTHROW
Allocate memory.
Definition mem_alloc.h:136
l4re_ma_alloc_align
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
l4re_ma_alloc_align_srv
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.
l4_cap_idx_t
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:336
L4_CV
#define L4_CV
Define calling convention.
Definition linkage.h:33
L4_NOTHROW
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:161
L4_INLINE
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
L4_BEGIN_DECLS
#define L4_BEGIN_DECLS
Start section with C types and functions.
Definition compiler.h:165
L4_END_DECLS
#define L4_END_DECLS
End section with C types and functions.
Definition compiler.h:166
consts.h
Common constants.