diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-11-19 08:40:25 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-11-19 17:41:26 +0100 |
commit | 298b5ef16263149b524a05ecc691202484e318db (patch) | |
tree | f43c6e26eb918ca5165226c2982b42720e1ced66 /cpukit/include/rtems/confdefs/wkspace.h | |
parent | config: Simplify task stack allocator init (diff) | |
download | rtems-298b5ef16263149b524a05ecc691202484e318db.tar.bz2 |
config: Initialize task stack allocator on demand
Register a custom task stack allocator initialization handler only if
necessary.
Diffstat (limited to 'cpukit/include/rtems/confdefs/wkspace.h')
-rw-r--r-- | cpukit/include/rtems/confdefs/wkspace.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/cpukit/include/rtems/confdefs/wkspace.h b/cpukit/include/rtems/confdefs/wkspace.h index 81d172815e..803d8bdc10 100644 --- a/cpukit/include/rtems/confdefs/wkspace.h +++ b/cpukit/include/rtems/confdefs/wkspace.h @@ -150,10 +150,19 @@ const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE; #endif #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_INIT + RTEMS_STATIC_ASSERT( + CONFIGURE_TASK_STACK_ALLOCATOR_INIT != NULL, + CONFIGURE_TASK_STACK_ALLOCATOR_INIT_MUST_NOT_BE_NULL + ); + const Stack_Allocator_initialize _Stack_Allocator_initialize = CONFIGURE_TASK_STACK_ALLOCATOR_INIT; - #else - const Stack_Allocator_initialize _Stack_Allocator_initialize = NULL; + + RTEMS_SYSINIT_ITEM( + _Stack_Allocator_do_initialize, + RTEMS_SYSINIT_DIRTY_MEMORY, + RTEMS_SYSINIT_ORDER_MIDDLE + ); #endif RTEMS_STATIC_ASSERT( @@ -172,12 +181,6 @@ 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 - ); - #pragma GCC diagnostic pop #elif defined(CONFIGURE_TASK_STACK_ALLOCATOR) \ || defined(CONFIGURE_TASK_STACK_DEALLOCATOR) |