diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-07 16:00:58 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-02-12 09:08:35 +0100 |
commit | a0211fc9f9883d0a1182548de11ab0e0505a81c6 (patch) | |
tree | f7f5ffa7f53492d54100185e5343d9d55dba72fd /cpukit/score/src/threadstackallocate.c | |
parent | score: Remove superfluous FP types/defines (diff) | |
download | rtems-a0211fc9f9883d0a1182548de11ab0e0505a81c6.tar.bz2 |
score: Simplify thread stack allocation
Remove superfluous Thread_Control::Start::stack member.
Update #3835.
Diffstat (limited to 'cpukit/score/src/threadstackallocate.c')
-rw-r--r-- | cpukit/score/src/threadstackallocate.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/cpukit/score/src/threadstackallocate.c b/cpukit/score/src/threadstackallocate.c index fd89d7f07f..722de7bfd6 100644 --- a/cpukit/score/src/threadstackallocate.c +++ b/cpukit/score/src/threadstackallocate.c @@ -1,11 +1,11 @@ /** * @file - * + * + * @ingroup RTEMSScoreStack + * * @brief Stack Allocate Helper - * @ingroup RTEMSScoreThread */ - /* * COPYRIGHT (c) 1989-2010. * On-Line Applications Research Corporation (OAR). @@ -19,28 +19,10 @@ #include "config.h" #endif -#include <rtems/score/threadimpl.h> #include <rtems/score/stackimpl.h> #include <rtems/config.h> -size_t _Thread_Stack_Allocate( - Thread_Control *the_thread, - size_t stack_size -) +void *_Stack_Allocate( size_t stack_size ) { - void *stack_addr = 0; - size_t the_stack_size; - rtems_stack_allocate_hook stack_allocate_hook = - rtems_configuration_get_stack_allocate_hook(); - - the_stack_size = _Stack_Ensure_minimum( stack_size ); - - stack_addr = (*stack_allocate_hook)( the_stack_size ); - - if ( !stack_addr ) - the_stack_size = 0; - - the_thread->Start.stack = stack_addr; - - return the_stack_size; + return ( *rtems_configuration_get_stack_allocate_hook() )( stack_size ); } |