Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757461AbZGCSJm (ORCPT ); Fri, 3 Jul 2009 14:09:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753897AbZGCSJe (ORCPT ); Fri, 3 Jul 2009 14:09:34 -0400 Received: from casper.infradead.org ([85.118.1.10]:38417 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751509AbZGCSJe (ORCPT ); Fri, 3 Jul 2009 14:09:34 -0400 Date: Fri, 3 Jul 2009 11:10:33 -0700 From: Arjan van de Ven To: Ingo Molnar Cc: Eric Dumazet , Linus Torvalds , mingo@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH -tip] x86: atomic64: inline atomic64_read() Message-ID: <20090703111033.6e9627de@infradead.org> In-Reply-To: <20090703180450.GB3405@elte.hu> References: <4A4E1AA2.30002@gmail.com> <20090703180450.GB3405@elte.hu> Organization: Intel X-Mailer: Claws Mail 3.7.1 (GTK+ 2.14.7; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 641 Lines: 19 On Fri, 3 Jul 2009 20:04:50 +0200 Ingo Molnar wrote: > > +static inline u64 atomic64_read(atomic64_t *ptr) > > +{ > > + u64 res; > > + > > + asm volatile( > > + "mov %%ebx, %%eax\n\t" > > + "mov %%ecx, %%edx\n\t" > > + LOCK_PREFIX "cmpxchg8b %1\n" also afaik cmpxchg implies the lock prefix, so no need to make an explicit one... it just adds code size and alternatives-work -- 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/