blob: c90d9d9aae720f6638e6896e0437442a1c65bb47 [file] [log] [blame]
Becky Brucefeaf7cf2005-09-22 14:20:04 -05001#ifndef _ASM_POWERPC_SYNCH_H
2#define _ASM_POWERPC_SYNCH_H
Arnd Bergmann88ced032005-12-16 22:43:46 +01003#ifdef __KERNEL__
Becky Brucefeaf7cf2005-09-22 14:20:04 -05004
Anton Blanchard144b9c12006-01-13 15:37:17 +11005#include <linux/stringify.h>
6
Becky Brucefeaf7cf2005-09-22 14:20:04 -05007#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 Brucefeaf7cf2005-09-22 14:20:04 -050017#ifdef CONFIG_SMP
Becky Brucefeaf7cf2005-09-22 14:20:04 -050018#define ISYNC_ON_SMP "\n\tisync"
Anton Blanchard144b9c12006-01-13 15:37:17 +110019#define LWSYNC_ON_SMP __stringify(LWSYNC) "\n"
Becky Brucefeaf7cf2005-09-22 14:20:04 -050020#else
Becky Brucefeaf7cf2005-09-22 14:20:04 -050021#define ISYNC_ON_SMP
Anton Blanchard144b9c12006-01-13 15:37:17 +110022#define LWSYNC_ON_SMP
Becky Brucefeaf7cf2005-09-22 14:20:04 -050023#endif
24
25static inline void eieio(void)
26{
27 __asm__ __volatile__ ("eieio" : : : "memory");
28}
29
30static inline void isync(void)
31{
32 __asm__ __volatile__ ("isync" : : : "memory");
33}
34
Arnd Bergmann88ced032005-12-16 22:43:46 +010035#endif /* __KERNEL__ */
Becky Brucefeaf7cf2005-09-22 14:20:04 -050036#endif /* _ASM_POWERPC_SYNCH_H */