summaryrefslogtreecommitdiffstats
path: root/sys/arm/include/atomic.h
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-02-02 00:48:15 +0000
committerian <ian@FreeBSD.org>2014-02-02 00:48:15 +0000
commit734d68c62464e8dd39078271c026027f204ed144 (patch)
treed2d882fb3da5505bc3b87888e43c11065d6c3dad /sys/arm/include/atomic.h
parent336383e796fb53dd2e812fe72ff6e12721816bb9 (diff)
downloadFreeBSD-src-734d68c62464e8dd39078271c026027f204ed144.zip
FreeBSD-src-734d68c62464e8dd39078271c026027f204ed144.tar.gz
Update all arm code that manipulates the PSR registers to use modern syntax.
It turns out the version of gas we're using interprets the old '_all' mask as 'fc' instead of 'fsxc'. That is, "all" doesn't really mean "all". This was the cause of the "wrong-endian register restore" bug that's been causing problems with some cortex-a9 chips. The 'endian' bit in the spsr register would never get changed (it falls into the 'x' mask group) and the first return-from-exception would fail if the chip had powered on with garbage in the spsr register that included the big-endian bit. It's unknown why this affected only certain cortex-a9 chips.
Diffstat (limited to 'sys/arm/include/atomic.h')
-rw-r--r--sys/arm/include/atomic.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arm/include/atomic.h b/sys/arm/include/atomic.h
index 0db31c7..d168498 100644
--- a/sys/arm/include/atomic.h
+++ b/sys/arm/include/atomic.h
@@ -450,13 +450,13 @@ atomic_store_rel_long(volatile u_long *p, u_long v)
__asm __volatile( \
"mrs %0, cpsr;" \
"orr %1, %0, %2;" \
- "msr cpsr_all, %1;" \
+ "msr cpsr_fsxc, %1;" \
: "=r" (cpsr_save), "=r" (tmp) \
: "I" (I32_bit | F32_bit) \
: "cc" ); \
(expr); \
__asm __volatile( \
- "msr cpsr_all, %0" \
+ "msr cpsr_fsxc, %0" \
: /* no output */ \
: "r" (cpsr_save) \
: "cc" ); \
OpenPOWER on IntegriCloud