![]() |
RTEMS 6.3
|
This group contains the Stack Handler implementation. More...
Files | |
| file | cpukit/include/rtems/score/stack.h |
| This header file provides interfaces of the Stack Handler which are used by the implementation and the Application Configuration. | |
| file | cpukit/include/rtems/score/stackimpl.h |
| This header file provides interfaces of the Stack Handler which are only used by the implementation. | |
| file | cpukit/score/src/stackallocator.c |
| This source file contains a definition of _Stack_Allocator_avoids_workspace and _Stack_Allocator_allocate which allocates the thread stacks from the RTEMS Workspace. | |
| file | cpukit/score/src/stackallocatorforidle.c |
| This source file contains the implementation of _Stack_Allocator_allocate_for_idle_static(). | |
| file | cpukit/score/src/stackallocatorforidlewkspace.c |
| This source file contains the implementation of _Stack_Allocator_allocate_for_idle_workspace(). | |
| file | cpukit/score/src/stackallocatorfree.c |
| This source file contains a definition of _Stack_Allocator_free which frees the thread stacks to the RTEMS Workspace. | |
| file | cpukit/score/src/stackallocatorinit.c |
| This source file contains the implementation of _Stack_Allocator_do_initialize(). | |
| file | cpukit/score/src/threadstackallocate.c |
| This source file contains the implementation of _Stack_Allocate(). | |
| file | cpukit/score/src/threadstackfree.c |
| This source file contains the implementation of _Stack_Free(). | |
Data Structures | |
| struct | Stack_Control |
Macros | |
| #define | STACK_MINIMUM_SIZE CPU_STACK_MINIMUM_SIZE |
Typedefs | |
| typedef void(*) | Stack_Allocator_initialize(size_t stack_space_size) |
| The stack allocator initialization handler. | |
| typedef void *(*) | Stack_Allocator_allocate(size_t stack_size) |
| Stack allocator allocate handler. | |
| typedef void(*) | Stack_Allocator_free(void *addr) |
| Stack allocator free handler. | |
| typedef void *(*) | Stack_Allocator_allocate_for_idle(uint32_t cpu, size_t *stack_size) |
| Stack allocator allocate for idle handler. | |
Functions | |
| void | _Stack_Allocator_do_initialize (void) |
| Do the stack allocator initialization during system initialize. | |
| void * | _Stack_Allocator_allocate_for_idle_workspace (uint32_t unused, size_t *storage_size) |
| Allocates the IDLE thread storage area from the workspace. | |
| 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>. | |
| void * | _Stack_Allocate (size_t stack_size) |
| Allocate the requested stack space. | |
| void | _Stack_Free (void *stack_area) |
| Free the stack area allocated by _Stack_Allocate(). | |
Variables | |
| uint32_t | rtems_minimum_stack_size |
| The minimum stack size. | |
| const uintptr_t | _Stack_Space_size |
| The configured stack space size. | |
| const bool | _Stack_Allocator_avoids_workspace |
| Indicates if the stack allocator avoids the workspace. | |
| const Stack_Allocator_initialize | _Stack_Allocator_initialize |
| The stack allocator initialization handler. | |
| const Stack_Allocator_allocate | _Stack_Allocator_allocate |
| The stack allocator allocate handler. | |
| const Stack_Allocator_free | _Stack_Allocator_free |
| The stack allocator free handler. | |
| const size_t | _Stack_Allocator_allocate_for_idle_storage_size |
| The size in bytes of the idle thread storage area used by _Stack_Allocator_allocate_for_idle_static(). | |
| char | _Stack_Allocator_allocate_for_idle_storage_areas [] |
| The thread storage areas used by _Stack_Allocator_allocate_for_idle_static(). | |
| const Stack_Allocator_allocate_for_idle | _Stack_Allocator_allocate_for_idle |
| The stack allocator allocate stack for idle thread handler. | |
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.
| #define STACK_MINIMUM_SIZE CPU_STACK_MINIMUM_SIZE |
The following constant defines the minimum stack size which every thread must exceed.
| typedef void *(*) Stack_Allocator_allocate(size_t stack_size) |
Stack allocator allocate handler.
| stack_size | The size of the stack area to allocate in bytes. |
| NULL | Not enough memory. |
| other | Pointer to begin of stack area. |
| 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.
| 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. |
| NULL | There was not enough memory available to allocate a stack area. |
| typedef void(*) Stack_Allocator_free(void *addr) |
Stack allocator free handler.
| ] | addr A pointer to previously allocated stack area or NULL. |
| typedef void(*) Stack_Allocator_initialize(size_t stack_space_size) |
The stack allocator initialization handler.
| stack_space_size | The size of the stack space in bytes. |
| void * _Stack_Allocate | ( | size_t | stack_size | ) |
Allocate the requested stack space.
| stack_size | The stack space that is requested. |
| stack_area | The allocated stack area. |
| NULL | The allocation failed. |
| 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>.
| cpu_index | is the index of the CPU for the IDLE thread using this stack. |
| stack_size[out] | is pointer to a size_t object. On function return, the object value is set to the value of _Stack_Allocator_allocate_for_idle_storage_size. |
| 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.
| 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. |
| void _Stack_Allocator_do_initialize | ( | void | ) |
Do the stack allocator initialization during system initialize.
This function is used to initialize application provided stack allocators.
| void _Stack_Free | ( | void * | stack_area | ) |
Free the stack area allocated by _Stack_Allocate().
Do nothing if the stack area is NULL.
| stack_area | The stack area to free, or NULL. |
|
extern |
The stack allocator allocate handler.
Application provided via <rtems/confdefs.h>.
|
extern |
The stack allocator allocate stack for idle thread handler.
Application provided via <rtems/confdefs.h>.
|
extern |
The thread storage areas used by _Stack_Allocator_allocate_for_idle_static().
Application provided via <rtems/confdefs.h>.
|
extern |
The size in bytes of the idle thread storage area used by _Stack_Allocator_allocate_for_idle_static().
Application provided via <rtems/confdefs.h>.
|
extern |
Indicates if the stack allocator avoids the workspace.
Application provided via <rtems/confdefs.h>.
|
extern |
The stack allocator free handler.
Application provided via <rtems/confdefs.h>.
|
extern |
The stack allocator initialization handler.
Application provided via <rtems/confdefs.h>.
|
extern |
The configured stack space size.
Application provided via <rtems/confdefs.h>.
|
extern |
The minimum stack size.
Application provided via <rtems/confdefs.h>.