diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-07 16:28:21 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-02-12 09:08:36 +0100 |
commit | 0bde56b1b4ef7468188712c86e6bd2793532ddc9 (patch) | |
tree | aaca04985241fb16cb1ad6c856e5c87f6fd8a36e /cpukit/score/src/threadstackfree.c | |
parent | score: Simplify thread stack allocation (diff) | |
download | rtems-0bde56b1b4ef7468188712c86e6bd2793532ddc9.tar.bz2 |
score: Simplify thread stack free
Update #3835.
Diffstat (limited to 'cpukit/score/src/threadstackfree.c')
-rw-r--r-- | cpukit/score/src/threadstackfree.c | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/cpukit/score/src/threadstackfree.c b/cpukit/score/src/threadstackfree.c index 312a10c7f3..8d8e2296a7 100644 --- a/cpukit/score/src/threadstackfree.c +++ b/cpukit/score/src/threadstackfree.c @@ -1,8 +1,9 @@ /** - * @file + * @file * - * @brief Deallocate Thread Stack - * @ingroup RTEMSScoreThread + * @ingroup RTEMSScoreStack + * + * @brief Deallocate Thread Stack */ /* @@ -18,29 +19,10 @@ #include "config.h" #endif -#include <rtems/score/threadimpl.h> +#include <rtems/score/stackimpl.h> #include <rtems/config.h> -void _Thread_Stack_Free( - Thread_Control *the_thread -) +void _Stack_Free( void *stack_area ) { - 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. - */ - if ( !the_thread->Start.core_allocated_stack ) - return; - #endif - - /* - * Call ONLY the CPU table stack free hook, or the - * the RTEMS workspace free. This is so the free - * routine properly matches the allocation of the stack. - */ - - (*stack_free_hook)( the_thread->Start.Initial_stack.area ); + ( *rtems_configuration_get_stack_free_hook() )( stack_area ); } |