File: ppc64.patch

package info (click to toggle)
rocksdb 9.11.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 46,252 kB
  • sloc: cpp: 503,390; java: 43,039; ansic: 9,834; python: 8,381; perl: 5,822; sh: 4,921; makefile: 2,386; asm: 550; xml: 342
file content (38 lines) | stat: -rw-r--r-- 1,462 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: "Laszlo Boszormenyi (GCS)" <gcs@debian.org>
Date: Sun, 24 Nov 2024 23:29:28 -0800
Subject: ppc64

implement support for musl/ppc64

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../lock/range/range_tree/lib/portability/toku_time.h             | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
index 8a9769d..9e8eb2b 100644
--- 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,7 +58,7 @@ 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__)
+#if defined(__powerpc__) && defined(__GLIBC__)
 #include <sys/platform/ppc.h>
 #endif
 
@@ -131,8 +131,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(__powerpc__)
+#elif defined(__powerpc__) && defined(__GLIBC__)
   return __ppc_get_timebase();
+#elif defined(__powerpc64__) || defined(__ppc64__)
+  uint64_t result;
+  asm volatile("mfspr %0, 268" : "=r"(result));
+  return result;
 #elif defined(__s390x__)
   uint64_t result;
   asm volatile("stckf %0" : "=Q"(result) : : "cc");