Adding support for MOXA ART SoC. Testing port of linux-2.6.32.60-moxart.
[linux-3.6.7-moxart.git] / arch / blackfin / include / asm / barrier.h
blobebb189507dd73f76ac4bf871e7f2da602639f3d1
1 /*
2 * Copyright 2004-2009 Analog Devices Inc.
3 * Tony Kou (tonyko@lineo.ca)
5 * Licensed under the GPL-2 or later
6 */
8 #ifndef _BLACKFIN_BARRIER_H
9 #define _BLACKFIN_BARRIER_H
11 #include <asm/cache.h>
13 #define nop() __asm__ __volatile__ ("nop;\n\t" : : )
16 * Force strict CPU ordering.
18 #ifdef CONFIG_SMP
20 #ifdef __ARCH_SYNC_CORE_DCACHE
21 /* Force Core data cache coherence */
22 # define mb() do { barrier(); smp_check_barrier(); smp_mark_barrier(); } while (0)
23 # define rmb() do { barrier(); smp_check_barrier(); } while (0)
24 # define wmb() do { barrier(); smp_mark_barrier(); } while (0)
25 # define read_barrier_depends() do { barrier(); smp_check_barrier(); } while (0)
26 #else
27 # define mb() barrier()
28 # define rmb() barrier()
29 # define wmb() barrier()
30 # define read_barrier_depends() do { } while (0)
31 #endif
33 #else /* !CONFIG_SMP */
35 #define mb() barrier()
36 #define rmb() barrier()
37 #define wmb() barrier()
38 #define read_barrier_depends() do { } while (0)
40 #endif /* !CONFIG_SMP */
42 #define smp_mb() mb()
43 #define smp_rmb() rmb()
44 #define smp_wmb() wmb()
45 #define set_mb(var, value) do { var = value; mb(); } while (0)
46 #define smp_read_barrier_depends() read_barrier_depends()
48 #endif /* _BLACKFIN_BARRIER_H */