36 #ifndef _RTEMS_SCORE_MEMORY_H 37 #define _RTEMS_SCORE_MEMORY_H 97 #define MEMORY_INFORMATION_INITIALIZER( areas ) \ 98 { RTEMS_ARRAY_SIZE( areas ), ( areas ) } 106 #define MEMORY_INITIALIZER( begin, end ) { ( begin ), ( begin ), ( end ) } 119 return information->
count;
136 return &information->
areas[ index ];
172 area->
end = (
char *) begin + size;
236 return (uintptr_t) area->
end - (uintptr_t) area->
begin;
274 return (uintptr_t) area->
end - (uintptr_t) area->
free;
290 area->
free = (
char *) area->
free + consume;
static __inline__ size_t _Memory_Get_count(const Memory_Information *information)
Get the memory area count.
const bool _Memory_Zero_before_use
Indicates if the memory is zeroed during system initialization.
static __inline__ void _Memory_Set_begin(Memory_Area *area, const void *begin)
Set the memory area begin.
static __inline__ Memory_Area * _Memory_Get_area(const Memory_Information *information, size_t index)
Get a memory area by index.
void * free
A pointer to the begin of the free area of the memory area.
void _Memory_Fill(const Memory_Information *information, int c)
Fill all free memory areas of the memory information with a constant byte.
static __inline__ uintptr_t _Memory_Get_free_size(const Memory_Area *area)
Get the size of the free memory area of the memory area.
Information for the Assert Handler.
static __inline__ void _Memory_Initialize(Memory_Area *area, void *begin, void *end)
Initialize the memory area.
The memory area description.
void _Memory_Zero_free_areas(void)
Zeros all free memory areas of the system.
static __inline__ void _Memory_Initialize_by_size(Memory_Area *area, void *begin, uintptr_t size)
Initialize the memory area by size.
static __inline__ uintptr_t _Memory_Get_size(const Memory_Area *area)
Get the memory area size.
const void * end
A pointer to the end of the memory area.
static __inline__ const void * _Memory_Get_begin(const Memory_Area *area)
Get the memory area begin.
static __inline__ void _Memory_Set_end(Memory_Area *area, const void *end)
Set the memory area end.
const void * begin
A pointer to the begin of the memory area.
static __inline__ void _Memory_Set_free_begin(Memory_Area *area, void *begin)
Set the begin of the free area of the memory area.
static __inline__ void * _Memory_Get_free_begin(const Memory_Area *area)
Get the begin of the free area of the memory area.
void * _Memory_Allocate(const Memory_Information *information, uintptr_t size, uintptr_t alignment)
Allocate a memory area from the memory information.
static __inline__ void _Memory_Consume(Memory_Area *area, uintptr_t consume)
Consume the specified size from the free memory area of the memory area.
This header file provides basic definitions used by the API and the implementation.
#define RTEMS_INLINE_ROUTINE
Gives a hint to the compiler in a function declaration to inline this function.
const Memory_Information * _Memory_Get(void)
Return the memory information of this platform.
void _Memory_Dirty_free_areas(void)
Dirty all free memory areas of the system.
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG.
static __inline__ const void * _Memory_Get_end(const Memory_Area *area)
Get the memory area end.