svn commit: r253872 - in projects/atomic64/sys: amd64/include i386/include
Jung-uk Kim
jkim at FreeBSD.org
Thu Aug 1 23:20:33 UTC 2013
Author: jkim
Date: Thu Aug 1 23:20:31 2013
New Revision: 253872
URL: http://svnweb.freebsd.org/changeset/base/253872
Log:
Allow any register to be used for the return value.
Modified:
projects/atomic64/sys/amd64/include/atomic.h
projects/atomic64/sys/i386/include/atomic.h
Modified: projects/atomic64/sys/amd64/include/atomic.h
==============================================================================
--- projects/atomic64/sys/amd64/include/atomic.h Thu Aug 1 23:02:36 2013 (r253871)
+++ projects/atomic64/sys/amd64/include/atomic.h Thu Aug 1 23:20:31 2013 (r253872)
@@ -138,14 +138,13 @@ atomic_cmpset_int(volatile u_int *dst, u
__asm __volatile(
" " MPLOCKED " "
- " cmpxchgl %2,%1 ; "
+ " cmpxchgl %3, %1 ; "
" sete %0 ; "
- "1: "
"# atomic_cmpset_int"
- : "=a" (res), /* 0 */
- "=m" (*dst) /* 1 */
- : "r" (src), /* 2 */
- "a" (expect), /* 3 */
+ : "=r" (res), /* 0 */
+ "=m" (*dst), /* 1 */
+ "+a" (expect) /* 2 */
+ : "r" (src), /* 3 */
"m" (*dst) /* 4 */
: "memory", "cc");
@@ -159,14 +158,13 @@ atomic_cmpset_long(volatile u_long *dst,
__asm __volatile(
" " MPLOCKED " "
- " cmpxchgq %2,%1 ; "
+ " cmpxchgq %3, %1 ; "
" sete %0 ; "
- "1: "
"# atomic_cmpset_long"
- : "=a" (res), /* 0 */
- "=m" (*dst) /* 1 */
- : "r" (src), /* 2 */
- "a" (expect), /* 3 */
+ : "=r" (res), /* 0 */
+ "=m" (*dst), /* 1 */
+ "+a" (expect) /* 2 */
+ : "r" (src), /* 3 */
"m" (*dst) /* 4 */
: "memory", "cc");
Modified: projects/atomic64/sys/i386/include/atomic.h
==============================================================================
--- projects/atomic64/sys/i386/include/atomic.h Thu Aug 1 23:02:36 2013 (r253871)
+++ projects/atomic64/sys/i386/include/atomic.h Thu Aug 1 23:20:31 2013 (r253872)
@@ -246,14 +246,13 @@ atomic_cmpset_int(volatile u_int *dst, u
__asm __volatile(
" " MPLOCKED " "
- " cmpxchgl %2,%1 ; "
- " sete %0 ; "
- "1: "
+ " cmpxchgl %3, %1 ; "
+ " sete %0 ; "
"# atomic_cmpset_int"
- : "=a" (res), /* 0 */
- "=m" (*dst) /* 1 */
- : "r" (src), /* 2 */
- "a" (expect), /* 3 */
+ : "=r" (res), /* 0 */
+ "=m" (*dst), /* 1 */
+ "+a" (expect) /* 2 */
+ : "r" (src), /* 3 */
"m" (*dst) /* 4 */
: "memory", "cc");
More information about the svn-src-projects
mailing list