diff options
author | Tony Luck <tony.luck@intel.com> | 2008-10-17 13:51:28 -0700 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-10-17 13:51:28 -0700 |
commit | 22ca532a4d137545244fdff0b687325fd4e13eae (patch) | |
tree | 459f5116344c71d13d860f4fd9f0c2c477df268a /arch/ia64/include/asm/sync_bitops.h | |
parent | 9224652cc76417bfe779bcdb1243cf0b083e3eee (diff) | |
parent | f8d1f99f3958c46cdc983743d75d0b31b9accb80 (diff) |
Pull pv_ops-xen into release branch
Diffstat (limited to 'arch/ia64/include/asm/sync_bitops.h')
-rw-r--r-- | arch/ia64/include/asm/sync_bitops.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/ia64/include/asm/sync_bitops.h b/arch/ia64/include/asm/sync_bitops.h new file mode 100644 index 00000000000..593c12eeb27 --- /dev/null +++ b/arch/ia64/include/asm/sync_bitops.h @@ -0,0 +1,51 @@ +#ifndef _ASM_IA64_SYNC_BITOPS_H +#define _ASM_IA64_SYNC_BITOPS_H + +/* + * Copyright (C) 2008 Isaku Yamahata <yamahata at valinux co jp> + * + * Based on synch_bitops.h which Dan Magenhaimer wrote. + * + * bit operations which provide guaranteed strong synchronisation + * when communicating with Xen or other guest OSes running on other CPUs. + */ + +static inline void sync_set_bit(int nr, volatile void *addr) +{ + set_bit(nr, addr); +} + +static inline void sync_clear_bit(int nr, volatile void *addr) +{ + clear_bit(nr, addr); +} + +static inline void sync_change_bit(int nr, volatile void *addr) +{ + change_bit(nr, addr); +} + +static inline int sync_test_and_set_bit(int nr, volatile void *addr) +{ + return test_and_set_bit(nr, addr); +} + +static inline int sync_test_and_clear_bit(int nr, volatile void *addr) +{ + return test_and_clear_bit(nr, addr); +} + +static inline int sync_test_and_change_bit(int nr, volatile void *addr) +{ + return test_and_change_bit(nr, addr); +} + +static inline int sync_test_bit(int nr, const volatile void *addr) +{ + return test_bit(nr, addr); +} + +#define sync_cmpxchg(ptr, old, new) \ + ((__typeof__(*(ptr)))cmpxchg_acq((ptr), (old), (new))) + +#endif /* _ASM_IA64_SYNC_BITOPS_H */ |