From 2846b17d7e34f1bdcac579ea1e0fbcb251aff1cb Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 26 Sep 2022 09:31:29 +0200 Subject: config: Changeable size for IDLE stack allocator Allow the IDLE stack allocator to change the stack size. This can be used by applications with a very dynamic thread-local storage size to adjust the thread storage area of the IDLE tasks dynamically. Update #4524. --- cpukit/include/rtems/score/stack.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'cpukit/include/rtems/score/stack.h') diff --git a/cpukit/include/rtems/score/stack.h b/cpukit/include/rtems/score/stack.h index 360e4d61f6..7577ca0474 100644 --- a/cpukit/include/rtems/score/stack.h +++ b/cpukit/include/rtems/score/stack.h @@ -105,15 +105,22 @@ typedef void ( *Stack_Allocator_free )( void *addr ); * The allocate for idle handler is optional even when the user thread stack * allocator and deallocator are configured. * - * @param cpu Index of the CPU for the IDLE thread using this stack - * @param stack_size The size of the stack area to allocate in bytes. + * @param cpu is the index of the CPU for the IDLE thread using this stack. * - * @retval NULL Not enough memory. - * @retval other Pointer to begin of stack area. + * @param stack_size[in, out] is pointer to a size_t object. On function + * entry, the object contains the proposed size of the stack area to allocate + * in bytes. The proposed size does not take the actual thread-local storage + * size of the application into account. The stack allocator can modify the + * size to ensure that there is enough space available in the stack area for + * the thread-local storage. + * + * @retval NULL There was not enough memory available to allocate a stack area. + * + * @return Returns the pointer to begin of the allocated stack area. */ typedef void *( *Stack_Allocator_allocate_for_idle )( uint32_t cpu, - size_t stack_size + size_t *stack_size ); /** -- cgit v1.2.3