svn commit: r312978 - head/sys/powerpc/include
Justin Hibbits
jhibbits at FreeBSD.org
Mon Jan 30 02:52:17 UTC 2017
Author: jhibbits
Date: Mon Jan 30 02:52:15 2017
New Revision: 312978
URL: https://svnweb.freebsd.org/changeset/base/312978
Log:
Drop the __GNUCLIKE_ASM guards around most atomic inlines.
There are no alternatives defined, so there's no point in keeping them. Also,
they weren't around every inline asm block anyway. Without __GNUCLIKE_ASM
defined, the guarded functions return garbage.
Reported by: Andrew Thompson
Modified:
head/sys/powerpc/include/atomic.h
Modified: head/sys/powerpc/include/atomic.h
==============================================================================
--- head/sys/powerpc/include/atomic.h Mon Jan 30 02:32:33 2017 (r312977)
+++ head/sys/powerpc/include/atomic.h Mon Jan 30 02:52:15 2017 (r312978)
@@ -446,7 +446,6 @@ atomic_readandclear_int(volatile u_int *
{
u_int result,temp;
-#ifdef __GNUCLIKE_ASM
__asm __volatile (
"\tsync\n" /* drain writes */
"1:\tlwarx %0, 0, %3\n\t" /* load old value */
@@ -456,7 +455,6 @@ atomic_readandclear_int(volatile u_int *
: "=&r"(result), "=&r"(temp), "=m" (*addr)
: "r" (addr), "m" (*addr)
: "cr0", "memory");
-#endif
return (result);
}
@@ -467,7 +465,6 @@ atomic_readandclear_long(volatile u_long
{
u_long result,temp;
-#ifdef __GNUCLIKE_ASM
__asm __volatile (
"\tsync\n" /* drain writes */
"1:\tldarx %0, 0, %3\n\t" /* load old value */
@@ -477,7 +474,6 @@ atomic_readandclear_long(volatile u_long
: "=&r"(result), "=&r"(temp), "=m" (*addr)
: "r" (addr), "m" (*addr)
: "cr0", "memory");
-#endif
return (result);
}
@@ -565,7 +561,6 @@ atomic_cmpset_int(volatile u_int* p, u_i
{
int ret;
-#ifdef __GNUCLIKE_ASM
__asm __volatile (
"1:\tlwarx %0, 0, %2\n\t" /* load old value */
"cmplw %3, %0\n\t" /* compare */
@@ -581,7 +576,6 @@ atomic_cmpset_int(volatile u_int* p, u_i
: "=&r" (ret), "=m" (*p)
: "r" (p), "r" (cmpval), "r" (newval), "m" (*p)
: "cr0", "memory");
-#endif
return (ret);
}
@@ -590,7 +584,6 @@ atomic_cmpset_long(volatile u_long* p, u
{
int ret;
-#ifdef __GNUCLIKE_ASM
__asm __volatile (
#ifdef __powerpc64__
"1:\tldarx %0, 0, %2\n\t" /* load old value */
@@ -617,7 +610,6 @@ atomic_cmpset_long(volatile u_long* p, u
: "=&r" (ret), "=m" (*p)
: "r" (p), "r" (cmpval), "r" (newval), "m" (*p)
: "cr0", "memory");
-#endif
return (ret);
}
@@ -685,7 +677,6 @@ atomic_fcmpset_int(volatile u_int *p, u_
{
int ret;
-#ifdef __GNUCLIKE_ASM
__asm __volatile (
"1:\tlwarx %0, 0, %3\n\t" /* load old value */
"cmplw %4, %0\n\t" /* compare */
@@ -702,7 +693,6 @@ atomic_fcmpset_int(volatile u_int *p, u_
: "=&r" (ret), "=m" (*p), "=m" (*cmpval)
: "r" (p), "r" (*cmpval), "r" (newval), "m" (*p), "r"(cmpval)
: "cr0", "memory");
-#endif
return (ret);
}
@@ -711,7 +701,6 @@ atomic_fcmpset_long(volatile u_long *p,
{
int ret;
-#ifdef __GNUCLIKE_ASM
__asm __volatile (
#ifdef __powerpc64__
"1:\tldarx %0, 0, %3\n\t" /* load old value */
@@ -740,7 +729,6 @@ atomic_fcmpset_long(volatile u_long *p,
: "=&r" (ret), "=m" (*p), "=m" (*cmpval)
: "r" (p), "r" (*cmpval), "r" (newval), "m" (*p), "r"(cmpval)
: "cr0", "memory");
-#endif
return (ret);
}
More information about the svn-src-head
mailing list