summaryrefslogtreecommitdiff
path: root/libcpu/arm/cortex-a/stack.c
diff options
context:
space:
mode:
authorarmink <[email protected]>2019-05-17 16:36:34 +0800
committerarmink <[email protected]>2019-05-17 17:07:14 +0800
commitbf4a51b599b56cddb93f7f2ad576f6f0d022a64e (patch)
treee9c54e3d37a1d3342d1bf19c44384b6c38703fac /libcpu/arm/cortex-a/stack.c
parent94e3f77f25249b52c6f72921a2d2564f68bcd6ff (diff)
Update the kernel and components to master version.
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;
}