summaryrefslogtreecommitdiff
path: root/libcpu/xilinx/microblaze/stack.c
diff options
context:
space:
mode:
author[email protected] <[email protected]>2012-10-26 03:36:13 +0000
committer[email protected] <[email protected]>2012-10-26 03:36:13 +0000
commit6fe2afed8ca4deaa94cc9f8795fb8dcd7e880225 (patch)
tree789cfbb616d3bb80cf95034e7bf77ac326b62adf /libcpu/xilinx/microblaze/stack.c
parent2cdbbf8b0536b60ac931b7f401f731a4f560c37b (diff)
for rt-thread 1.1.0
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2372 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'libcpu/xilinx/microblaze/stack.c')
-rwxr-xr-xlibcpu/xilinx/microblaze/stack.c79
1 files changed, 41 insertions, 38 deletions
diff --git a/libcpu/xilinx/microblaze/stack.c b/libcpu/xilinx/microblaze/stack.c
index 6109ce4486..686fc078a3 100755
--- a/libcpu/xilinx/microblaze/stack.c
+++ b/libcpu/xilinx/microblaze/stack.c
@@ -13,8 +13,10 @@
*
*/
#include <rtthread.h>
-extern void *_SDA_BASE_;
-extern void *_SDA2_BASE_;
+extern void *_SDA_BASE_;
+extern void *_SDA2_BASE_;
+
+
/**
* This function will initialize thread stack
@@ -26,43 +28,44 @@ extern void *_SDA2_BASE_;
*
* @return stack address
*/
-rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter, rt_uint8_t *stack_addr, void *texit)
+rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter,
+ rt_uint8_t *stack_addr, void *texit)
{
- unsigned long *stk;
+ unsigned long *stk;
- stk = (unsigned long *) stack_addr;
- stk--;
- stk--;
- *stk-- = 0; /* r31 */
- *stk-- = 0; /* r30 */
- *stk-- = 0; /* r29 */
- *stk-- = 0; /* r28 */
- *stk-- = 0; /* r27 */
- *stk-- = 0; /* r26 */
- *stk-- = 0; /* r25 */
- *stk-- = 0; /* r24 */
- *stk-- = 0; /* r23 */
- *stk-- = 0; /* r22 */
- *stk-- = 0; /* r21 */
- *stk-- = 0; /* r20 */
- *stk-- = 0; /* r19 */
- *stk-- = 0; /* r18 */
- *stk-- = 0; /* r17 */
- *stk-- = (unsigned long) texit - 8; /* r15 = task return address*/
- *stk-- = (unsigned long) tentry; /* r14 = entry address*/
- *stk-- = (unsigned long) &_SDA_BASE_; /* r13 */
- *stk-- = 0; /* r12 */
- *stk-- = 0; /* r11 */
- *stk-- = 0; /* r10 */
- *stk-- = 0; /* r09 */
- *stk-- = 0; /* r08 */
- *stk-- = 0; /* r07 */
- *stk-- = 0; /* r06 */
- *stk-- = (unsigned long) parameter; /* r05 */
- *stk-- = 0; /* r04 */
- *stk-- = 0; /* r03 */
- *stk-- = (unsigned long) &_SDA2_BASE_; /* r02 */
- *stk = 2; /* enable interrupt */
- return (rt_uint8_t *) stk;
+ stk = (unsigned long *)stack_addr;
+ stk--;
+ stk--;
+ *stk-- = 0; /* r31 */
+ *stk-- = 0; /* r30 */
+ *stk-- = 0; /* r29 */
+ *stk-- = 0; /* r28 */
+ *stk-- = 0; /* r27 */
+ *stk-- = 0; /* r26 */
+ *stk-- = 0; /* r25 */
+ *stk-- = 0; /* r24 */
+ *stk-- = 0; /* r23 */
+ *stk-- = 0; /* r22 */
+ *stk-- = 0; /* r21 */
+ *stk-- = 0; /* r20 */
+ *stk-- = 0; /* r19 */
+ *stk-- = 0; /* r18 */
+ *stk-- = 0; /* r17 */
+ *stk-- = (unsigned long)texit - 8; /* r15 = task return address*/
+ *stk-- = (unsigned long)tentry; /* r14 = entry address*/
+ *stk-- = (unsigned long)&_SDA_BASE_; /* r13 */
+ *stk-- = 0; /* r12 */
+ *stk-- = 0; /* r11 */
+ *stk-- = 0; /* r10 */
+ *stk-- = 0; /* r09 */
+ *stk-- = 0; /* r08 */
+ *stk-- = 0; /* r07 */
+ *stk-- = 0; /* r06 */
+ *stk-- = (unsigned long) parameter; /* r05 */
+ *stk-- = 0; /* r04 */
+ *stk-- = 0; /* r03 */
+ *stk-- = (unsigned long)&_SDA2_BASE_; /* r02 */
+ *stk = 2; /* enable interrupt */
+ return (rt_uint8_t *)stk;
}