diff options
Diffstat (limited to 'include/asm-powerpc/synch.h')
| -rw-r--r-- | include/asm-powerpc/synch.h | 25 | 
1 files changed, 5 insertions, 20 deletions
diff --git a/include/asm-powerpc/synch.h b/include/asm-powerpc/synch.h index 4660c0394a77..c90d9d9aae72 100644 --- a/include/asm-powerpc/synch.h +++ b/include/asm-powerpc/synch.h  | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | #ifndef _ASM_POWERPC_SYNCH_H | 1 | #ifndef _ASM_POWERPC_SYNCH_H | 
| 2 | #define _ASM_POWERPC_SYNCH_H | 2 | #define _ASM_POWERPC_SYNCH_H | 
| 3 | #ifdef __KERNEL__ | ||
| 3 | 4 | ||
| 4 | #include <linux/config.h> | 5 | #include <linux/stringify.h> | 
| 5 | 6 | ||
| 6 | #ifdef __powerpc64__ | 7 | #ifdef __powerpc64__ | 
| 7 | #define __SUBARCH_HAS_LWSYNC | 8 | #define __SUBARCH_HAS_LWSYNC | 
| @@ -13,20 +14,12 @@ | |||
| 13 | # define LWSYNC sync | 14 | # define LWSYNC sync | 
| 14 | #endif | 15 | #endif | 
| 15 | 16 | ||
| 16 | |||
| 17 | /* | ||
| 18 | * Arguably the bitops and *xchg operations don't imply any memory barrier | ||
| 19 | * or SMP ordering, but in fact a lot of drivers expect them to imply | ||
| 20 | * both, since they do on x86 cpus. | ||
| 21 | */ | ||
| 22 | #ifdef CONFIG_SMP | 17 | #ifdef CONFIG_SMP | 
| 23 | #define EIEIO_ON_SMP "eieio\n" | ||
| 24 | #define ISYNC_ON_SMP "\n\tisync" | 18 | #define ISYNC_ON_SMP "\n\tisync" | 
| 25 | #define SYNC_ON_SMP __stringify(LWSYNC) "\n" | 19 | #define LWSYNC_ON_SMP __stringify(LWSYNC) "\n" | 
| 26 | #else | 20 | #else | 
| 27 | #define EIEIO_ON_SMP | ||
| 28 | #define ISYNC_ON_SMP | 21 | #define ISYNC_ON_SMP | 
| 29 | #define SYNC_ON_SMP | 22 | #define LWSYNC_ON_SMP | 
| 30 | #endif | 23 | #endif | 
| 31 | 24 | ||
| 32 | static inline void eieio(void) | 25 | static inline void eieio(void) | 
| @@ -39,13 +32,5 @@ static inline void isync(void) | |||
| 39 | __asm__ __volatile__ ("isync" : : : "memory"); | 32 | __asm__ __volatile__ ("isync" : : : "memory"); | 
| 40 | } | 33 | } | 
| 41 | 34 | ||
| 42 | #ifdef CONFIG_SMP | 35 | #endif /* __KERNEL__ */ | 
| 43 | #define eieio_on_smp() eieio() | ||
| 44 | #define isync_on_smp() isync() | ||
| 45 | #else | ||
| 46 | #define eieio_on_smp() __asm__ __volatile__("": : :"memory") | ||
| 47 | #define isync_on_smp() __asm__ __volatile__("": : :"memory") | ||
| 48 | #endif | ||
| 49 | |||
| 50 | #endif /* _ASM_POWERPC_SYNCH_H */ | 36 | #endif /* _ASM_POWERPC_SYNCH_H */ | 
| 51 | |||
