ia64/xen-unstable

view linux-2.6-xen-sparse/include/asm-ia64/synch_bitops.h @ 14100:e47738923a05

[LINUX] Purge include <linux/config.h>. It has been obsolete for some time now.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Fri Feb 23 16:56:45 2007 +0000 (2007-02-23)
parents 86cae321e707
children
line source
1 #ifndef __XEN_SYNCH_BITOPS_H__
2 #define __XEN_SYNCH_BITOPS_H__
4 /*
5 * Copyright 1992, Linus Torvalds.
6 * Heavily modified to provide guaranteed strong synchronisation
7 * when communicating with Xen or other guest OSes running on other CPUs.
8 */
10 #define ADDR (*(volatile long *) addr)
12 static __inline__ void synch_set_bit(int nr, volatile void * addr)
13 {
14 set_bit(nr, addr);
15 }
17 static __inline__ void synch_clear_bit(int nr, volatile void * addr)
18 {
19 clear_bit(nr, addr);
20 }
22 static __inline__ void synch_change_bit(int nr, volatile void * addr)
23 {
24 change_bit(nr, addr);
25 }
27 static __inline__ int synch_test_and_set_bit(int nr, volatile void * addr)
28 {
29 return test_and_set_bit(nr, addr);
30 }
32 static __inline__ int synch_test_and_clear_bit(int nr, volatile void * addr)
33 {
34 return test_and_clear_bit(nr, addr);
35 }
37 static __inline__ int synch_test_and_change_bit(int nr, volatile void * addr)
38 {
39 return test_and_change_bit(nr, addr);
40 }
42 static __inline__ int synch_const_test_bit(int nr, const volatile void * addr)
43 {
44 return test_bit(nr, addr);
45 }
47 static __inline__ int synch_var_test_bit(int nr, volatile void * addr)
48 {
49 return test_bit(nr, addr);
50 }
52 #define synch_cmpxchg ia64_cmpxchg4_acq
54 #define synch_test_bit(nr,addr) \
55 (__builtin_constant_p(nr) ? \
56 synch_const_test_bit((nr),(addr)) : \
57 synch_var_test_bit((nr),(addr)))
59 #define synch_cmpxchg_subword synch_cmpxchg
61 #endif /* __XEN_SYNCH_BITOPS_H__ */