aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-dbs/rocksdb/files/0004-Implement-support-for-musl-ppc64.patch
blob: 5fcf1f7daed2a4a0f02291d871d7a820c6fa7d7f (plain)
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
39
40
41
42
From c6accd34e8169d7a6b92fc89dce5d4309978e39e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 21 Mar 2024 14:11:09 +0800
Subject: [PATCH] Implement support for musl/ppc64

Upstream-Status: Pending

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 9b83c53511..0a7488c397 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");
-- 
2.25.1