1
2
3#ifndef __ASM_CSKY_BARRIER_H
4#define __ASM_CSKY_BARRIER_H
5
6#ifndef __ASSEMBLY__
7
8#define nop() asm volatile ("nop\n":::"memory")
9
10#ifdef CONFIG_SMP
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40#define __bar_brw() asm volatile (".long 0x842cc000\n":::"memory")
41#define __bar_br() asm volatile (".long 0x8424c000\n":::"memory")
42#define __bar_bw() asm volatile (".long 0x8428c000\n":::"memory")
43#define __bar_arw() asm volatile (".long 0x8423c000\n":::"memory")
44#define __bar_ar() asm volatile (".long 0x8421c000\n":::"memory")
45#define __bar_aw() asm volatile (".long 0x8422c000\n":::"memory")
46#define __bar_brwarw() asm volatile (".long 0x842fc000\n":::"memory")
47#define __bar_brarw() asm volatile (".long 0x8427c000\n":::"memory")
48#define __bar_bwarw() asm volatile (".long 0x842bc000\n":::"memory")
49#define __bar_brwar() asm volatile (".long 0x842dc000\n":::"memory")
50#define __bar_brwaw() asm volatile (".long 0x842ec000\n":::"memory")
51#define __bar_brar() asm volatile (".long 0x8425c000\n":::"memory")
52#define __bar_brar() asm volatile (".long 0x8425c000\n":::"memory")
53#define __bar_bwaw() asm volatile (".long 0x842ac000\n":::"memory")
54
55#define __smp_mb() __bar_brwarw()
56#define __smp_rmb() __bar_brar()
57#define __smp_wmb() __bar_bwaw()
58
59#define ACQUIRE_FENCE ".long 0x8427c000\n"
60#define __smp_acquire_fence() __bar_brarw()
61#define __smp_release_fence() __bar_brwaw()
62
63#endif
64
65
66
67
68
69
70
71
72
73#define mb() asm volatile ("sync\n":::"memory")
74
75#ifdef CONFIG_CPU_HAS_CACHEV2
76
77
78
79#define sync_is() asm volatile ("sync.is\nsync.is\nsync.is\n":::"memory")
80#endif
81
82#include <asm-generic/barrier.h>
83
84#endif
85#endif
86