arm: asm/system.h: mrc and mcr need .arm if __thumb2__ is not set
authorJerome Forissier <jerome.forissier@linaro.org>
Fri, 4 Apr 2025 13:50:35 +0000 (15:50 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 14 Apr 2025 14:59:39 +0000 (08:59 -0600)
commit6fe50e39508043f386fc1bd40bbc02b8a75c1940
tree0aac1d9565fef925db1e0610a5399ee33a747f76
parentd08653d3699c1aafada3418c9f74b887bfb21a65
arm: asm/system.h: mrc and mcr need .arm if __thumb2__ is not set

The mcr and msr instructions are available in Thumb mode only if
Thumb2 is supported. Therefore, if __thumb2__ is not set, make
sure we switch to ARM mode by inserting a .arm directive in the
inline assembly.

Fixes LTO link errors with kirkwood platforms, triggered by a later
commit:

 tools/buildman/buildman -o /tmp/build -eP sheevaplug
 [...]
 {standard input}:24085: Error: selected processor does not support `mrc p15,0,r3,c1,c0,0' in Thumb mode

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
arch/arm/include/asm/system.h
arch/arm/lib/cache.c
arch/arm/mach-kirkwood/include/mach/cpu.h