x86: provide add_sized()
authorDavid Vrabel <david.vrabel@citrix.com>
Wed, 13 May 2015 13:00:58 +0000 (15:00 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 13 May 2015 13:00:58 +0000 (15:00 +0200)
commit3c694aec08dda782d9c866e599b848dff86f474f
tree8cc9020e1a3f519401024003002a7fed693420e6
parentf48218fd2d35e274ef58caee889aecd6610c8cb6
x86: provide add_sized()

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 <david.vrabel@citrix.com>
xen/include/asm-x86/atomic.h