From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 01/15] atomic: introduce atomic operations Date: Wed, 08 Aug 2012 12:02:29 +0300 Message-ID: <50222B25.7080404@redhat.com> References: <1344407156-25562-1-git-send-email-qemulist@gmail.com> <1344407156-25562-2-git-send-email-qemulist@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Anthony Liguori , Jan Kiszka , Marcelo Tosatti , Stefan Hajnoczi , Paolo Bonzini , Blue Swirl , =?ISO-8859-1?Q?Andreas_F=E4rber?= To: Liu Ping Fan Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44106 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932460Ab2HHJCl (ORCPT ); Wed, 8 Aug 2012 05:02:41 -0400 In-Reply-To: <1344407156-25562-2-git-send-email-qemulist@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/08/2012 09:25 AM, Liu Ping Fan wrote: > From: Liu Ping Fan > > If out of global lock, we will be challenged by SMP in low level, > so need atomic ops. > > This file is heavily copied from kernel. Currently, only x86 atomic ops > included, and will be extended for other arch for future. > I propose we use gcc builtins. We get automatic architecture support, and tuning for newer processors if the user so chooses. http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html In May 2031 we can switch to C11 atomics. -- error compiling committee.c: too many arguments to function