>>> 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) ({
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);
>>> 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
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