From 324fffaed1781a2edbb7953c56966badafa0492c Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 17 Jan 2001 02:15:11 +0000 Subject: - 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. --- sys/amd64/include/atomic.h | 4 ++-- sys/i386/include/atomic.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sys') diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h index 9e72c49b6097..b5035b89e4d4 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); \ } \ diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h index 9e72c49b6097..b5035b89e4d4 100644 --- a/sys/i386/include/atomic.h +++ b/sys/i386/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); \ } \ -- cgit v1.3