Make 'qemu-vexpress-a9' and 'imx6ul' use the same libcpu code.

This commit is contained in:
qz721
2019-03-25 20:03:49 +08:00
parent efd8b404a3
commit 2eb1bef773
47 changed files with 1228 additions and 2957 deletions

View File

@@ -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;
}