![]() |
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 32 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 136 of file mem_alloc.h.
References L4_NOTHROW, l4re_ds_t, and l4re_ma_alloc_align_srv().
|
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 144 of file mem_alloc.h.
References L4_NOTHROW, l4re_ds_t, and 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 ) |
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.
References L4_CV, L4_INLINE, L4_NOTHROW, and l4re_ds_t.
Referenced by l4re_ma_alloc(), and l4re_ma_alloc_align().