Re: [Xen-devel] [PATCHv4 1/8] x86: provide arch_fetch_and_add()

2015-05-07 Thread Jan Beulich
>>> On 30.04.15 at 17:33, wrote: > +static always_inline unsigned long __xadd( > +volatile void *ptr, unsigned long v, int size) > +{ > +switch ( size ) > +{ > +case 1: > +asm volatile ( "lock; xaddb %b0,%1" > + : "+r" (v), "+m" (*__xg((volatile void *

[Xen-devel] [PATCHv4 1/8] x86: provide arch_fetch_and_add()

2015-04-30 Thread David Vrabel
arch_fetch_and_add() atomically adds a value and returns the previous value. This is needed to implement ticket locks. Signed-off-by: David Vrabel --- xen/include/asm-x86/system.h | 48 ++ 1 file changed, 48 insertions(+) diff --git a/xen/include/asm-x