mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-01-22 01:30:35 -05:00
arm: fix start_thread() on Cortex-M targets
The layout of 'struct regs' is a bit different on Cortex-M and start_thread() wasn't updated to match; it was loading 'sp' from the wrong offset. Change-Id: I57dbef26809821d411dc86e2066a2f53e78a3f2d
This commit is contained in:
parent
19a49220b1
commit
cb9094dabb
1 changed files with 4 additions and 0 deletions
|
|
@ -29,7 +29,11 @@ static void __attribute__((naked)) USED_ATTR start_thread(void)
|
|||
{
|
||||
/* r0 = context */
|
||||
asm volatile (
|
||||
#if defined(CPU_ARM_MICRO) && ARCH_VERSION >= 7
|
||||
"ldr sp, [r0, #36] \n" /* Load initial sp */
|
||||
#else
|
||||
"ldr sp, [r0, #32] \n" /* Load initial sp */
|
||||
#endif
|
||||
"ldr r4, [r0, #40] \n" /* start in r4 since it's non-volatile */
|
||||
"mov r1, #0 \n" /* Mark thread as running */
|
||||
"str r1, [r0, #40] \n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue