aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChase Venters <chase.venters@clientec.com>2006-07-08 12:10:29 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-12 15:56:45 -0400
commitf6dc8c5b8e04ce28720155383e971561a23899d5 (patch)
treedf590e4e096ac332a7d95ef96275bebd57ce70c9 /include
parent0f74964627e0ece4ac8da0e2cd01906ec322b4fe (diff)
[PATCH] Make cpu_relax() imply barrier() on all arches
During the recent discussion of taking 'volatile' off of the spinlock, I noticed that while most arches #define cpu_relax() such that it implies barrier(), some arches define cpu_relax() to be empty. This patch changes the definition of cpu_relax() for frv, h8300, m68knommu, sh, sh64, v850 and xtensa from an empty while(0) to the compiler barrier(). Signed-off-by: Chase Venters <chase.venters@clientec.com> Acked-by: Arjan van de Ven <arjan@Linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-frv/processor.h3
-rw-r--r--include/asm-h8300/processor.h3
-rw-r--r--include/asm-m68knommu/processor.h3
-rw-r--r--include/asm-sh/processor.h3
-rw-r--r--include/asm-sh64/processor.h3
-rw-r--r--include/asm-v850/processor.h3
-rw-r--r--include/asm-xtensa/processor.h3
7 files changed, 14 insertions, 7 deletions
diff --git a/include/asm-frv/processor.h b/include/asm-frv/processor.h
index 1c4dba1c5f57..3744f2e47f48 100644
--- a/include/asm-frv/processor.h
+++ b/include/asm-frv/processor.h
@@ -21,6 +21,7 @@
21 */ 21 */
22#define current_text_addr() ({ __label__ _l; _l: &&_l;}) 22#define current_text_addr() ({ __label__ _l; _l: &&_l;})
23 23
24#include <linux/compiler.h>
24#include <linux/linkage.h> 25#include <linux/linkage.h>
25#include <asm/sections.h> 26#include <asm/sections.h>
26#include <asm/segment.h> 27#include <asm/segment.h>
@@ -139,7 +140,7 @@ unsigned long get_wchan(struct task_struct *p);
139extern struct task_struct *alloc_task_struct(void); 140extern struct task_struct *alloc_task_struct(void);
140extern void free_task_struct(struct task_struct *p); 141extern void free_task_struct(struct task_struct *p);
141 142
142#define cpu_relax() do { } while (0) 143#define cpu_relax() barrier()
143 144
144/* data cache prefetch */ 145/* data cache prefetch */
145#define ARCH_HAS_PREFETCH 146#define ARCH_HAS_PREFETCH
diff --git a/include/asm-h8300/processor.h b/include/asm-h8300/processor.h
index c7e2f454b83a..99b664aa2083 100644
--- a/include/asm-h8300/processor.h
+++ b/include/asm-h8300/processor.h
@@ -17,6 +17,7 @@
17 */ 17 */
18#define current_text_addr() ({ __label__ _l; _l: &&_l;}) 18#define current_text_addr() ({ __label__ _l; _l: &&_l;})
19 19
20#include <linux/compiler.h>
20#include <asm/segment.h> 21#include <asm/segment.h>
21#include <asm/fpu.h> 22#include <asm/fpu.h>
22#include <asm/ptrace.h> 23#include <asm/ptrace.h>
@@ -129,6 +130,6 @@ unsigned long get_wchan(struct task_struct *p);
129 eip; }) 130 eip; })
130#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) 131#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
131 132
132#define cpu_relax() do { } while (0) 133#define cpu_relax() barrier()
133 134
134#endif 135#endif
diff --git a/include/asm-m68knommu/processor.h b/include/asm-m68knommu/processor.h
index 0ee158e09abb..9d3a1bf41231 100644
--- a/include/asm-m68knommu/processor.h
+++ b/include/asm-m68knommu/processor.h
@@ -13,6 +13,7 @@
13 */ 13 */
14#define current_text_addr() ({ __label__ _l; _l: &&_l;}) 14#define current_text_addr() ({ __label__ _l; _l: &&_l;})
15 15
16#include <linux/compiler.h>
16#include <linux/threads.h> 17#include <linux/threads.h>
17#include <asm/types.h> 18#include <asm/types.h>
18#include <asm/segment.h> 19#include <asm/segment.h>
@@ -137,6 +138,6 @@ unsigned long get_wchan(struct task_struct *p);
137 eip; }) 138 eip; })
138#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) 139#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
139 140
140#define cpu_relax() do { } while (0) 141#define cpu_relax() barrier()
141 142
142#endif 143#endif
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index fa5bd2d8803e..eeb0f48bb99e 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -9,6 +9,7 @@
9#define __ASM_SH_PROCESSOR_H 9#define __ASM_SH_PROCESSOR_H
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11 11
12#include <linux/compiler.h>
12#include <asm/page.h> 13#include <asm/page.h>
13#include <asm/types.h> 14#include <asm/types.h>
14#include <asm/cache.h> 15#include <asm/cache.h>
@@ -263,7 +264,7 @@ extern unsigned long get_wchan(struct task_struct *p);
263#define KSTK_ESP(tsk) ((tsk)->thread.sp) 264#define KSTK_ESP(tsk) ((tsk)->thread.sp)
264 265
265#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory") 266#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory")
266#define cpu_relax() do { } while (0) 267#define cpu_relax() barrier()
267 268
268#endif /* __KERNEL__ */ 269#endif /* __KERNEL__ */
269#endif /* __ASM_SH_PROCESSOR_H */ 270#endif /* __ASM_SH_PROCESSOR_H */
diff --git a/include/asm-sh64/processor.h b/include/asm-sh64/processor.h
index 1bf252dad824..eb2bee4b47b9 100644
--- a/include/asm-sh64/processor.h
+++ b/include/asm-sh64/processor.h
@@ -22,6 +22,7 @@
22#include <asm/cache.h> 22#include <asm/cache.h>
23#include <asm/registers.h> 23#include <asm/registers.h>
24#include <linux/threads.h> 24#include <linux/threads.h>
25#include <linux/compiler.h>
25 26
26/* 27/*
27 * Default implementation of macro that returns current 28 * Default implementation of macro that returns current
@@ -279,7 +280,7 @@ extern unsigned long get_wchan(struct task_struct *p);
279#define KSTK_EIP(tsk) ((tsk)->thread.pc) 280#define KSTK_EIP(tsk) ((tsk)->thread.pc)
280#define KSTK_ESP(tsk) ((tsk)->thread.sp) 281#define KSTK_ESP(tsk) ((tsk)->thread.sp)
281 282
282#define cpu_relax() do { } while (0) 283#define cpu_relax() barrier()
283 284
284#endif /* __ASSEMBLY__ */ 285#endif /* __ASSEMBLY__ */
285#endif /* __ASM_SH64_PROCESSOR_H */ 286#endif /* __ASM_SH64_PROCESSOR_H */
diff --git a/include/asm-v850/processor.h b/include/asm-v850/processor.h
index 6965b66ccaed..979e3467f9af 100644
--- a/include/asm-v850/processor.h
+++ b/include/asm-v850/processor.h
@@ -18,6 +18,7 @@
18#include <linux/thread_info.h> 18#include <linux/thread_info.h>
19#endif 19#endif
20 20
21#include <linux/compiler.h>
21#include <asm/ptrace.h> 22#include <asm/ptrace.h>
22#include <asm/entry.h> 23#include <asm/entry.h>
23 24
@@ -106,7 +107,7 @@ unsigned long get_wchan (struct task_struct *p);
106#define KSTK_ESP(task) task_sp (task) 107#define KSTK_ESP(task) task_sp (task)
107 108
108 109
109#define cpu_relax() ((void)0) 110#define cpu_relax() barrier()
110 111
111 112
112#else /* __ASSEMBLY__ */ 113#else /* __ASSEMBLY__ */
diff --git a/include/asm-xtensa/processor.h b/include/asm-xtensa/processor.h
index d1d72ad36f08..8b96e77c9d82 100644
--- a/include/asm-xtensa/processor.h
+++ b/include/asm-xtensa/processor.h
@@ -20,6 +20,7 @@
20#include <xtensa/config/tie.h> 20#include <xtensa/config/tie.h>
21#include <xtensa/config/system.h> 21#include <xtensa/config/system.h>
22 22
23#include <linux/compiler.h>
23#include <asm/ptrace.h> 24#include <asm/ptrace.h>
24#include <asm/types.h> 25#include <asm/types.h>
25#include <asm/coprocessor.h> 26#include <asm/coprocessor.h>
@@ -191,7 +192,7 @@ extern unsigned long get_wchan(struct task_struct *p);
191#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) 192#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
192#define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1]) 193#define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1])
193 194
194#define cpu_relax() do { } while (0) 195#define cpu_relax() barrier()
195 196
196/* Special register access. */ 197/* Special register access. */
197 198