[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 <[email protected]>
Acked-by: Arjan van de Ven <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Chase Venters 2006-07-08 11:10:29 -05:00 • committed by Linus Torvalds
commit f6dc8c5b8e
7 changed files with 14 additions and 7 deletions

View file

@ -22,6 +22,7 @@
#include <asm/cache.h>
#include <asm/registers.h>
#include <linux/threads.h>
#include <linux/compiler.h>
/*
* Default implementation of macro that returns current
@ -279,7 +280,7 @@ extern unsigned long get_wchan(struct task_struct *p);
#define KSTK_EIP(tsk) ((tsk)->thread.pc)
#define KSTK_ESP(tsk) ((tsk)->thread.sp)
#define cpu_relax() do { } while (0)
#define cpu_relax() barrier()
#endif /* __ASSEMBLY__ */
#endif /* __ASM_SH64_PROCESSOR_H */