diff options
| author | Bernard Xiong <[email protected]> | 2019-03-25 21:58:48 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-03-25 21:58:48 +0800 |
| commit | 94e7f7316b0ece92ae1441fb3dd86b3caedb3388 (patch) | |
| tree | 7e7e4457888b509d96bf74312ec5952dc5b7169e /libcpu/arm/cortex-a/stack.c | |
| parent | bc6117b4e5b49bb8a3c50870e89ac439f0d66d06 (diff) | |
| parent | 2eb1bef773e099ac93ec74dba7ec216bdf61597c (diff) | |
Merge pull request #2503 from qz721/libcpu_cortex_a
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.c | 6 |
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; } |
