diff options
-rw-r--r-- | arch/mips/Kconfig | 1 | ||||
-rw-r--r-- | arch/mips/include/asm/barrier.h | 43 |
2 files changed, 31 insertions, 13 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 8b5d174685f0..70376e586315 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -1295,7 +1295,6 @@ config CPU_CAVIUM_OCTEON | |||
1295 | select SYS_SUPPORTS_SMP | 1295 | select SYS_SUPPORTS_SMP |
1296 | select NR_CPUS_DEFAULT_16 | 1296 | select NR_CPUS_DEFAULT_16 |
1297 | select WEAK_ORDERING | 1297 | select WEAK_ORDERING |
1298 | select WEAK_REORDERING_BEYOND_LLSC | ||
1299 | select CPU_SUPPORTS_HIGHMEM | 1298 | select CPU_SUPPORTS_HIGHMEM |
1300 | select CPU_SUPPORTS_HUGEPAGES | 1299 | select CPU_SUPPORTS_HUGEPAGES |
1301 | help | 1300 | help |
diff --git a/arch/mips/include/asm/barrier.h b/arch/mips/include/asm/barrier.h index 1a5a51c3e96f..a2670a239e0c 100644 --- a/arch/mips/include/asm/barrier.h +++ b/arch/mips/include/asm/barrier.h | |||
@@ -88,12 +88,20 @@ | |||
88 | : /* no output */ \ | 88 | : /* no output */ \ |
89 | : "m" (*(int *)CKSEG1) \ | 89 | : "m" (*(int *)CKSEG1) \ |
90 | : "memory") | 90 | : "memory") |
91 | 91 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | |
92 | #define fast_wmb() __sync() | 92 | # define OCTEON_SYNCW_STR ".set push\n.set arch=octeon\nsyncw\nsyncw\n.set pop\n" |
93 | #define fast_rmb() __sync() | 93 | # define __syncw() __asm__ __volatile__(OCTEON_SYNCW_STR : : : "memory") |
94 | #define fast_mb() __sync() | 94 | |
95 | #ifdef CONFIG_SGI_IP28 | 95 | # define fast_wmb() __syncw() |
96 | #define fast_iob() \ | 96 | # define fast_rmb() barrier() |
97 | # define fast_mb() __sync() | ||
98 | # define fast_iob() do { } while (0) | ||
99 | #else /* ! CONFIG_CPU_CAVIUM_OCTEON */ | ||
100 | # define fast_wmb() __sync() | ||
101 | # define fast_rmb() __sync() | ||
102 | # define fast_mb() __sync() | ||
103 | # ifdef CONFIG_SGI_IP28 | ||
104 | # define fast_iob() \ | ||
97 | __asm__ __volatile__( \ | 105 | __asm__ __volatile__( \ |
98 | ".set push\n\t" \ | 106 | ".set push\n\t" \ |
99 | ".set noreorder\n\t" \ | 107 | ".set noreorder\n\t" \ |
@@ -104,13 +112,14 @@ | |||
104 | : /* no output */ \ | 112 | : /* no output */ \ |
105 | : "m" (*(int *)CKSEG1ADDR(0x1fa00004)) \ | 113 | : "m" (*(int *)CKSEG1ADDR(0x1fa00004)) \ |
106 | : "memory") | 114 | : "memory") |
107 | #else | 115 | # else |
108 | #define fast_iob() \ | 116 | # define fast_iob() \ |
109 | do { \ | 117 | do { \ |
110 | __sync(); \ | 118 | __sync(); \ |
111 | __fast_iob(); \ | 119 | __fast_iob(); \ |
112 | } while (0) | 120 | } while (0) |
113 | #endif | 121 | # endif |
122 | #endif /* CONFIG_CPU_CAVIUM_OCTEON */ | ||
114 | 123 | ||
115 | #ifdef CONFIG_CPU_HAS_WB | 124 | #ifdef CONFIG_CPU_HAS_WB |
116 | 125 | ||
@@ -131,9 +140,15 @@ | |||
131 | #endif /* !CONFIG_CPU_HAS_WB */ | 140 | #endif /* !CONFIG_CPU_HAS_WB */ |
132 | 141 | ||
133 | #if defined(CONFIG_WEAK_ORDERING) && defined(CONFIG_SMP) | 142 | #if defined(CONFIG_WEAK_ORDERING) && defined(CONFIG_SMP) |
134 | #define smp_mb() __asm__ __volatile__("sync" : : :"memory") | 143 | # ifdef CONFIG_CPU_CAVIUM_OCTEON |
135 | #define smp_rmb() __asm__ __volatile__("sync" : : :"memory") | 144 | # define smp_mb() __sync() |
136 | #define smp_wmb() __asm__ __volatile__("sync" : : :"memory") | 145 | # define smp_rmb() barrier() |
146 | # define smp_wmb() __syncw() | ||
147 | # else | ||
148 | # define smp_mb() __asm__ __volatile__("sync" : : :"memory") | ||
149 | # define smp_rmb() __asm__ __volatile__("sync" : : :"memory") | ||
150 | # define smp_wmb() __asm__ __volatile__("sync" : : :"memory") | ||
151 | # endif | ||
137 | #else | 152 | #else |
138 | #define smp_mb() barrier() | 153 | #define smp_mb() barrier() |
139 | #define smp_rmb() barrier() | 154 | #define smp_rmb() barrier() |
@@ -151,6 +166,10 @@ | |||
151 | 166 | ||
152 | #define smp_llsc_mb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory") | 167 | #define smp_llsc_mb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory") |
153 | 168 | ||
169 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
170 | #define smp_mb__before_llsc() smp_wmb() | ||
171 | #else | ||
154 | #define smp_mb__before_llsc() smp_llsc_mb() | 172 | #define smp_mb__before_llsc() smp_llsc_mb() |
173 | #endif | ||
155 | 174 | ||
156 | #endif /* __ASM_BARRIER_H */ | 175 | #endif /* __ASM_BARRIER_H */ |