aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-alpha/barrier.h
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2005-10-25 02:05:58 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-25 12:32:46 -0400
commit0db9ae4a79381a5a3d272ccb51851c48c4bcbb6d (patch)
tree2799d939a04135e036eece1159771badac48e6e8 /include/asm-alpha/barrier.h
parentc14e2cfc18659c6ca67c2e10417c432eb978d976 (diff)
[PATCH] alpha: atomic dependency fix
My alpha build is exploding because asm/atomic.h now needs smb_mb(), which is over in the (not included) system.h. I fear what will happen if I include system.h into atomic.h, so let's put the barriers into their own header file. Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-alpha/barrier.h')
-rw-r--r--include/asm-alpha/barrier.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/asm-alpha/barrier.h b/include/asm-alpha/barrier.h
new file mode 100644
index 000000000000..229c83fe77cb
--- /dev/null
+++ b/include/asm-alpha/barrier.h
@@ -0,0 +1,34 @@
1#ifndef __BARRIER_H
2#define __BARRIER_H
3
4#define mb() \
5__asm__ __volatile__("mb": : :"memory")
6
7#define rmb() \
8__asm__ __volatile__("mb": : :"memory")
9
10#define wmb() \
11__asm__ __volatile__("wmb": : :"memory")
12
13#define read_barrier_depends() \
14__asm__ __volatile__("mb": : :"memory")
15
16#ifdef CONFIG_SMP
17#define smp_mb() mb()
18#define smp_rmb() rmb()
19#define smp_wmb() wmb()
20#define smp_read_barrier_depends() read_barrier_depends()
21#else
22#define smp_mb() barrier()
23#define smp_rmb() barrier()
24#define smp_wmb() barrier()
25#define smp_read_barrier_depends() barrier()
26#endif
27
28#define set_mb(var, value) \
29do { var = value; mb(); } while (0)
30
31#define set_wmb(var, value) \
32do { var = value; wmb(); } while (0)
33
34#endif /* __BARRIER_H */