RTEMS
5.0.0
|
RTEMS Run-Time Linker Allocator. More...
#include <stdio.h>
#include <string.h>
#include <rtems/rtl/rtl.h>
#include "rtl-alloc-heap.h"
#include <rtems/rtl/rtl-trace.h>
Macros | |
#define | rtems_rtl_trace_tag_label(_l) "" |
RTEMS Run-Time Linker Allocator.
#define rtems_rtl_trace_tag_label | ( | _l | ) | "" |
Tags as symbols for tracing.
rtems_rtl_alloc_tag rtems_rtl_alloc_bss_tag | ( | void | ) |
Return the default tag for bss sections.
rtems_rtl_alloc_tag rtems_rtl_alloc_const_tag | ( | void | ) |
Return the default tag for const sections.
rtems_rtl_alloc_tag rtems_rtl_alloc_data_tag | ( | void | ) |
Return the default tag for data sections.
void rtems_rtl_alloc_del | ( | rtems_rtl_alloc_tag | tag, |
void * | address | ||
) |
The Runtime Loader allocator delete deletes allocated memory.
tag | The type of allocation request. |
address | The memory address to delete. A NULL is ignored. |
rtems_rtl_alloc_tag rtems_rtl_alloc_eh_tag | ( | void | ) |
Return the default tag for exception sections.
rtems_rtl_allocator rtems_rtl_alloc_hook | ( | rtems_rtl_allocator | handler | ) |
Hook the Runtime Loader allocatior. A handler can call the previous handler in the chain to use it for specific tags. The default handler uses the system heap. Do not unhook your handler if memory it allocates has not been returned.
handler | The handler to use as the allocator. |
void rtems_rtl_alloc_indirect_del | ( | rtems_rtl_alloc_tag | tag, |
rtems_rtl_ptr * | handle | ||
) |
Free memory from an indirect handle.
tag | The type of allocation request. |
handle | The handle to free the memory from. |
void rtems_rtl_alloc_indirect_new | ( | rtems_rtl_alloc_tag | tag, |
rtems_rtl_ptr * | handle, | ||
size_t | size | ||
) |
Allocate memory to an indirect handle.
tag | The type of allocation request. |
handle | The handle to allocate the memory to. |
size | The size of the allocation. |
void rtems_rtl_alloc_initialise | ( | rtems_rtl_alloc_data * | data | ) |
Initialise the allocate data.
data | The data to initialise. |
void rtems_rtl_alloc_lock | ( | void | ) |
The Runtime Loader allocator lock. An allocator that depends on a separate allocation process, for example the heap, may need to be locked during loading of an object file to make sure the locality of the memory. This call be used to lock such an allocator. Allocator calls in this interface are protected by the RTL lock.
void rtems_rtl_alloc_module_del | ( | void ** | text_base, |
void ** | const_base, | ||
void ** | eh_base, | ||
void ** | data_base, | ||
void ** | bss_base | ||
) |
Free the memory allocated to a module.
text_base | Pointer to the text base pointer. |
const_base | Pointer to the const base pointer. |
eh_base | Pointer to the eh base pointer. |
data_base | Pointer to the data base pointer. |
bss_base | Pointer to the bss base pointer. |
bool rtems_rtl_alloc_module_new | ( | void ** | text_base, |
size_t | text_size, | ||
void ** | const_base, | ||
size_t | const_size, | ||
void ** | eh_base, | ||
size_t | eh_size, | ||
void ** | data_base, | ||
size_t | data_size, | ||
void ** | bss_base, | ||
size_t | bss_size | ||
) |
Allocate the memory for a module given the size of the text, const, data and bss sections. If any part of the allocation fails the no memory is allocated.
text_base | Pointer to the text base pointer. |
text_size | The size of the read/exec section. |
const_base | Pointer to the const base pointer. |
const_size | The size of the read only section. |
eh_base | Pointer to the eh base pointer. |
eh_size | The size of the eh section. |
data_base | Pointer to the data base pointer. |
data_size | The size of the read/write secton. |
bss_base | Pointer to the bss base pointer. |
bss_size | The size of the read/write. |
true | The memory has been allocated. |
false | The allocation of memory has failed. |
void* rtems_rtl_alloc_new | ( | rtems_rtl_alloc_tag | tag, |
size_t | size, | ||
bool | zero | ||
) |
The Runtime Loader allocator new allocates new memory and optionally clear the memory if requested.
tag | The type of allocation request. |
size | The size of the allocation. |
zero | If true the memory is cleared. |
rtems_rtl_alloc_tag rtems_rtl_alloc_text_tag | ( | void | ) |
Return the default tag for text sections.
void rtems_rtl_alloc_unlock | ( | void | ) |
The Runtime Loader allocator unlock. An allocator that depends on a separate allocation process, for example the heap, may need to be locked during loading of an object file to make sure the locality of the memory. This call can be used to unlock such an allocator. Allocator calls in this interface are protected by the RTL lock.
void rtems_rtl_alloc_wr_disable | ( | rtems_rtl_alloc_tag | tag, |
void * | address | ||
) |
The Runtime Loader allocator disable write on a bloc of allocated memory.
tag | The type of allocation request. Must match the address. |
address | The memory address to write disable. A NULL is ignored. |
void rtems_rtl_alloc_wr_enable | ( | rtems_rtl_alloc_tag | tag, |
void * | address | ||
) |
The Runtime Loader allocator enable write on a bloc of allocated memory.
tag | The type of allocation request. Must match the address. |
address | The memory address to write enable. A NULL is ignored. |