summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/atomic.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-01-17 02:15:11 +0000
committerjhb <jhb@FreeBSD.org>2001-01-17 02:15:11 +0000
commita3a305a2b457f0e59d2ffde35995c5ec456b9267 (patch)
treee265e01cfebacc33291f1980d15397cd2c469603 /sys/amd64/include/atomic.h
parent8f1c684897c1811f47df2e7a6a837d3857243671 (diff)
downloadFreeBSD-src-a3a305a2b457f0e59d2ffde35995c5ec456b9267.zip
FreeBSD-src-a3a305a2b457f0e59d2ffde35995c5ec456b9267.tar.gz
- Sort of lie and say that %eax is an output only and not an input for the
non-386 atomic_load_acq(). %eax is an input since its value is used in the cmpxchg instruction, but we don't care what value it is, so setting it to a specific value is just wasteful. Thus, it is being used without being initialized as the warning stated, but it is ok for it to be used because its value isn't important. Thus, we are only sort of lying when we say it is an output only operand. - Add "cc" to the clobber list for atomic_load_acq() since the cmpxchgl changes ZF.
Diffstat (limited to 'sys/amd64/include/atomic.h')
-rw-r--r--sys/amd64/include/atomic.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h
index 9e72c49..b5035b89e 100644
--- a/sys/amd64/include/atomic.h
+++ b/sys/amd64/include/atomic.h
@@ -182,9 +182,9 @@ atomic_load_acq_##TYPE(volatile u_##TYPE *p) \
u_##TYPE res; \
\
__asm __volatile(MPLOCKED LOP \
- : "+a" (res), /* 0 (result) */\
+ : "=a" (res), /* 0 (result) */\
"+m" (*p) /* 1 */ \
- : : "memory"); \
+ : : "cc", "memory"); \
\
return (res); \
} \
OpenPOWER on IntegriCloud