RTEMS 6.1-rc1
|
#include <rtems.h>
#include <rtems/malloc.h>
#include <rtems/score/apimutex.h>
#include <rtems/score/heapimpl.h>
#include <rtems/score/sysstate.h>
Functions | |
void * | rtems_cache_coherent_allocate (size_t size, uintptr_t alignment, uintptr_t boundary) |
Allocates a memory area from cache coherent memory. More... | |
void | rtems_cache_coherent_free (void *ptr) |
Frees memory allocated by rtems_cache_coherent_allocate(). More... | |
void | rtems_cache_coherent_add_area (void *area_begin, uintptr_t area_size) |
Adds a cache coherent memory area to the cache coherent allocator. More... | |
void rtems_cache_coherent_add_area | ( | void * | begin, |
uintptr_t | size | ||
) |
Adds a cache coherent memory area to the cache coherent allocator.
begin | is the begin address of the cache coherent memory area to add. |
size | is the size in bytes of the cache coherent memory area to add. |
The following constraints apply to this directive:
void * rtems_cache_coherent_allocate | ( | size_t | size, |
uintptr_t | alignment, | ||
uintptr_t | boundary | ||
) |
Allocates a memory area from cache coherent memory.
size | is the requested size in bytes of the memory area to allocate. |
alignment | is the requested alignment in bytes of the memory area to allocate. If the alignment parameter is not equal to zero, the allocated memory area will begin at an address aligned by this value. |
boundary | is the requested boundary in bytes of the memory area to allocate. If the boundary parameter is not equal to zero, the allocated memory area will comply with a boundary constraint. The boundary value specifies the set of addresses which are aligned by the boundary value. The interior of the allocated memory area will not contain an element of this set. The begin or end address of the area may be a member of the set. |
NULL | There is not enough memory available to satisfy the allocation request. |
A size value of zero will return a unique address which may be freed with rtems_cache_coherent_free().
The memory allocated by the directive may be released with a call to rtems_cache_coherent_free().
By default the C Program Heap allocator is used. In case special memory areas must be used, then the BSP or the application should add cache coherent memory areas for the allocator via rtems_cache_coherent_add_area().
The following constraints apply to this directive:
void rtems_cache_coherent_free | ( | void * | ptr | ) |
Frees memory allocated by rtems_cache_coherent_allocate().
ptr | is a pointer returned by rtems_cache_coherent_allocate(). |
The following constraints apply to this directive: