diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2011-12-14 13:17:19 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2011-12-14 13:17:19 +0000 |
commit | 9fa3cf0db84cbabdb639cdeb7565f4c3ca3bc562 (patch) | |
tree | 01dd8f3965e89b4f12c701aebe38eb6de63acc2c /cpukit/sapi/include/rtems/config.h | |
parent | 2011-12-14 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff) | |
download | rtems-9fa3cf0db84cbabdb639cdeb7565f4c3ca3bc562.tar.bz2 |
2011-12-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR 1924/cpukit
* sapi/include/rtems/config.h: Added stack_allocate_init_hook to
rtems_configuration_table.
* sapi/include/confdefs.h: Added CONFIGURE_TASK_STACK_FROM_ALLOCATOR
and CONFIGURE_TASK_STACK_ALLOCATOR_INIT defines. Set default stack
allocator and free hook to _Workspace_Allocate() and _Workspace_Free()
respectively.
* score/src/thread.c, score/src/threadstackallocate.c,
score/src/threadstackfree.c: Update due to API changes.
Diffstat (limited to 'cpukit/sapi/include/rtems/config.h')
-rw-r--r-- | cpukit/sapi/include/rtems/config.h | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/cpukit/sapi/include/rtems/config.h b/cpukit/sapi/include/rtems/config.h index 590999c029..25ddfda421 100644 --- a/cpukit/sapi/include/rtems/config.h +++ b/cpukit/sapi/include/rtems/config.h @@ -84,6 +84,30 @@ typedef struct { } rtems_multiprocessing_table; #endif +/** + * @brief Task stack allocator initialization hook. + * + * @param[in] stack_space_size Size of the stack space in bytes. + */ +typedef void (*rtems_stack_allocate_init_hook)( size_t stack_space_size ); + +/** + * @brief Task stack allocator hook. + * + * @param[in] stack_size Size of the task stack in bytes. + * + * @retval NULL Not enough memory. + * @retval other Pointer to task stack. + */ +typedef void *(*rtems_stack_allocate_hook)( size_t stack_size ); + +/** + * @brief Task stack deallocator hook. + * + * @param[in] addr Pointer to previously allocated task stack. + */ +typedef void (*rtems_stack_free_hook)( void *addr ); + /* * The following records define the Configuration Table. The * information contained in this table is required in all @@ -139,15 +163,20 @@ typedef struct { */ uint32_t interrupt_stack_size; - /** The BSP may want to provide it's own stack allocation routines. - * In this case, the BSP will provide this stack allocation hook. + /** + * @brief Optional task stack allocator initialization hook. */ - void * (*stack_allocate_hook)( size_t ); + rtems_stack_allocate_init_hook stack_allocate_init_hook; - /** The BSP may want to provide it's own stack free routines. - * In this case, the BSP will provide this stack free hook. + /** + * @brief Optional task stack allocator hook. */ - void (*stack_free_hook)( void *); + rtems_stack_allocate_hook stack_allocate_hook; + + /** + * @brief Optional task stack free hook. + */ + rtems_stack_free_hook stack_free_hook; /** If this element is TRUE, then RTEMS will zero the Executive Workspace. * When this element is FALSE, it is assumed that the BSP or invoking @@ -268,6 +297,9 @@ extern rtems_configuration_table Configuration; #define rtems_configuration_get_interrupt_stack_size() \ (Configuration.interrupt_stack_size) +#define rtems_configuration_get_stack_allocate_init_hook() \ + (Configuration.stack_allocate_init_hook) + #define rtems_configuration_get_stack_allocate_hook() \ (Configuration.stack_allocate_hook) |