forked from Imagelibrary/rtems
score: Work area initialization API change
The work areas (RTEMS work space and C program heap) will be initialized now in a separate step and are no longer part of rtems_initialize_data_structures(). Initialization is performed with tables of Heap_Area entries. This allows usage of scattered memory areas present on various small scale micro-controllers. The sbrk() support API changes also. The bsp_sbrk_init() must now deal with a minimum size for the first memory chunk to take the configured work space size into account.
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#include <rtems/score/wkspace.h>
|
||||
|
||||
/*
|
||||
* Way too much stack space. Should generate a fatal error
|
||||
* on the init task create.
|
||||
@@ -39,10 +41,16 @@ char Workspace[ 256 ] CPU_STRUCTURE_ALIGNMENT;
|
||||
|
||||
void force_error()
|
||||
{
|
||||
rtems_configuration_set_work_space_start( Workspace );
|
||||
rtems_configuration_set_work_space_size( sizeof(Workspace) );
|
||||
Heap_Area area = {
|
||||
.begin = Workspace,
|
||||
.size = sizeof( Workspace )
|
||||
};
|
||||
|
||||
rtems_configuration_set_work_space_size( 0 );
|
||||
rtems_configuration_set_stack_space_size( 0 );
|
||||
|
||||
rtems_initialize_data_structures();;
|
||||
_Workspace_Handler_initialization( &area, 1, NULL );
|
||||
|
||||
_Workspace_Allocate_or_fatal_error( 2 * sizeof( Workspace ) );
|
||||
/* we will not run this far */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user