aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/synch.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc/synch.h')
-rw-r--r--include/asm-powerpc/synch.h38
1 files changed, 23 insertions, 15 deletions
diff --git a/include/asm-powerpc/synch.h b/include/asm-powerpc/synch.h
index 42a1ef590690..45963e80f557 100644
--- a/include/asm-powerpc/synch.h
+++ b/include/asm-powerpc/synch.h
@@ -3,34 +3,42 @@
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/stringify.h> 5#include <linux/stringify.h>
6#include <asm/feature-fixups.h>
6 7
7#if defined(__powerpc64__) || defined(CONFIG_PPC_E500MC) 8#ifndef __ASSEMBLY__
8#define __SUBARCH_HAS_LWSYNC 9extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup;
9#endif 10extern void do_lwsync_fixups(unsigned long value, void *fixup_start,
11 void *fixup_end);
12
13static inline void eieio(void)
14{
15 __asm__ __volatile__ ("eieio" : : : "memory");
16}
17
18static inline void isync(void)
19{
20 __asm__ __volatile__ ("isync" : : : "memory");
21}
22#endif /* __ASSEMBLY__ */
10 23
11#ifdef __SUBARCH_HAS_LWSYNC 24#if defined(__powerpc64__)
12# define LWSYNC lwsync 25# define LWSYNC lwsync
26#elif defined(CONFIG_E500)
27# define LWSYNC \
28 START_LWSYNC_SECTION(96); \
29 sync; \
30 MAKE_LWSYNC_SECTION_ENTRY(96, __lwsync_fixup);
13#else 31#else
14# define LWSYNC sync 32# define LWSYNC sync
15#endif 33#endif
16 34
17#ifdef CONFIG_SMP 35#ifdef CONFIG_SMP
18#define ISYNC_ON_SMP "\n\tisync\n" 36#define ISYNC_ON_SMP "\n\tisync\n"
19#define LWSYNC_ON_SMP __stringify(LWSYNC) "\n" 37#define LWSYNC_ON_SMP stringify_in_c(LWSYNC) "\n"
20#else 38#else
21#define ISYNC_ON_SMP 39#define ISYNC_ON_SMP
22#define LWSYNC_ON_SMP 40#define LWSYNC_ON_SMP
23#endif 41#endif
24 42
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
35#endif /* __KERNEL__ */ 43#endif /* __KERNEL__ */
36#endif /* _ASM_POWERPC_SYNCH_H */ 44#endif /* _ASM_POWERPC_SYNCH_H */