Re: [Xen-devel] [PATCHv4 3/8] x86: provide add_sized()

2015-05-07 Thread Jan Beulich
>>> On 30.04.15 at 17:33, wrote: > @@ -55,6 +69,20 @@ void __bad_atomic_size(void); > __x;\ > }) > > +#define add_sized(p, x) ({ \ > +typeof(*(p)) __x = (x);

[Xen-devel] [PATCHv4 3/8] x86: provide add_sized()

2015-04-30 Thread David Vrabel
add_sized(ptr, inc) adds inc to the value at ptr using only the correct size of loads and stores for the type of *ptr. The add is /not/ atomic. This is needed for ticket locks to ensure the increment of the head ticket does not affect the tail ticket. Signed-off-by: David Vrabel --- xen/includ