- Remove the "a" constraint from main output operand for atomic_cmpset().

- Use "+" modifier for the "expect" because it is also an output (unused).
This commit is contained in:
Jung-uk Kim 2013-08-21 21:30:06 +00:00
parent fe94be3da7
commit da255e4c7f
2 changed files with 15 additions and 15 deletions

View File

@ -138,13 +138,13 @@ atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src)
__asm __volatile(
" " MPLOCKED " "
" cmpxchgl %2,%1 ; "
" cmpxchgl %3,%1 ; "
" sete %0 ; "
"# atomic_cmpset_int"
: "=a" (res), /* 0 */
"+m" (*dst) /* 1 */
: "r" (src), /* 2 */
"a" (expect) /* 3 */
: "=q" (res), /* 0 */
"+m" (*dst), /* 1 */
"+a" (expect) /* 2 */
: "r" (src) /* 3 */
: "memory", "cc");
return (res);
@ -157,13 +157,13 @@ atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src)
__asm __volatile(
" " MPLOCKED " "
" cmpxchgq %2,%1 ; "
" cmpxchgq %3,%1 ; "
" sete %0 ; "
"# atomic_cmpset_long"
: "=a" (res), /* 0 */
"+m" (*dst) /* 1 */
: "r" (src), /* 2 */
"a" (expect) /* 3 */
: "=q" (res), /* 0 */
"+m" (*dst), /* 1 */
"+a" (expect) /* 2 */
: "r" (src) /* 3 */
: "memory", "cc");
return (res);

View File

@ -243,13 +243,13 @@ atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src)
__asm __volatile(
" " MPLOCKED " "
" cmpxchgl %2,%1 ; "
" cmpxchgl %3,%1 ; "
" sete %0 ; "
"# atomic_cmpset_int"
: "=a" (res), /* 0 */
"+m" (*dst) /* 1 */
: "r" (src), /* 2 */
"a" (expect) /* 3 */
: "=q" (res), /* 0 */
"+m" (*dst), /* 1 */
"+a" (expect) /* 2 */
: "r" (src) /* 3 */
: "memory", "cc");
return (res);