A modern, network-enabled music player platform built on Rockbox technology. rockboxd.tsiry-sandratraina.com
rust deno navidrome airplay libadwaita zig mpris snapcast mpd rockbox audio subsonic
2

Configure Feed

Select the types of activity you want to include in your feed.

libsetjmp: fix unpredictable behavior warning on ARM Cortex-M

GAS warns about unpredictable behavior of "ldr sp, [a1], #4"
that exists on Cortex-M3 (errata 752419) but this warning is
incorrectly issued on other cores too (eg, Cortex-M7).

Since the fix is just one extra instruction we may as well
apply the workaround for all Cortex-M targets.

Change-Id: I0c2aa46837f776d67d0236b627af1572aa5ab307

+12 -1
+12 -1
lib/libsetjmp/arm/setjmp.S
··· 151 151 /* Restore the registers, retrieving the state when setjmp() was called. */ 152 152 #ifdef __thumb2__ 153 153 ldmfd a1!, { v1-v7, fp, ip, lr } 154 - ldr sp, [a1],#+4 154 + #if __ARM_ARCH_PROFILE == 'M' 155 + /* 156 + * Errata 752419: Interrupted loads to SP can cause erroneous behaviour 157 + * Apply the suggested workaround of loading to an intermediate register 158 + * and then moving into sp. This only affects Cortex-M3 but a warning is 159 + * issued by the assembler for all armv7-m targets with binutils 2.38. 160 + */ 161 + ldr a3, [a1], #4 162 + mov sp, a3 163 + #else 164 + ldr sp, [a1], #4 165 + #endif 155 166 #else 156 167 ldmfd a1!, { v1-v7, fp, ip, sp, lr } 157 168 #endif