Skip to contentSkip to conversation

Perf-tool/MIPS: support cross compiling of tools/perf for MIPS

PATCH RESEND New Deng-Cheng Zhu 1 participant 1 message Oct 11, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v3 1/1 Perf-tool/MIPS: support cross compiling of tools/perf for MIPS

(Resending this version of patch to append the changelogs.)

This version fixed the cosmetic issue pointed out by Ralf. If it looks ok,

Ralf, please help Ack it. Thanks!

Changes
--------
v3 - v2:
o Fix the cosmetic issue of redundant dot-ops

v2 - v1:
o Change rmb() to use SYNC

v1:
o Include mips unistd.h and define rmb()/cpu_relax() in tools/perf/perf.h

---
 tools/perf/perf.h |   12 ++++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
tools/perf/perf.h +12 -0
index 6fb379b..cd05284 100644
@@ -73,6 +73,18 @@
 #define cpu_relax()	asm volatile("":::"memory")
 #endif
 
+#ifdef __mips__
+#include "../../arch/mips/include/asm/unistd.h"
+#define rmb()		asm volatile(					\
+				".set	mips2\n\t"			\
+				"sync\n\t"				\
+				".set	mips0"				\
+				: /* no output */			\
+				: /* no input */			\
+				: "memory")
+#define cpu_relax()	asm volatile("" ::: "memory")
+#endif
+
 #include<time.h>
 #include<unistd.h>
 #include<sys/types.h>