void-packages/srcpkgs/rocksdb/patches/toku_time.patch

27 lines
1010 B
Diff

--- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
+++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
@@ -58,9 +58,6 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
#include <stdint.h>
#include <sys/time.h>
#include <time.h>
-#if defined(__powerpc__)
-#include <sys/platform/ppc.h>
-#endif
#if 0
static inline float toku_tdiff (struct timeval *a, struct timeval *b) {
@@ -131,8 +128,12 @@ static inline tokutime_t toku_time_now(void) {
uint64_t result;
__asm __volatile__("mrs %[rt], cntvct_el0" : [ rt ] "=r"(result));
return result;
+#elif defined(__arm__)
+ uint32_t lo, hi;
+ __asm __volatile__("mrrc p15, 1, %[lo], %[hi], c14" : [ lo ] "=r" (lo), [hi] "=r" (hi));
+ return (uint64_t)hi << 32 | lo;
#elif defined(__powerpc__)
- return __ppc_get_timebase();
+ return __builtin_ppc_get_timebase();
#elif defined(__s390x__)
uint64_t result;
asm volatile("stckf %0" : "=Q"(result) : : "cc");