summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-02-24 13:12:27 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-02-24 13:32:35 +0100
commitd138a7906a6ae75173be289bb01b0cd66ab76854 (patch)
treeb24293c0863b9b11c8edf4ef896d1ac79032e61f
parentbsps: Change license to BSD-2-Clause of some files (diff)
downloadrtems-d138a7906a6ae75173be289bb01b0cd66ab76854.tar.bz2
config: Adjust stack allocator initialization
Use the right system initialization step for the stack allocator initialization. Do the stack allocator initialization before the workspace initialization so that _Memory_Allocate() can be used to get memory for the allocator.
-rw-r--r--cpukit/include/rtems/confdefs/wkspace.h2
-rw-r--r--cpukit/include/rtems/sysinit.h2
-rw-r--r--cpukit/sapi/src/sysinitverbose.c11
3 files changed, 12 insertions, 3 deletions
diff --git a/cpukit/include/rtems/confdefs/wkspace.h b/cpukit/include/rtems/confdefs/wkspace.h
index b37af79411..46bdee6da1 100644
--- a/cpukit/include/rtems/confdefs/wkspace.h
+++ b/cpukit/include/rtems/confdefs/wkspace.h
@@ -167,7 +167,7 @@ const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE;
RTEMS_SYSINIT_ITEM(
_Stack_Allocator_do_initialize,
- RTEMS_SYSINIT_DIRTY_MEMORY,
+ RTEMS_SYSINIT_STACK_ALLOCATOR,
RTEMS_SYSINIT_ORDER_MIDDLE
);
#endif
diff --git a/cpukit/include/rtems/sysinit.h b/cpukit/include/rtems/sysinit.h
index a28e44817a..cb17a0fd77 100644
--- a/cpukit/include/rtems/sysinit.h
+++ b/cpukit/include/rtems/sysinit.h
@@ -34,6 +34,7 @@ extern "C" {
#define RTEMS_SYSINIT_ISR_STACK 000200
#define RTEMS_SYSINIT_PER_CPU_DATA 000220
#define RTEMS_SYSINIT_SBRK 000240
+#define RTEMS_SYSINIT_STACK_ALLOCATOR 000250
#define RTEMS_SYSINIT_WORKSPACE 000260
#define RTEMS_SYSINIT_MALLOC 000280
#define RTEMS_SYSINIT_BSP_START 000300
@@ -41,7 +42,6 @@ extern "C" {
#define RTEMS_SYSINIT_INITIAL_EXTENSIONS 000500
#define RTEMS_SYSINIT_MP_EARLY 000600
#define RTEMS_SYSINIT_DATA_STRUCTURES 000700
-#define RTEMS_SYSINIT_STACK_ALLOCATOR 000780
#define RTEMS_SYSINIT_MP 000800
#define RTEMS_SYSINIT_USER_EXTENSIONS 000900
#define RTEMS_SYSINIT_CLASSIC_TASKS 000a00
diff --git a/cpukit/sapi/src/sysinitverbose.c b/cpukit/sapi/src/sysinitverbose.c
index 157889c814..d05f1de9b3 100644
--- a/cpukit/sapi/src/sysinitverbose.c
+++ b/cpukit/sapi/src/sysinitverbose.c
@@ -61,6 +61,7 @@ SYSINIT_VERBOSE( ZERO_MEMORY );
SYSINIT_VERBOSE( ISR_STACK );
SYSINIT_VERBOSE( PER_CPU_DATA );
SYSINIT_VERBOSE( SBRK );
+SYSINIT_VERBOSE( STACK_ALLOCATOR );
SYSINIT_VERBOSE( WORKSPACE );
SYSINIT_VERBOSE( MALLOC );
SYSINIT_VERBOSE( BSP_START );
@@ -233,9 +234,17 @@ static void _Sysinit_Verbose_SBRK( void )
}
}
+static void _Sysinit_Verbose_STACK_ALLOCATOR( void )
+{
+ if ( !SYSINIT_IS_ADJACENT( SBRK, STACK_ALLOCATOR ) ) {
+ _Sysinit_Print_free_memory();
+ printk( "sysinit: STACK_ALLOCATOR: done\n" );
+ }
+}
+
static void _Sysinit_Verbose_WORKSPACE( void )
{
- if ( !SYSINIT_IS_ADJACENT( SBRK, WORKSPACE ) ) {
+ if ( !SYSINIT_IS_ADJACENT( STACK_ALLOCATOR, WORKSPACE ) ) {
_Sysinit_Print_free_memory();
printk( "sysinit: WORKSPACE: done\n" );
}