ChangeSet 1.2231.1.105, 2005/03/28 19:45:42-08:00, [EMAIL PROTECTED]
[PATCH] uml: cpu_relax fix
Use rep_nop instead of barrier for cpu_relax, following $(SUBARCH)'s
doing
that (i.e. i386 and x86_64).
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
processor-generic.h | 2 --
processor-i386.h | 8 ++++++++
processor-x86_64.h | 8 ++++++++
3 files changed, 16 insertions(+), 2 deletions(-)
diff -Nru a/include/asm-um/processor-generic.h
b/include/asm-um/processor-generic.h
--- a/include/asm-um/processor-generic.h 2005-03-28 21:29:34 -08:00
+++ b/include/asm-um/processor-generic.h 2005-03-28 21:29:34 -08:00
@@ -16,8 +16,6 @@
struct mm_struct;
-#define cpu_relax() barrier()
-
struct thread_struct {
int forking;
int nsyscalls;
diff -Nru a/include/asm-um/processor-i386.h b/include/asm-um/processor-i386.h
--- a/include/asm-um/processor-i386.h 2005-03-28 21:29:34 -08:00
+++ b/include/asm-um/processor-i386.h 2005-03-28 21:29:34 -08:00
@@ -19,6 +19,14 @@
#include "asm/arch/user.h"
+/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
+static inline void rep_nop(void)
+{
+ __asm__ __volatile__("rep;nop": : :"memory");
+}
+
+#define cpu_relax() rep_nop()
+
/*
* Default implementation of macro that returns current
* instruction pointer ("program counter"). Stolen
diff -Nru a/include/asm-um/processor-x86_64.h
b/include/asm-um/processor-x86_64.h
--- a/include/asm-um/processor-x86_64.h 2005-03-28 21:29:34 -08:00
+++ b/include/asm-um/processor-x86_64.h 2005-03-28 21:29:34 -08:00
@@ -12,6 +12,14 @@
struct arch_thread {
};
+/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
+extern inline void rep_nop(void)
+{
+ __asm__ __volatile__("rep;nop": : :"memory");
+}
+
+#define cpu_relax() rep_nop()
+
#define INIT_ARCH_THREAD { }
#define current_text_addr() \
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html