Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753765AbZDGLT5 (ORCPT ); Tue, 7 Apr 2009 07:19:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752096AbZDGLTs (ORCPT ); Tue, 7 Apr 2009 07:19:48 -0400 Received: from bilbo.ozlabs.org ([203.10.76.25]:56362 "EHLO bilbo.ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751911AbZDGLTr (ORCPT ); Tue, 7 Apr 2009 07:19:47 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18907.14029.301492.493938@cargo.ozlabs.ibm.com> Date: Tue, 7 Apr 2009 21:19:41 +1000 From: Paul Mackerras To: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, tglx@linutronix.de, mingo@elte.hu Cc: linux-tip-commits@vger.kernel.org Subject: Re: [tip:perfcounters/core] x86, perfcounters: add atomic64_xchg() In-Reply-To: References: <20090406094518.445450972@chello.nl> X-Mailer: VM 8.0.9 under Emacs 22.2.1 (i486-pc-linux-gnu) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1248 Lines: 36 Ingo Molnar writes: > Complete atomic64_t support on the 32-bit side by adding atomic64_xch(). > > Cc: Peter Zijlstra > LKML-Reference: <20090406094518.445450972@chello.nl> > Signed-off-by: Ingo Molnar > > > --- > arch/x86/include/asm/atomic_32.h | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/include/asm/atomic_32.h b/arch/x86/include/asm/atomic_32.h > index 977250e..a9fef6c 100644 > --- a/arch/x86/include/asm/atomic_32.h > +++ b/arch/x86/include/asm/atomic_32.h > @@ -306,6 +306,12 @@ static inline void atomic64_set(atomic64_t *ptr, unsigned long long new_val) > } while (atomic64_cmpxchg(ptr, old_val, new_val) != old_val); > } > > +static inline void > +atomic64_xchg(atomic64_t *ptr, unsigned long long new_val) > +{ > + atomic64_set(ptr, new_val); > +} Umm, I don't know much about x86, but that doesn't look like an exchange operation to me... Shouldn't it return a value, for a start? Paul. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/