From 895a22583df2524e144571430112df6e14ae8d66 Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Tue, 8 Dec 2020 10:18:44 -0600 Subject: [PATCH] [PowerPC] Fix ISA_206 subword atomics The POWER7 subword atomics were not using the correct instructions for byte and halfword stores in the atomic_fcmpset code. This only affects builds with custom CFLAGS that have explicitly enabled ISA_206_ATOMICS. --- sys/powerpc/include/atomic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/include/atomic.h b/sys/powerpc/include/atomic.h index aa03165de46c..0b383a4ebdf6 100644 --- a/sys/powerpc/include/atomic.h +++ b/sys/powerpc/include/atomic.h @@ -777,7 +777,7 @@ atomic_fcmpset_char(volatile u_char *p, u_char *cmpval, u_char newval) "b 2f\n\t" /* we've succeeded */ "1:\n\t" "stbcx. %0, 0, %3\n\t" /* clear reservation (74xx) */ - "stwx %0, 0, %7\n\t" + "stbx %0, 0, %7\n\t" "li %0, 0\n\t" /* failure - retval = 0 */ "2:\n\t" : "=&r" (ret), "=m" (*p), "=m" (*cmpval) @@ -802,7 +802,7 @@ atomic_fcmpset_short(volatile u_short *p, u_short *cmpval, u_short newval) "b 2f\n\t" /* we've succeeded */ "1:\n\t" "sthcx. %0, 0, %3\n\t" /* clear reservation (74xx) */ - "stwx %0, 0, %7\n\t" + "sthx %0, 0, %7\n\t" "li %0, 0\n\t" /* failure - retval = 0 */ "2:\n\t" : "=&r" (ret), "=m" (*p), "=m" (*cmpval)