Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Mar 2021 01:23:44 GMT
From:      Brandon Bergren <bdragon@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 895a22583df2 - main - [PowerPC] Fix ISA_206 subword atomics
Message-ID:  <202103310123.12V1NiMc055346@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by bdragon:

URL: https://cgit.FreeBSD.org/src/commit/?id=895a22583df2524e144571430112df6e14ae8d66

commit 895a22583df2524e144571430112df6e14ae8d66
Author:     Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2020-12-08 16:18:44 +0000
Commit:     Brandon Bergren <bdragon@FreeBSD.org>
CommitDate: 2021-03-31 01:23:04 +0000

    [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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103310123.12V1NiMc055346>