1 #ifndef _ASM_IA64_SYNC_BITOPS_H
2 #define _ASM_IA64_SYNC_BITOPS_H
5 * Copyright (C) 2008 Isaku Yamahata <yamahata at valinux co jp>
7 * Based on synch_bitops.h which Dan Magenhaimer wrote.
9 * bit operations which provide guaranteed strong synchronisation
10 * when communicating with Xen or other guest OSes running on other CPUs.
13 static inline void sync_set_bit(int nr, volatile void *addr)
18 static inline void sync_clear_bit(int nr, volatile void *addr)
23 static inline void sync_change_bit(int nr, volatile void *addr)
28 static inline int sync_test_and_set_bit(int nr, volatile void *addr)
30 return test_and_set_bit(nr, addr);
33 static inline int sync_test_and_clear_bit(int nr, volatile void *addr)
35 return test_and_clear_bit(nr, addr);
38 static inline int sync_test_and_change_bit(int nr, volatile void *addr)
40 return test_and_change_bit(nr, addr);
43 static inline int sync_test_bit(int nr, const volatile void *addr)
45 return test_bit(nr, addr);
48 #define sync_cmpxchg(ptr, old, new) \
49 ((__typeof__(*(ptr)))cmpxchg_acq((ptr), (old), (new)))
51 #endif /* _ASM_IA64_SYNC_BITOPS_H */