perf_counter tools: add cpu_relax()/rmb() definitions for sh.
authorPaul Mundt <lethal@linux-sh.org>
Thu, 25 Jun 2009 05:41:57 +0000 (14:41 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Thu, 25 Jun 2009 05:41:57 +0000 (14:41 +0900)
Simple cpu_relax()/rmb() stubs that perf needs, which were inadvertently
omitted from the sh HAVE_PERF_COUNTERS patch.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
tools/perf/perf.h

index ceb68aa51f7f5eaeaa109a250ac0ceb9ddc68665..f735b6924a2f2f9a906f6a1607e22af5601d4edc 100644 (file)
 #define cpu_relax()    asm volatile("" ::: "memory");
 #endif
 
+#ifdef __sh__
+#include "../../arch/sh/include/asm/unistd.h"
+#if defined(__SH4A__) || defined(__SH5__)
+# define rmb()         asm volatile("synco" ::: "memory")
+#else
+# define rmb()         asm volatile("" ::: "memory")
+#endif
+#define cpu_relax()    asm volatile("" ::: "memory")
+#endif
+
 #include <time.h>
 #include <unistd.h>
 #include <sys/types.h>