Skip to content

Commit febe834

Browse files
committed
perf_counter tools: add cpu_relax()/rmb() definitions for sh.
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>
1 parent 163b2f0 commit febe834

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎tools/perf/perf.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@
1919
#define cpu_relax() asm volatile("" ::: "memory");
2020
#endif
2121

22+
#ifdef __sh__
23+
#include "../../arch/sh/include/asm/unistd.h"
24+
#if defined(__SH4A__) || defined(__SH5__)
25+
# define rmb() asm volatile("synco" ::: "memory")
26+
#else
27+
# define rmb() asm volatile("" ::: "memory")
28+
#endif
29+
#define cpu_relax() asm volatile("" ::: "memory")
30+
#endif
31+
2232
#include <time.h>
2333
#include <unistd.h>
2434
#include <sys/types.h>

0 commit comments

Comments
 (0)