summaryrefslogtreecommitdiff
path: root/firmware/asm/arm/thread.c
diff options
context:
space:
mode:
authorChris Chua <someone42@gmail.com>2023-03-19 06:22:08 +1100
committerAidan MacDonald <amachronic@protonmail.com>2023-03-23 13:28:22 -0400
commit86429dbf1eca8ee0e08176997f508647c3abf6bd (patch)
tree4d35e56e338a326d1a04c8d1f620821fa7909678 /firmware/asm/arm/thread.c
parenta64cad847e7d24dc4d01d5ab22f6c8dc42f960ae (diff)
downloadrockbox-86429dbf1eca8ee0e08176997f508647c3abf6bd.tar.gz
rockbox-86429dbf1eca8ee0e08176997f508647c3abf6bd.zip
Using ARM Unified Assembler Language
Change-Id: Iae32a8ba8eff6087330e458fafc912a12fee4509
Diffstat (limited to 'firmware/asm/arm/thread.c')
-rw-r--r--firmware/asm/arm/thread.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/firmware/asm/arm/thread.c b/firmware/asm/arm/thread.c
index cf685526e3..bd9f950616 100644
--- a/firmware/asm/arm/thread.c
+++ b/firmware/asm/arm/thread.c
@@ -73,15 +73,16 @@ static inline void store_context(void* addr)
73static inline void load_context(const void* addr) 73static inline void load_context(const void* addr)
74{ 74{
75 asm volatile( 75 asm volatile(
76 ".syntax unified \n"
76 "ldr r0, [%0, #40] \n" /* Load start pointer */ 77 "ldr r0, [%0, #40] \n" /* Load start pointer */
77 "cmp r0, #0 \n" /* Check for NULL */ 78 "cmp r0, #0 \n" /* Check for NULL */
78 79
79 /* If not already running, jump to start */ 80 /* If not already running, jump to start */
80#if ARM_ARCH == 4 && defined(USE_THUMB) 81#if ARM_ARCH == 4 && defined(USE_THUMB)
81 "ldmneia %0, { r0, r12 } \n" 82 "ldmiane %0, { r0, r12 } \n"
82 "bxne r12 \n" 83 "bxne r12 \n"
83#else 84#else
84 "ldmneia %0, { r0, pc } \n" 85 "ldmiane %0, { r0, pc } \n"
85#endif 86#endif
86 87
87 "ldmia %0, { r4-r11, sp, lr } \n" /* Load regs r4 to r14 from context */ 88 "ldmia %0, { r4-r11, sp, lr } \n" /* Load regs r4 to r14 from context */