diff options
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/system.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index d1ced5029c42..145b70f6d22b 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
@@ -30,8 +30,8 @@ | |||
30 | * | 30 | * |
31 | * For wmb(), we use sync since wmb is used in drivers to order | 31 | * For wmb(), we use sync since wmb is used in drivers to order |
32 | * stores to system memory with respect to writes to the device. | 32 | * stores to system memory with respect to writes to the device. |
33 | * However, smp_wmb() can be a lighter-weight eieio barrier on | 33 | * However, smp_wmb() can be a lighter-weight lwsync or eieio barrier |
34 | * SMP since it is only used to order updates to system memory. | 34 | * on SMP since it is only used to order updates to system memory. |
35 | */ | 35 | */ |
36 | #define mb() __asm__ __volatile__ ("sync" : : : "memory") | 36 | #define mb() __asm__ __volatile__ ("sync" : : : "memory") |
37 | #define rmb() __asm__ __volatile__ ("sync" : : : "memory") | 37 | #define rmb() __asm__ __volatile__ ("sync" : : : "memory") |
@@ -43,9 +43,16 @@ | |||
43 | #ifdef __KERNEL__ | 43 | #ifdef __KERNEL__ |
44 | #define AT_VECTOR_SIZE_ARCH 6 /* entries in ARCH_DLINFO */ | 44 | #define AT_VECTOR_SIZE_ARCH 6 /* entries in ARCH_DLINFO */ |
45 | #ifdef CONFIG_SMP | 45 | #ifdef CONFIG_SMP |
46 | |||
47 | #ifdef __SUBARCH_HAS_LWSYNC | ||
48 | # define SMPWMB lwsync | ||
49 | #else | ||
50 | # define SMPWMB eieio | ||
51 | #endif | ||
52 | |||
46 | #define smp_mb() mb() | 53 | #define smp_mb() mb() |
47 | #define smp_rmb() rmb() | 54 | #define smp_rmb() rmb() |
48 | #define smp_wmb() eieio() | 55 | #define smp_wmb() __asm__ __volatile__ (__stringify(SMPWMB) : : :"memory") |
49 | #define smp_read_barrier_depends() read_barrier_depends() | 56 | #define smp_read_barrier_depends() read_barrier_depends() |
50 | #else | 57 | #else |
51 | #define smp_mb() barrier() | 58 | #define smp_mb() barrier() |