From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2SDi-0005t2-7p for qemu-devel@nongnu.org; Thu, 15 Apr 2010 12:47:14 -0400 Received: from [140.186.70.92] (port=48250 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2SDg-0005qT-6c for qemu-devel@nongnu.org; Thu, 15 Apr 2010 12:47:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2SDd-0005sZ-R4 for qemu-devel@nongnu.org; Thu, 15 Apr 2010 12:47:11 -0400 Received: from mail-pz0-f204.google.com ([209.85.222.204]:38490) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2SDd-0005sB-BO for qemu-devel@nongnu.org; Thu, 15 Apr 2010 12:47:09 -0400 Received: by pzk42 with SMTP id 42so1250542pzk.4 for ; Thu, 15 Apr 2010 09:47:08 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4BC64AD6.6040209@redhat.com> References: <1271238922-10008-1-git-send-email-kraxel@redhat.com> <1271238922-10008-9-git-send-email-kraxel@redhat.com> <4BC64AD6.6040209@redhat.com> Date: Thu, 15 Apr 2010 19:47:07 +0300 Message-ID: From: Blue Swirl Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] Re: [RfC PATCH 08/11] spice: add qxl device List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Gerd Hoffmann , qemu-devel@nongnu.org On 4/15/10, Paolo Bonzini wrote: > On 04/14/2010 06:52 PM, Blue Swirl wrote: > > > On 4/14/10, Gerd Hoffmann wrote: > > > > > +static inline void atomic_or(uint32_t *var, uint32_t add) > > > +{ > > > + __asm__ __volatile__ ("lock; orl %1, %0" : "+m" (*var) : "r" (add) > : "memory"); > > > +} > > > > > > > This will break on non-x86 hosts. > > > > I'd just use __sync_fetch_and_or here. And on environments without __sync_fetch_and_or? Where is that available?