summaryrefslogtreecommitdiff
path: root/nuttx/arch/z16
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-21 23:37:11 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-21 23:37:11 +0000
commit7406abbc5ac56892524846c8a19d2aabfc34eef4 (patch)
tree407cb38c04306722a9e3fb6136fa4e3058e22e5c /nuttx/arch/z16
parent7fd81076443ca5685f38f02ecd926e8bda368c9b (diff)
downloadnuttx-7406abbc5ac56892524846c8a19d2aabfc34eef4.tar.gz
nuttx-7406abbc5ac56892524846c8a19d2aabfc34eef4.tar.bz2
nuttx-7406abbc5ac56892524846c8a19d2aabfc34eef4.zip
Corrections needed after further test of stack-based task arguments
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5771 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/z16')
-rw-r--r--nuttx/arch/z16/src/common/up_stackframe.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/nuttx/arch/z16/src/common/up_stackframe.c b/nuttx/arch/z16/src/common/up_stackframe.c
index 11eec6c2e..ea2d696c8 100644
--- a/nuttx/arch/z16/src/common/up_stackframe.c
+++ b/nuttx/arch/z16/src/common/up_stackframe.c
@@ -45,6 +45,7 @@
#include <debug.h>
#include <nuttx/arch.h>
+#include <arch/irq.h>
#include "up_internal.h"
@@ -124,9 +125,15 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
/* Save the adjusted stack values in the struct tcb_s */
- topaddr = (uintptr_t)tcb->adj_stack_ptr - frame_size;
- tcb->adj_stack_ptr = (FAR void *)topaddr;
- tcb->adj_stack_size -= frame_size;
+ topaddr = (uintptr_t)tcb->adj_stack_ptr - frame_size;
+ tcb->adj_stack_ptr = (FAR void *)topaddr;
+ tcb->adj_stack_size -= frame_size;
+
+ /* Reset the initial stack pointer */
+
+ tcb->xcp.regs[REG_SP/2] = (uint32_t)tcb->adj_stack_ptr;
+
+ /* And return a pointer to the allocated memory */
return (FAR void *)(topaddr + sizeof(uint32_t));
}