Index: cpukit/ChangeLog
===================================================================
--- cpukit/ChangeLog	(revision 8907a01c00bb48f40f9feb009dc85c51945eb5b2)
+++ cpukit/ChangeLog	(revision bacf79e0b981e9e3796fb6e3a9d9b39ed476d60d)
@@ -1,2 +1,8 @@
+2009-09-13	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* 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.
+
 2009-09-13	Joel Sherrill <joel.sherrill@oarcorp.com>
 
Index: cpukit/score/include/rtems/score/thread.h
===================================================================
--- cpukit/score/include/rtems/score/thread.h	(revision 8907a01c00bb48f40f9feb009dc85c51945eb5b2)
+++ cpukit/score/include/rtems/score/thread.h	(revision bacf79e0b981e9e3796fb6e3a9d9b39ed476d60d)
@@ -36,4 +36,7 @@
 #endif
 
+#if defined(RTEMS_POSIX_API)
+  #define RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API
+#endif
 
 #ifdef __cplusplus
@@ -219,12 +222,14 @@
   /** This field is the initial priority. */
   Priority_Control                     initial_priority;
-  /** This field indicates whether the SuperCore allocated the stack. */
-  bool                                 core_allocated_stack;
+  #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
+    /** This field indicates whether the SuperCore allocated the stack. */
+    bool                                 core_allocated_stack;
+  #endif
   /** This field is the stack information. */
   Stack_Control                        Initial_stack;
-#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
-  /** This field is the initial FP context area address. */
-  Context_Control_fp                  *fp_context;
-#endif
+  #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
+    /** This field is the initial FP context area address. */
+    Context_Control_fp                  *fp_context;
+  #endif
   /** This field is the initial stack area address. */
   void                                *stack;
Index: cpukit/score/src/threadinitialize.c
===================================================================
--- cpukit/score/src/threadinitialize.c	(revision 8907a01c00bb48f40f9feb009dc85c51945eb5b2)
+++ cpukit/score/src/threadinitialize.c	(revision bacf79e0b981e9e3796fb6e3a9d9b39ed476d60d)
@@ -88,5 +88,5 @@
    *  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 )
@@ -94,10 +94,18 @@
 
     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(
Index: cpukit/score/src/threadstackfree.c
===================================================================
--- cpukit/score/src/threadstackfree.c	(revision 8907a01c00bb48f40f9feb009dc85c51945eb5b2)
+++ cpukit/score/src/threadstackfree.c	(revision bacf79e0b981e9e3796fb6e3a9d9b39ed476d60d)
@@ -42,22 +42,21 @@
 )
 {
+  #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.
-     */
+  /*
+   * 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.
+   */
 
-    if ( Configuration.stack_free_hook )
-      (*Configuration.stack_free_hook)(
-        the_thread->Start.Initial_stack.area
-      );
-    else
-        _Workspace_Free( the_thread->Start.Initial_stack.area );
+  if ( Configuration.stack_free_hook )
+    (*Configuration.stack_free_hook)( the_thread->Start.Initial_stack.area );
+  else
+    _Workspace_Free( the_thread->Start.Initial_stack.area );
 }
