audio/ardour: fix build on powerpc64*

In file included from ../libs/ardour/ardour/plugin.h:37:
../libs/ardour/ardour/cycles.h:75:10: fatal error: 'sys/platform/ppc.h' file not found
This commit is contained in:
Piotr Kubaj 2023-01-03 18:42:36 +01:00
parent ec6fc486ac
commit 3729900bf2

View File

@ -0,0 +1,25 @@
--- libs/ardour/ardour/cycles.h.orig 2023-01-03 16:39:59 UTC
+++ libs/ardour/ardour/cycles.h
@@ -72,12 +72,22 @@ static inline cycles_t get_cycles (void)
#elif defined(__powerpc64__)
+#ifdef __linux__
#include <sys/platform/ppc.h>
typedef uint64_t cycles_t;
static inline cycles_t get_cycles(void)
{
return __ppc_get_timebase();
}
+#elif defined(__FreeBSD__)
+typedef uint64_t cycles_t;
+static inline cycles_t get_cycles(void)
+{
+ cycles_t tbr;
+ asm volatile("mfspr %0, 268" : "=r"(tbr));
+ return tbr;
+}
+#endif
#elif defined(__powerpc__)