L4Re Operating System Framework
Interface and Usage Documentation
|
Memory allocator C interface. More...
Enumerations | |
enum | l4re_ma_flags |
Flags for requesting memory at the memory allocator. More... | |
Functions | |
long | l4re_ma_alloc (long size, l4re_ds_t const mem, unsigned long flags) L4_NOTHROW |
Allocate memory. | |
long | l4re_ma_alloc_align (long size, l4re_ds_t const mem, unsigned long flags, unsigned long align) L4_NOTHROW |
Allocate memory. | |
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. | |
Memory allocator C interface.
enum l4re_ma_flags |
Flags for requesting memory at the memory allocator.
Definition at line 42 of file mem_alloc.h.
|
inline |
Allocate memory.
size | Size in bytes to be requested. Allocation granularity is (super)pages, however, the allocator will store the byte-granular given size as the size of the dataspace and consecutively will use this byte-granular size for servicing the dataspace. Allocators may optionally also implement a maximum allocation strategy: if size is a negative value and flags set the Mem_alloc_flags::Continuous bit, the allocator tries to allocate as much memory as possible leaving an amount of at least -size bytes within the associated quota. |
mem | Capability slot where the capability to the dataspace is received. |
flags | Special dataspace properties, see l4re_ma_flags |
0 | Success |
-L4_ERANGE | Given size not supported. |
-L4_ENOMEM | Not enough memory available. |
<0 | IPC error |
The memory allocator returns a dataspace.
Definition at line 146 of file mem_alloc.h.
References l4re_ma_alloc_align_srv(), and l4re_env_t::mem_alloc.
|
inline |
Allocate memory.
size | Size in bytes to be requested. Allocation granularity is (super)pages, however, the allocator will store the byte-granular given size as the size of the dataspace and consecutively will use this byte-granular size for servicing the dataspace. Allocators may optionally also implement a maximum allocation strategy: if size is a negative value and flags set the Mem_alloc_flags::Continuous bit, the allocator tries to allocate as much memory as possible leaving an amount of at least -size bytes within the associated quota. |
mem | Capability slot where the capability to the dataspace is received. |
flags | Special dataspace properties, see l4re_ma_flags |
align | Log2 alignment of dataspace if supported by allocator, will be at least L4_PAGESHIFT, with Super_pages flag set at least L4_SUPERPAGESHIFT |
0 | Success |
-L4_ERANGE | Given size not supported. |
-L4_ENOMEM | Not enough memory available. |
<0 | IPC error |
The memory allocator returns a dataspace.
Definition at line 154 of file mem_alloc.h.
References l4re_ma_alloc_align_srv(), and l4re_env_t::mem_alloc.
long l4re_ma_alloc_align_srv | ( | l4_cap_idx_t | srv, |
long | size, | ||
l4re_ds_t const | mem, | ||
unsigned long | flags, | ||
unsigned long | align | ||
) |
Allocate memory.
srv | Memory allocator service. |
size | Size to be requested. |
mem | Capability slot to put the requested dataspace in |
flags | Flags, see l4re_ma_flags |
align | Log2 alignment of dataspace if supported by allocator, will be at least L4_PAGESHIFT, with Super_pages flag set at least L4_SUPERPAGESHIFT, default 0 |
The memory allocator returns a dataspace.
Referenced by l4re_ma_alloc(), and l4re_ma_alloc_align().