diff options
author | Justin Hibbits <jhibbits@FreeBSD.org> | 2020-12-08 16:18:44 +0000 |
---|---|---|
committer | Brandon Bergren <bdragon@FreeBSD.org> | 2021-03-31 01:23:04 +0000 |
commit | 895a22583df2524e144571430112df6e14ae8d66 (patch) | |
tree | 61c2c8775e9dc54a8c6bf50010c87df56761b4df | |
parent | 8dc8feb53da0c1a2301cb21c87b17a09d12e8fa7 (diff) | |
download | src-895a22583df2524e144571430112df6e14ae8d66.tar.gz src-895a22583df2524e144571430112df6e14ae8d66.zip |
[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.
-rw-r--r-- | sys/powerpc/include/atomic.h | 4 |
1 files 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) |