mcst-linux-kernel/patches-2024.06.26/fftw3-3.3.8/0002-define-cycles-for-e2k-...

25 lines
637 B
Diff

Link:
Subject: define ticks counter for e2k
Bug: 135933
Tags: e2k
diff -rupN a/kernel/cycle.h b/kernel/cycle.h
--- a/kernel/cycle.h 2021-12-23 13:44:48.502385837 +0300
+++ b/kernel/cycle.h 2021-12-23 17:31:59.911205813 +0300
@@ -562,3 +562,15 @@ static inline ticks getticks(void)
INLINE_ELAPSED(inline)
#define HAVE_TICK_COUNTER
#endif
+
+#if defined(__e2k__) && !defined(HAVE_TICK_COUNTER)
+typedef unsigned long long ticks;
+static inline ticks getticks(void)
+{
+ ticks ret;
+ __asm__ __volatile__( "rrd %%clkr, %0" :"=r"( ret ) );
+ return ret;
+}
+INLINE_ELAPSED(inline)
+#define HAVE_TICK_COUNTER
+#endif