• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _ASM_IA64_SYNC_BITOPS_H
2 #define _ASM_IA64_SYNC_BITOPS_H
3 
4 /*
5  * Copyright (C) 2008 Isaku Yamahata <yamahata at valinux co jp>
6  *
7  * Based on synch_bitops.h which Dan Magenhaimer wrote.
8  *
9  * bit operations which provide guaranteed strong synchronisation
10  * when communicating with Xen or other guest OSes running on other CPUs.
11  */
12 
sync_set_bit(int nr,volatile void * addr)13 static inline void sync_set_bit(int nr, volatile void *addr)
14 {
15 	set_bit(nr, addr);
16 }
17 
sync_clear_bit(int nr,volatile void * addr)18 static inline void sync_clear_bit(int nr, volatile void *addr)
19 {
20 	clear_bit(nr, addr);
21 }
22 
sync_change_bit(int nr,volatile void * addr)23 static inline void sync_change_bit(int nr, volatile void *addr)
24 {
25 	change_bit(nr, addr);
26 }
27 
sync_test_and_set_bit(int nr,volatile void * addr)28 static inline int sync_test_and_set_bit(int nr, volatile void *addr)
29 {
30 	return test_and_set_bit(nr, addr);
31 }
32 
sync_test_and_clear_bit(int nr,volatile void * addr)33 static inline int sync_test_and_clear_bit(int nr, volatile void *addr)
34 {
35 	return test_and_clear_bit(nr, addr);
36 }
37 
sync_test_and_change_bit(int nr,volatile void * addr)38 static inline int sync_test_and_change_bit(int nr, volatile void *addr)
39 {
40 	return test_and_change_bit(nr, addr);
41 }
42 
sync_test_bit(int nr,const volatile void * addr)43 static inline int sync_test_bit(int nr, const volatile void *addr)
44 {
45 	return test_bit(nr, addr);
46 }
47 
48 #define sync_cmpxchg(ptr, old, new)				\
49 	((__typeof__(*(ptr)))cmpxchg_acq((ptr), (old), (new)))
50 
51 #endif /* _ASM_IA64_SYNC_BITOPS_H */
52