diff options
author | Joel Sherrill <joel@rtems.org> | 2021-10-01 14:56:34 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2021-10-07 10:31:38 -0500 |
commit | c8a10609883c67629ea029be617a42b75d168f0f (patch) | |
tree | 77fb5ef6d9a04763840be4a205516d5fb542d6e4 /cpukit/include/rtems/confdefs/wkspace.h | |
parent | powerpc/motorola_powerpc: Map LibBSD bus space to the PCI base address (diff) | |
download | rtems-c8a10609883c67629ea029be617a42b75d168f0f.tar.bz2 |
Add support for IDLE Thread stack allocator
Add a stack allocator hook specifically for allocation of IDLE thread stacks.
This allows the user to decide if IDLE thread stacks are statically allocated
or handled by the same custom allocator mechanism as other thread stacks.
Closes #4520.
Diffstat (limited to 'cpukit/include/rtems/confdefs/wkspace.h')
-rw-r--r-- | cpukit/include/rtems/confdefs/wkspace.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cpukit/include/rtems/confdefs/wkspace.h b/cpukit/include/rtems/confdefs/wkspace.h index 484dde20ea..9ef9d90b85 100644 --- a/cpukit/include/rtems/confdefs/wkspace.h +++ b/cpukit/include/rtems/confdefs/wkspace.h @@ -132,12 +132,14 @@ const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE; #if defined(CONFIGURE_TASK_STACK_ALLOCATOR) \ && defined(CONFIGURE_TASK_STACK_DEALLOCATOR) + /* Custom allocator may or may not use the work space. */ #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE const bool _Stack_Allocator_avoids_workspace = true; #else const bool _Stack_Allocator_avoids_workspace = false; #endif + /* Custom allocator may or may not need initialization. */ #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_INIT const Stack_Allocator_initialize _Stack_Allocator_initialize = CONFIGURE_TASK_STACK_ALLOCATOR_INIT; @@ -145,16 +147,30 @@ const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE; const Stack_Allocator_initialize _Stack_Allocator_initialize = NULL; #endif + /* Custom allocator must include allocate and free */ const Stack_Allocator_allocate _Stack_Allocator_allocate = CONFIGURE_TASK_STACK_ALLOCATOR; const Stack_Allocator_free _Stack_Allocator_free = CONFIGURE_TASK_STACK_DEALLOCATOR; + +/* + * Must provide both a custom stack allocator and deallocator + */ #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" #endif +/* + * Custom IDLE thread stacks allocator. If this is provided, it is assumed + * that the allocator is providing its own memory for these stacks. + */ +#ifdef CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE + const Stack_Allocator_allocate_for_idle _Stack_Allocator_allocate_for_idle = + CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE; +#endif + #ifdef CONFIGURE_DIRTY_MEMORY RTEMS_SYSINIT_ITEM( _Memory_Dirty_free_areas, |