This group contains the Stack Handler implementation.
More...
This group contains the Stack Handler implementation.
This handler encapsulates functionality which is used in the management of thread stacks. It provides mechanisms which can be used to initialize and utilize stacks.
◆ STACK_MINIMUM_SIZE
The following constant defines the minimum stack size which every thread must exceed.
◆ Stack_Allocator_allocate
typedef void *(* Stack_Allocator_allocate) (size_t stack_size) |
Stack allocator allocate handler.
- Parameters
-
stack_size | The size of the stack area to allocate in bytes. |
- Return values
-
NULL | Not enough memory. |
other | Pointer to begin of stack area. |
◆ Stack_Allocator_allocate_for_idle
typedef void *(* Stack_Allocator_allocate_for_idle) (uint32_t cpu, size_t *stack_size) |
Stack allocator allocate for idle handler.
The allocate for idle handler is optional even when the user thread stack allocator and deallocator are configured.
- Parameters
-
cpu | is the index of the CPU for the IDLE thread using this stack. |
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. |
- Return values
-
NULL | There was not enough memory available to allocate a stack area. |
- Returns
- Returns the pointer to begin of the allocated stack area.
◆ Stack_Allocator_free
typedef void(* Stack_Allocator_free) (void *addr) |
Stack allocator free handler.
- Parameters
-
] | addr A pointer to previously allocated stack area or NULL. |
◆ Stack_Allocator_initialize
typedef void(* Stack_Allocator_initialize) (size_t stack_space_size) |
The stack allocator initialization handler.
- Parameters
-
stack_space_size | The size of the stack space in bytes. |
◆ _Stack_Allocate()
void * _Stack_Allocate |
( |
size_t |
stack_size | ) |
|
Allocate the requested stack space.
- Parameters
-
stack_size | The stack space that is requested. |
- Return values
-
stack_area | The allocated stack area. |
NULL | The allocation failed. |
◆ _Stack_Allocator_allocate_for_idle_static()
void * _Stack_Allocator_allocate_for_idle_static |
( |
uint32_t |
cpu_index, |
|
|
size_t * |
storage_size |
|
) |
| |
Allocates the IDLE thread storage from the memory statically allocated by <rtems/confdefs.h>.
- Parameters
-
- Returns
- Returns a pointer to the begin of the allocated task storage area.
◆ _Stack_Allocator_allocate_for_idle_workspace()
void * _Stack_Allocator_allocate_for_idle_workspace |
( |
uint32_t |
unused, |
|
|
size_t * |
storage_size |
|
) |
| |
Allocates the IDLE thread storage area from the workspace.
If the thread storage area cannot be allocated, then the ::INTERNAL_ERROR_NO_MEMORY_FOR_IDLE_TASK_STACK fatal error will occur.
- Parameters
-
unused | is an unused parameter. |
stack_size[in] | is pointer to a size_t object. On function entry, the object contains the size of the task storage area to allocate in bytes. |
- Returns
- Returns a pointer to the begin of the allocated task storage area.
◆ _Stack_Allocator_do_initialize()
void _Stack_Allocator_do_initialize |
( |
void |
| ) |
|
Do the stack allocator initialization during system initialize.
This function is used to initialize application provided stack allocators.
◆ _Stack_Free()
void _Stack_Free |
( |
void * |
stack_area | ) |
|
Free the stack area allocated by _Stack_Allocate().
Do nothing if the stack area is NULL.
- Parameters
-
stack_area | The stack area to free, or NULL. |
◆ _Stack_Allocator_allocate
The stack allocator allocate handler.
Application provided via <rtems/confdefs.h>.
◆ _Stack_Allocator_allocate_for_idle
The stack allocator allocate stack for idle thread handler.
Application provided via <rtems/confdefs.h>.
◆ _Stack_Allocator_allocate_for_idle_storage_areas
char _Stack_Allocator_allocate_for_idle_storage_areas[] |
|
extern |
◆ _Stack_Allocator_allocate_for_idle_storage_size
const size_t _Stack_Allocator_allocate_for_idle_storage_size |
|
extern |
◆ _Stack_Allocator_avoids_workspace
const bool _Stack_Allocator_avoids_workspace |
|
extern |
Indicates if the stack allocator avoids the workspace.
Application provided via <rtems/confdefs.h>.
◆ _Stack_Allocator_free
◆ _Stack_Allocator_initialize
The stack allocator initialization handler.
Application provided via <rtems/confdefs.h>.
◆ _Stack_Space_size
const uintptr_t _Stack_Space_size |
|
extern |
◆ rtems_minimum_stack_size
uint32_t rtems_minimum_stack_size |
|
extern |