From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 6/9] tools: memshr: arm64 support Date: Fri, 15 Mar 2013 14:35:42 +0000 Message-ID: <1363358142.520.29.camel@zakaz.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andres Lagar-Cavilla Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Fri, 2013-03-15 at 14:30 +0000, Andres Lagar-Cavilla wrote: > > I'm not mad keen on propagating these sorts of asm atomic operations > > throughout > > our code base. Other options would be: > > > gcc has atomic builtins to do this kind of work. I don't know about > arm, but they do the job in x86 > http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Atomic-Builtins.html > so atomic_inc(val) -> __sync_fetch_and_add(val, 1) and likewise for > dec/sub Yes, that might be a suitable replacement, assuming they exist (and work right) in all the x86 gcc's we support (not sure how far back that is) I suppose I could use the builtins on ARM only in the meantime. Thanks! Ian.