diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-21 17:35:08 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-21 17:35:08 +0000 |
commit | aee2b5f63b4eef1751605731688fd80d20593b81 (patch) | |
tree | 936c832a3c90c8ba410bcd050d0c97c4cfdb7cb0 /nuttx/arch/z80/src/common/up_usestack.c | |
parent | 55a46f0500f36567ce352048454534135aff92f2 (diff) | |
download | px4-nuttx-aee2b5f63b4eef1751605731688fd80d20593b81.tar.gz px4-nuttx-aee2b5f63b4eef1751605731688fd80d20593b81.tar.bz2 px4-nuttx-aee2b5f63b4eef1751605731688fd80d20593b81.zip |
Add a up_stack_frame() interface to allocate a frame of data on a task's stack.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5768 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/z80/src/common/up_usestack.c')
-rw-r--r-- | nuttx/arch/z80/src/common/up_usestack.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/nuttx/arch/z80/src/common/up_usestack.c b/nuttx/arch/z80/src/common/up_usestack.c index 095b4f5d5..414040ec2 100644 --- a/nuttx/arch/z80/src/common/up_usestack.c +++ b/nuttx/arch/z80/src/common/up_usestack.c @@ -106,18 +106,16 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) tcb->stack_alloc_ptr = stack; - /* The Arm7Tdmi uses a push-down stack: the stack grows - * toward loweraddresses in memory. The stack pointer - * register, points to the lowest, valid work address - * (the "top" of the stack). Items on the stack are - * referenced as positive word offsets from sp. + /* The Z80 uses a push-down stack: the stack grows toward lower + * addresses in memory. The stack pointer register, points to the + * lowest, valid work address (the "top" of the stack). Items on + * the stack are* referenced as positive word offsets from sp. */ top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size - 4; - /* The Arm7Tdmi stack must be aligned at word (4 byte) - * boundaries. If necessary top_of_stack must be rounded - * down to the next boundary + /* The Z80 stack does not need to be aligned. Here is is aligned at + * word (4 byte) boundary. */ top_of_stack &= ~3; |