From d8172209b3f1288761ba410f52b89adeb56394fe Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 9 Apr 2020 15:17:46 +0200 Subject: score: Add _Stack_Allocator_do_initialize() Do the stack allocator initialization and sanity check only if a user-provided stack allocator was configured. This avoids a dependency of _Thread_Handler_initialization() on the stack allocator. Update #3959. --- cpukit/include/rtems/confdefs/wkspace.h | 6 ++++++ cpukit/include/rtems/score/stack.h | 7 +++++++ cpukit/include/rtems/sysinit.h | 1 + 3 files changed, 14 insertions(+) (limited to 'cpukit/include') diff --git a/cpukit/include/rtems/confdefs/wkspace.h b/cpukit/include/rtems/confdefs/wkspace.h index 484dde20ea..de476dbf82 100644 --- a/cpukit/include/rtems/confdefs/wkspace.h +++ b/cpukit/include/rtems/confdefs/wkspace.h @@ -150,6 +150,12 @@ const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE; const Stack_Allocator_free _Stack_Allocator_free = CONFIGURE_TASK_STACK_DEALLOCATOR; + + RTEMS_SYSINIT_ITEM( + _Stack_Allocator_do_initialize, + RTEMS_SYSINIT_DIRTY_MEMORY, + RTEMS_SYSINIT_ORDER_MIDDLE + ); #elif defined(CONFIGURE_TASK_STACK_ALLOCATOR) \ || defined(CONFIGURE_TASK_STACK_DEALLOCATOR) #error "CONFIGURE_TASK_STACK_ALLOCATOR and CONFIGURE_TASK_STACK_DEALLOCATOR must be both defined or both undefined" diff --git a/cpukit/include/rtems/score/stack.h b/cpukit/include/rtems/score/stack.h index df1df74867..e869a04db5 100644 --- a/cpukit/include/rtems/score/stack.h +++ b/cpukit/include/rtems/score/stack.h @@ -123,6 +123,13 @@ extern const Stack_Allocator_allocate _Stack_Allocator_allocate; */ extern const Stack_Allocator_free _Stack_Allocator_free; +/** + * @brief Do the stack allocator initialization during system initialize. + * + * This function is used to initialize application provided stack allocators. + */ +void _Stack_Allocator_do_initialize( void ); + /** @} */ #ifdef __cplusplus diff --git a/cpukit/include/rtems/sysinit.h b/cpukit/include/rtems/sysinit.h index 245da74f2c..a28e44817a 100644 --- a/cpukit/include/rtems/sysinit.h +++ b/cpukit/include/rtems/sysinit.h @@ -41,6 +41,7 @@ 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 -- cgit v1.2.3