Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 1 | implement support for musl/ppc64 |
| 2 | |
| 3 | Signed-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; |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame^] | 17 | __asm __volatile__("mrs %[rt], cntvct_el0" : [rt] "=r"(result)); |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 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; |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 26 | #elif defined(__s390x__) |
| 27 | uint64_t result; |
| 28 | asm volatile("stckf %0" : "=Q"(result) : : "cc"); |