summaryrefslogtreecommitdiff
path: root/libcpu/arm/cortex-a/stack.c
diff options
context:
space:
mode:
authorqz721 <[email protected]>2019-03-25 20:03:49 +0800
committerqz721 <[email protected]>2019-03-25 20:03:49 +0800
commit2eb1bef773e099ac93ec74dba7ec216bdf61597c (patch)
treeacee7a3f45b163e18f29475c6a009795c6d3a146 /libcpu/arm/cortex-a/stack.c
parentefd8b404a3fc6ee8c98b6a735fceaf29fd42c76c (diff)
Make 'qemu-vexpress-a9' and 'imx6ul' use the same libcpu code.
Diffstat (limited to 'libcpu/arm/cortex-a/stack.c')
-rw-r--r--libcpu/arm/cortex-a/stack.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libcpu/arm/cortex-a/stack.c b/libcpu/arm/cortex-a/stack.c
index 1d3ebcb9e6..d76b8a428a 100644
--- a/libcpu/arm/cortex-a/stack.c
+++ b/libcpu/arm/cortex-a/stack.c
@@ -50,13 +50,17 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter,
*(--stk) = 0xdeadbeef; /* r2 */
*(--stk) = 0xdeadbeef; /* r1 */
*(--stk) = (rt_uint32_t)parameter; /* r0 : argument */
-
/* cpsr */
if ((rt_uint32_t)tentry & 0x01)
*(--stk) = SVCMODE | 0x20; /* thumb mode */
else
*(--stk) = SVCMODE; /* arm mode */
+#ifdef RT_USING_LWP
+ *(--stk) = 0; /* user lr */
+ *(--stk) = 0; /* user sp*/
+#endif
+
/* return task's current stack address */
return (rt_uint8_t *)stk;
}