Re: [Xen-devel] [PATCHv4 1/5] x86: provide add_sized()

2015-05-13 Thread Jan Beulich
>>> On 13.05.15 at 11:35, wrote: > On 13/05/15 10:23, Jan Beulich wrote: > On 11.05.15 at 16:37, wrote: >>> @@ -53,6 +67,19 @@ void __bad_atomic_size(void); >>> } \ >>> }) >>> >>> +#define add_sized(p, x) ({

Re: [Xen-devel] [PATCHv4 1/5] x86: provide add_sized()

2015-05-13 Thread David Vrabel
On 13/05/15 10:23, Jan Beulich wrote: On 11.05.15 at 16:37, wrote: >> @@ -53,6 +67,19 @@ void __bad_atomic_size(void); >> } \ >> }) >> >> +#define add_sized(p, x) ({\ >> +typeof(*(p)) __x = (x);

Re: [Xen-devel] [PATCHv4 1/5] x86: provide add_sized()

2015-05-13 Thread Jan Beulich
>>> On 11.05.15 at 16:37, wrote: > @@ -53,6 +67,19 @@ void __bad_atomic_size(void); > } \ > }) > > +#define add_sized(p, x) ({\ > +typeof(*(p)) __x = (x); \ > +unsigned

[Xen-devel] [PATCHv4 1/5] x86: provide add_sized()

2015-05-11 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