diff options
author | jkim <jkim@FreeBSD.org> | 2013-08-21 21:30:06 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2013-08-21 21:30:06 +0000 |
commit | a0c0cc666e2c63f47c8d9dbf63c256d26e646579 (patch) | |
tree | 68085be00345a34698e2e16178f5f0c81608e342 | |
parent | 8c10ae99f831cad18194c571d5e44e22bb1001cd (diff) | |
download | FreeBSD-src-a0c0cc666e2c63f47c8d9dbf63c256d26e646579.zip FreeBSD-src-a0c0cc666e2c63f47c8d9dbf63c256d26e646579.tar.gz |
- Remove the "a" constraint from main output operand for atomic_cmpset().
- Use "+" modifier for the "expect" because it is also an output (unused).
-rw-r--r-- | sys/amd64/include/atomic.h | 20 | ||||
-rw-r--r-- | sys/i386/include/atomic.h | 10 |
2 files changed, 15 insertions, 15 deletions
diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h index 11e7b57..7d8d839 100644 --- a/sys/amd64/include/atomic.h +++ b/sys/amd64/include/atomic.h @@ -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); diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h index 722aca4..f782295 100644 --- a/sys/i386/include/atomic.h +++ b/sys/i386/include/atomic.h @@ -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); |