From bacf79e0b981e9e3796fb6e3a9d9b39ed476d60d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sun, 13 Sep 2009 21:00:11 +0000 Subject: 2009-09-13 Joel Sherrill * score/include/rtems/score/thread.h, score/src/threadinitialize.c, score/src/threadstackfree.c: Disable capability for API to let user provide thread stack when no API configured includes this capability. --- cpukit/score/src/threadinitialize.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'cpukit/score/src/threadinitialize.c') diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c index c41983fc34..2f7cf370be 100644 --- a/cpukit/score/src/threadinitialize.c +++ b/cpukit/score/src/threadinitialize.c @@ -87,18 +87,26 @@ bool _Thread_Initialize( /* * Allocate and Initialize the stack for this thread. */ - if ( !stack_area ) { + #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; - the_thread->Start.core_allocated_stack = true; - } else { - stack = stack_area; - actual_stack_size = stack_size; - the_thread->Start.core_allocated_stack = false; - } + #else + if ( !stack_area ) { + actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); + if ( !actual_stack_size || actual_stack_size < stack_size ) + return false; /* stack allocation failed */ + + stack = the_thread->Start.stack; + the_thread->Start.core_allocated_stack = true; + } else { + stack = stack_area; + actual_stack_size = stack_size; + the_thread->Start.core_allocated_stack = false; + } + #endif _Stack_Initialize( &the_thread->Start.Initial_stack, -- cgit v1.2.3