summaryrefslogtreecommitdiff
path: root/nuttx/arch/z16/src/common/up_usestack.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-20 18:22:21 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-20 18:22:21 +0000
commitfce497aecaf6826d6fec3cfcb761abeac7fe72bf (patch)
tree6d2f0d4610067c2b0e4c3f831274037c9ceba91a /nuttx/arch/z16/src/common/up_usestack.c
parent3d7ed16eabcbea16723b66df2cd2a7d10ba22474 (diff)
downloadpx4-nuttx-fce497aecaf6826d6fec3cfcb761abeac7fe72bf.tar.gz
px4-nuttx-fce497aecaf6826d6fec3cfcb761abeac7fe72bf.tar.bz2
px4-nuttx-fce497aecaf6826d6fec3cfcb761abeac7fe72bf.zip
Change prototypes of up_create_stack and up_release_stack to include a task type parameter
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5765 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/z16/src/common/up_usestack.c')
-rw-r--r--nuttx/arch/z16/src/common/up_usestack.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/nuttx/arch/z16/src/common/up_usestack.c b/nuttx/arch/z16/src/common/up_usestack.c
index 671930bbe..6396ce9c2 100644
--- a/nuttx/arch/z16/src/common/up_usestack.c
+++ b/nuttx/arch/z16/src/common/up_usestack.c
@@ -1,4 +1,4 @@
-/************************************************************
+/****************************************************************************
* arch/z16/common/up_usestack.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Included Files
- ************************************************************/
+ ****************************************************************************/
#include <nuttx/config.h>
@@ -49,38 +49,45 @@
#include "up_internal.h"
-/************************************************************
+/****************************************************************************
* Private Types
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Function Prototypes
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Global Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Name: up_use_stack
*
* Description:
- * Setup up stack-related information in the TCB
- * using pre-allocated stack memory
+ * Setup up stack-related information in the TCB using pre-allocated stack
+ * memory. This function is called only from task_init() when a task or
+ * kernel thread is started (never for pthreads).
*
* The following TCB fields must be initialized:
- * adj_stack_size: Stack size after adjustment for hardware,
+ *
+ * - adj_stack_size: Stack size after adjustment for hardware,
* processor, etc. This value is retained only for debug
* purposes.
- * stack_alloc_ptr: Pointer to allocated stack
- * adj_stack_ptr: Adjusted stack_alloc_ptr for HW. The
+ * - stack_alloc_ptr: Pointer to allocated stack
+ * - adj_stack_ptr: Adjusted stack_alloc_ptr for HW. The
* initial value of the stack pointer.
*
* Inputs:
- * tcb: The TCB of new task
- * stack_size: The allocated stack size.
+ * - tcb: The TCB of new task
+ * - stack_size: The allocated stack size.
+ *
+ * NOTE: Unlike up_stack_create() and up_stack_release, this function
+ * does not require the task type (ttype) parameter. The TCB flags will
+ * always be set to provide the task type to up_use_stack() if it needs
+ * that information.
*
- ************************************************************/
+ ****************************************************************************/
int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size)
{