37#ifndef _RTEMS_SCORE_WKSPACEINITMULTI_H
38#define _RTEMS_SCORE_WKSPACEINITMULTI_H
44#include <rtems/config.h>
60static inline void _Workspace_Initialize_for_multiple_areas(
void )
71 page_size = CPU_HEAP_ALIGNMENT;
75 overhead = _Heap_Area_overhead( page_size );
77 for ( i = 0; i < _Memory_Get_count( mem ); ++i ) {
81 area = _Memory_Get_area( mem, i );
82 free_size = _Memory_Get_free_size( area );
84 if ( free_size > overhead ) {
85 uintptr_t space_available;
91 if ( remaining > 0 ) {
92 size = remaining < free_size - overhead ?
93 remaining + overhead : free_size;
99 space_available = ( *init_or_extend )(
101 _Memory_Get_free_begin( area ),
106 _Memory_Consume( area, size );
108 if ( space_available < remaining ) {
109 remaining -= space_available;
118 if ( remaining > 0 ) {
This header file provides the interfaces of the Memory Handler.
#define rtems_configuration_get_unified_work_area()
Indicates if the RTEMS Workspace and C Program Heap are configured to be unified for this application...
Definition config.h:768
#define rtems_configuration_get_work_space_size()
Gets the RTEMS Workspace size in bytes configured for this application.
Definition config.h:838
uintptr_t _Heap_Extend(Heap_Control *heap, void *area_begin, uintptr_t area_size, uintptr_t unused)
Extends the memory available for the heap.
Definition heapextend.c:139
uintptr_t _Heap_Initialize(Heap_Control *heap, void *area_begin, uintptr_t area_size, uintptr_t page_size)
Initializes the heap control block.
Definition heap.c:227
uintptr_t(*) Heap_Initialization_or_extend_handler(Heap_Control *heap, void *area_begin, uintptr_t area_size, uintptr_t page_size_or_unused)
Heap initialization and extend handler type.
Definition heap.h:373
RTEMS_NO_RETURN void _Internal_error(Internal_errors_Core_list core_error)
Terminates the system with an INTERNAL_ERROR_CORE fatal source and the specified core error code.
Definition interr.c:79
const Memory_Information * _Memory_Get(void)
Return the memory information of this platform.
Definition bspgetworkarea.c:227
Heap_Control _Workspace_Area
Executive workspace control.
Definition wkspace.c:44
This header file provides interfaces of the Barrier Handler which are only used by the implementation...
This header file provides the interfaces of the Internal Error Handler.
This header file provides interfaces of the Workspace Handler which are only used by the implementati...
The memory area description.
Definition memory.h:63