Becky Bruce | feaf7cf | 2005-09-22 14:20:04 -0500 | [diff] [blame] | 1 | #ifndef _ASM_POWERPC_SYNCH_H |
| 2 | #define _ASM_POWERPC_SYNCH_H |
Arnd Bergmann | 88ced03 | 2005-12-16 22:43:46 +0100 | [diff] [blame] | 3 | #ifdef __KERNEL__ |
Becky Bruce | feaf7cf | 2005-09-22 14:20:04 -0500 | [diff] [blame] | 4 | |
Anton Blanchard | 144b9c1 | 2006-01-13 15:37:17 +1100 | [diff] [blame^] | 5 | #include <linux/stringify.h> |
| 6 | |
Becky Bruce | feaf7cf | 2005-09-22 14:20:04 -0500 | [diff] [blame] | 7 | #ifdef __powerpc64__ |
| 8 | #define __SUBARCH_HAS_LWSYNC |
| 9 | #endif |
| 10 | |
| 11 | #ifdef __SUBARCH_HAS_LWSYNC |
| 12 | # define LWSYNC lwsync |
| 13 | #else |
| 14 | # define LWSYNC sync |
| 15 | #endif |
| 16 | |
Becky Bruce | feaf7cf | 2005-09-22 14:20:04 -0500 | [diff] [blame] | 17 | #ifdef CONFIG_SMP |
Becky Bruce | feaf7cf | 2005-09-22 14:20:04 -0500 | [diff] [blame] | 18 | #define ISYNC_ON_SMP "\n\tisync" |
Anton Blanchard | 144b9c1 | 2006-01-13 15:37:17 +1100 | [diff] [blame^] | 19 | #define LWSYNC_ON_SMP __stringify(LWSYNC) "\n" |
Becky Bruce | feaf7cf | 2005-09-22 14:20:04 -0500 | [diff] [blame] | 20 | #else |
Becky Bruce | feaf7cf | 2005-09-22 14:20:04 -0500 | [diff] [blame] | 21 | #define ISYNC_ON_SMP |
Anton Blanchard | 144b9c1 | 2006-01-13 15:37:17 +1100 | [diff] [blame^] | 22 | #define LWSYNC_ON_SMP |
Becky Bruce | feaf7cf | 2005-09-22 14:20:04 -0500 | [diff] [blame] | 23 | #endif |
| 24 | |
| 25 | static inline void eieio(void) |
| 26 | { |
| 27 | __asm__ __volatile__ ("eieio" : : : "memory"); |
| 28 | } |
| 29 | |
| 30 | static inline void isync(void) |
| 31 | { |
| 32 | __asm__ __volatile__ ("isync" : : : "memory"); |
| 33 | } |
| 34 | |
Arnd Bergmann | 88ced03 | 2005-12-16 22:43:46 +0100 | [diff] [blame] | 35 | #endif /* __KERNEL__ */ |
Becky Bruce | feaf7cf | 2005-09-22 14:20:04 -0500 | [diff] [blame] | 36 | #endif /* _ASM_POWERPC_SYNCH_H */ |