aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/include
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2010-12-18 16:41:11 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2010-12-18 16:41:11 +0000
commit7222d2fbee14b5d0f8d001da2e16179a41291a6a (patch)
treed74a63bd817d119fcbb58d3f72ab833effed0566 /sys/amd64/include
parentf015cb7882f8c2236ba0d77fa7a464690c3ccf3d (diff)
downloadsrc-7222d2fbee14b5d0f8d001da2e16179a41291a6a.tar.gz
src-7222d2fbee14b5d0f8d001da2e16179a41291a6a.zip
Inform a compiler which asm statements in the x86 implementation of
atomics change eflags. Reviewed by: jhb MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=216524
Diffstat (limited to 'sys/amd64/include')
-rw-r--r--sys/amd64/include/atomic.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h
index bcf61f9f4155..e167b54f979e 100644
--- a/sys/amd64/include/atomic.h
+++ b/sys/amd64/include/atomic.h
@@ -108,7 +108,8 @@ atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
{ \
__asm __volatile(MPLOCKED OP \
: "=m" (*p) \
- : CONS (V), "m" (*p)); \
+ : CONS (V), "m" (*p) \
+ : "cc"); \
} \
\
static __inline void \
@@ -117,7 +118,7 @@ atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
__asm __volatile(MPLOCKED OP \
: "=m" (*p) \
: CONS (V), "m" (*p) \
- : "memory"); \
+ : "memory", "cc"); \
} \
struct __hack
@@ -145,7 +146,7 @@ atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src)
: "r" (src), /* 2 */
"a" (expect), /* 3 */
"m" (*dst) /* 4 */
- : "memory");
+ : "memory", "cc");
return (res);
}
@@ -166,7 +167,7 @@ atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src)
: "r" (src), /* 2 */
"a" (expect), /* 3 */
"m" (*dst) /* 4 */
- : "memory");
+ : "memory", "cc");
return (res);
}
@@ -185,8 +186,8 @@ atomic_fetchadd_int(volatile u_int *p, u_int v)
"# atomic_fetchadd_int"
: "+r" (v), /* 0 (result) */
"=m" (*p) /* 1 */
- : "m" (*p)); /* 2 */
-
+ : "m" (*p) /* 2 */
+ : "cc");
return (v);
}
@@ -204,8 +205,8 @@ atomic_fetchadd_long(volatile u_long *p, u_long v)
"# atomic_fetchadd_long"
: "+r" (v), /* 0 (result) */
"=m" (*p) /* 1 */
- : "m" (*p)); /* 2 */
-
+ : "m" (*p) /* 2 */
+ : "cc");
return (v);
}
@@ -249,7 +250,7 @@ atomic_load_acq_##TYPE(volatile u_##TYPE *p) \
: "=a" (res), /* 0 */ \
"=m" (*p) /* 1 */ \
: "m" (*p) /* 2 */ \
- : "memory"); \
+ : "memory", "cc"); \
\
return (res); \
} \