diff options
author | Becky Bruce <bgill@freescale.com> | 2005-09-22 15:20:04 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-09-25 08:38:46 -0400 |
commit | feaf7cf153335fe7100b65ed6f4585c3574fe69a (patch) | |
tree | c57198f01b5f12ffe8ce90f4e1399505c1f84a02 /include/asm-powerpc/synch.h | |
parent | 2bfadee32f1501faa3184d574f6a769f17236c87 (diff) |
[PATCH] powerpc: merge atomic.h, memory.h
powerpc: Merge atomic.h and memory.h into powerpc
Merged atomic.h into include/powerpc. Moved asm-style HMT_ defines from
memory.h into ppc_asm.h, where there were already HMT_defines; moved c-style
HMT_ defines to processor.h. Renamed memory.h to synch.h to better reflect
its contents.
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Jon Loeliger <linuxppc@jdl.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/synch.h')
-rw-r--r-- | include/asm-powerpc/synch.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/include/asm-powerpc/synch.h b/include/asm-powerpc/synch.h new file mode 100644 index 000000000000..4660c0394a77 --- /dev/null +++ b/include/asm-powerpc/synch.h | |||
@@ -0,0 +1,51 @@ | |||
1 | #ifndef _ASM_POWERPC_SYNCH_H | ||
2 | #define _ASM_POWERPC_SYNCH_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #ifdef __powerpc64__ | ||
7 | #define __SUBARCH_HAS_LWSYNC | ||
8 | #endif | ||
9 | |||
10 | #ifdef __SUBARCH_HAS_LWSYNC | ||
11 | # define LWSYNC lwsync | ||
12 | #else | ||
13 | # define LWSYNC sync | ||
14 | #endif | ||
15 | |||
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 | ||
23 | #define EIEIO_ON_SMP "eieio\n" | ||
24 | #define ISYNC_ON_SMP "\n\tisync" | ||
25 | #define SYNC_ON_SMP __stringify(LWSYNC) "\n" | ||
26 | #else | ||
27 | #define EIEIO_ON_SMP | ||
28 | #define ISYNC_ON_SMP | ||
29 | #define SYNC_ON_SMP | ||
30 | #endif | ||
31 | |||
32 | static inline void eieio(void) | ||
33 | { | ||
34 | __asm__ __volatile__ ("eieio" : : : "memory"); | ||
35 | } | ||
36 | |||
37 | static inline void isync(void) | ||
38 | { | ||
39 | __asm__ __volatile__ ("isync" : : : "memory"); | ||
40 | } | ||
41 | |||
42 | #ifdef CONFIG_SMP | ||
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 */ | ||
51 | |||