From 7222d2fbee14b5d0f8d001da2e16179a41291a6a Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sat, 18 Dec 2010 16:41:11 +0000 Subject: Inform a compiler which asm statements in the x86 implementation of atomics change eflags. Reviewed by: jhb MFC after: 2 weeks --- sys/amd64/include/atomic.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'sys/amd64/include') 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); \ } \ -- cgit v1.2.3