Skip to content

Commit

Permalink
audio/ardour: fix build on powerpc64*
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pkubaj committed Jan 3, 2023
1 parent ec6fc48 commit 3729900
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions audio/ardour/files/patch-libs_ardour_ardour_cycles.h
Original file line number Diff line number Diff line change
@@ -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__)

0 comments on commit 3729900

Please sign in to comment.