summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadstackfree.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2011-12-14 13:17:19 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2011-12-14 13:17:19 +0000
commit9fa3cf0db84cbabdb639cdeb7565f4c3ca3bc562 (patch)
tree01dd8f3965e89b4f12c701aebe38eb6de63acc2c /cpukit/score/src/threadstackfree.c
parent2011-12-14 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff)
downloadrtems-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/score/src/threadstackfree.c')
-rw-r--r--cpukit/score/src/threadstackfree.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cpukit/score/src/threadstackfree.c b/cpukit/score/src/threadstackfree.c
index 64e0278e1b..926c1e9eb1 100644
--- a/cpukit/score/src/threadstackfree.c
+++ b/cpukit/score/src/threadstackfree.c
@@ -41,6 +41,9 @@ void _Thread_Stack_Free(
Thread_Control *the_thread
)
{
+ rtems_stack_free_hook stack_free_hook =
+ rtems_configuration_get_stack_free_hook();
+
#if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
/*
* If the API provided the stack space, then don't free it.
@@ -55,8 +58,5 @@ void _Thread_Stack_Free(
* routine properly matches the allocation of the stack.
*/
- if ( Configuration.stack_free_hook )
- (*Configuration.stack_free_hook)( the_thread->Start.Initial_stack.area );
- else
- _Workspace_Free( the_thread->Start.Initial_stack.area );
+ (*stack_free_hook)( the_thread->Start.Initial_stack.area );
}