svn commit: r253891 - in projects/atomic64/sys: amd64/include i386/include
Jung-uk Kim
jkim at FreeBSD.org
Fri Aug 2 18:32:02 UTC 2013
Author: jkim
Date: Fri Aug 2 18:32:01 2013
New Revision: 253891
URL: http://svnweb.freebsd.org/changeset/base/253891
Log:
Allow an immediate for the bit number.
Suggested by:
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 Fri Aug 2 18:05:42 2013 (r253890)
+++ projects/atomic64/sys/amd64/include/atomic.h Fri Aug 2 18:32:01 2013 (r253891)
@@ -225,7 +225,7 @@ atomic_testandset_int(volatile u_int *p,
"# atomic_testandset_int"
: "=r" (res), /* 0 */
"=m" (*p) /* 1 */
- : "r" (v), /* 2 */
+ : "Ir" (v % 32), /* 2 */
"m" (*p) /* 3 */
: "cc");
return (res);
@@ -243,7 +243,7 @@ atomic_testandset_long(volatile u_long *
"# atomic_testandset_long"
: "=r" (res), /* 0 */
"=m" (*p) /* 1 */
- : "r" ((u_long)v), /* 2 */
+ : "Jr" ((u_long)v % 64), /* 2 */
"m" (*p) /* 3 */
: "cc");
return (res);
Modified: projects/atomic64/sys/i386/include/atomic.h
==============================================================================
--- projects/atomic64/sys/i386/include/atomic.h Fri Aug 2 18:05:42 2013 (r253890)
+++ projects/atomic64/sys/i386/include/atomic.h Fri Aug 2 18:32:01 2013 (r253891)
@@ -364,9 +364,9 @@ atomic_testandset_int(volatile u_int *p,
" btsl %2, %1 ; "
" setc %0 ; "
"# atomic_testandset_int"
- : "=r" (res), /* 0 (result) */
+ : "=r" (res), /* 0 */
"=m" (*p) /* 1 */
- : "r" (v), /* 2 */
+ : "Ir" (v % 32), /* 2 */
"m" (*p) /* 3 */
: "cc");
return (res);
More information about the svn-src-projects
mailing list