blob: bc40f1b1e72290036a4a0d8bcfdbfee85eb60782 [file] [log] [blame]
Andrew Geissler69721092021-07-23 12:57:00 -04001implement support for musl/ppc64
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4--- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
5+++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
6@@ -58,7 +58,7 @@ Copyright (c) 2006, 2015, Percona and/or
7 #include <stdint.h>
8 #include <sys/time.h>
9 #include <time.h>
10-#if defined(__powerpc__)
11+#if defined(__powerpc__) && defined(__GLIBC__)
12 #include <sys/platform/ppc.h>
13 #endif
14
15@@ -131,8 +131,12 @@ static inline tokutime_t toku_time_now(v
16 uint64_t result;
17 __asm __volatile__("mrs %[rt], cntvct_el0" : [ rt ] "=r"(result));
18 return result;
19-#elif defined(__powerpc__)
20+#elif defined(__powerpc__) && defined(__GLIBC__)
21 return __ppc_get_timebase();
22+#elif defined(__powerpc64__) || defined(__ppc64__)
23+ uint64_t result;
24+ asm volatile("mfspr %0, 268" : "=r"(result));
25+ return result;
26 #elif defined(__riscv) // RISC-V
27 #if __riscv_xlen == 32
28 uint32_t lo, hi0, hi1;