diff options
author | David S. Miller <davem@davemloft.net> | 2005-08-29 15:46:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-08-29 15:46:22 -0400 |
commit | 4f07118f656c179740cad35b827032e2e29b1210 (patch) | |
tree | 7ddeb17346fe25ae75aa5373659c053afb9ef5f5 /include/asm-sparc64/system.h | |
parent | 442464a50077ff00454ff8d7628cbe1b8eacc034 (diff) |
[SPARC64]: More fully work around Spitfire Errata 51.
It appears that a memory barrier soon after a mispredicted
branch, not just in the delay slot, can cause the hang
condition of this cpu errata.
So move them out-of-line, and explicitly put them into
a "branch always, predict taken" delay slot which should
fully kill this problem.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc64/system.h')
-rw-r--r-- | include/asm-sparc64/system.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h index ee4bdfc6b88f..5e94c05dc2fc 100644 --- a/include/asm-sparc64/system.h +++ b/include/asm-sparc64/system.h | |||
@@ -28,6 +28,14 @@ enum sparc_cpu { | |||
28 | #define ARCH_SUN4C_SUN4 0 | 28 | #define ARCH_SUN4C_SUN4 0 |
29 | #define ARCH_SUN4 0 | 29 | #define ARCH_SUN4 0 |
30 | 30 | ||
31 | extern void mb(void); | ||
32 | extern void rmb(void); | ||
33 | extern void wmb(void); | ||
34 | extern void membar_storeload(void); | ||
35 | extern void membar_storeload_storestore(void); | ||
36 | extern void membar_storeload_loadload(void); | ||
37 | extern void membar_storestore_loadstore(void); | ||
38 | |||
31 | #endif | 39 | #endif |
32 | 40 | ||
33 | #define setipl(__new_ipl) \ | 41 | #define setipl(__new_ipl) \ |
@@ -78,16 +86,11 @@ enum sparc_cpu { | |||
78 | 86 | ||
79 | #define nop() __asm__ __volatile__ ("nop") | 87 | #define nop() __asm__ __volatile__ ("nop") |
80 | 88 | ||
81 | #define membar(type) __asm__ __volatile__ ("membar " type : : : "memory") | ||
82 | #define mb() \ | ||
83 | membar("#LoadLoad | #LoadStore | #StoreStore | #StoreLoad") | ||
84 | #define rmb() membar("#LoadLoad") | ||
85 | #define wmb() membar("#StoreStore") | ||
86 | #define read_barrier_depends() do { } while(0) | 89 | #define read_barrier_depends() do { } while(0) |
87 | #define set_mb(__var, __value) \ | 90 | #define set_mb(__var, __value) \ |
88 | do { __var = __value; membar("#StoreLoad | #StoreStore"); } while(0) | 91 | do { __var = __value; membar_storeload_storestore(); } while(0) |
89 | #define set_wmb(__var, __value) \ | 92 | #define set_wmb(__var, __value) \ |
90 | do { __var = __value; membar("#StoreStore"); } while(0) | 93 | do { __var = __value; wmb(); } while(0) |
91 | 94 | ||
92 | #ifdef CONFIG_SMP | 95 | #ifdef CONFIG_SMP |
93 | #define smp_mb() mb() | 96 | #define smp_mb() mb() |