diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-09-30 08:06:18 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-10-14 10:48:23 +0200 |
commit | 45ee958552ca35b6834985718ecd59b27fc52f86 (patch) | |
tree | 5d66e79cf20491f0f1b8f32b292a5a398d386ce4 /testsuites/sptests/spstkalloc02 | |
parent | stackchk01: Check CPU_STACK_MINIMUM_SIZE (diff) | |
download | rtems-45ee958552ca35b6834985718ecd59b27fc52f86.tar.bz2 |
config: Add CONFIGURE_IDLE_TASK_STORAGE_SIZE
By default, allocate the IDLE task storage areas from the RTEMS Workspace.
This avoids having to estimate the thread-local storage size in the default
configuration.
Add the application configuration option CONFIGURE_IDLE_TASK_STORAGE_SIZE to
request a static allocation of the task storage area for IDLE tasks.
Update #3835.
Update #4524.
Diffstat (limited to 'testsuites/sptests/spstkalloc02')
-rw-r--r-- | testsuites/sptests/spstkalloc02/init.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuites/sptests/spstkalloc02/init.c b/testsuites/sptests/spstkalloc02/init.c index 3613a6a563..7fee4615ad 100644 --- a/testsuites/sptests/spstkalloc02/init.c +++ b/testsuites/sptests/spstkalloc02/init.c @@ -44,6 +44,7 @@ const char rtems_test_name[] = "SPSTKALLOC 2"; #include <stdio.h> #include <inttypes.h> +#include <rtems/malloc.h> #include <rtems/score/heapimpl.h> #define TASK_COUNT 5 @@ -56,6 +57,8 @@ static void task_stack_init(size_t stack_space_size); static void *task_stack_allocate(size_t stack_size); +static void *task_stack_allocate_for_idle(uint32_t unused, size_t *stack_size); + static void task_stack_free(void *addr); static void print_info(void) @@ -149,6 +152,7 @@ static rtems_task Init(rtems_task_argument argument) #define CONFIGURE_TASK_STACK_ALLOCATOR_INIT task_stack_init #define CONFIGURE_TASK_STACK_ALLOCATOR task_stack_allocate +#define CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE task_stack_allocate_for_idle #define CONFIGURE_TASK_STACK_DEALLOCATOR task_stack_free #define CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE #define CONFIGURE_TASK_STACK_FROM_ALLOCATOR(stack_size) \ @@ -183,6 +187,15 @@ static void *task_stack_allocate(size_t stack_size) return _Heap_Allocate(&task_stack_heap, stack_size); } +static void *task_stack_allocate_for_idle(uint32_t unused, size_t *stack_size) +{ + return rtems_heap_allocate_aligned_with_boundary( + *stack_size, + CPU_STACK_ALIGNMENT, + 0 + ); +} + static void task_stack_free(void *addr) { _Heap_Free(&task_stack_heap, addr); |