diff options
| author | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2021-10-25 23:05:26 +0800 | 
|---|---|---|
| committer | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2021-10-25 23:57:13 +0800 | 
| commit | f9c44858605e6cc3af07fb61006dfd7a86d694f9 (patch) | |
| tree | 34970e9ffae6920e0914f54d4917617ac295f491 /databases/rocksdb/files/patch-powerpc64 | |
| parent | databases/pldebugger: Do not silence installation message (diff) | |
databases/rocksdb: Move architecture-specific fixes into single patch file
- patch-aarch64 is merged from:
  - patch-CMakeLists.txt
  - patch-build_tools-build_detect_platform (part of)
- patch-powerpc64 is merged from:
  - patch-util_crc32c.cc
  - patch-utilities_transactions_lock_range_range__tree_lib_portability_toku__time.h
Diffstat (limited to 'databases/rocksdb/files/patch-powerpc64')
| -rw-r--r-- | databases/rocksdb/files/patch-powerpc64 | 49 | 
1 files changed, 49 insertions, 0 deletions
| diff --git a/databases/rocksdb/files/patch-powerpc64 b/databases/rocksdb/files/patch-powerpc64 new file mode 100644 index 000000000000..16673cc4ae42 --- /dev/null +++ b/databases/rocksdb/files/patch-powerpc64 @@ -0,0 +1,49 @@ +--- util/crc32c.cc.orig	2021-06-25 21:15:04 UTC ++++ util/crc32c.cc +@@ -488,6 +488,21 @@ static int arch_ppc_probe(void) { +  +   return arch_ppc_crc32; + } ++#elif __FreeBSD__ ++#include <machine/cpu.h> ++#include <sys/auxv.h> ++#include <sys/elf_common.h> ++static int arch_ppc_probe(void) { ++  unsigned long cpufeatures; ++  arch_ppc_crc32 = 0; ++ ++#if defined(__powerpc64__) ++  elf_aux_info(AT_HWCAP2, &cpufeatures, sizeof(cpufeatures)); ++  if (cpufeatures & PPC_FEATURE2_HAS_VEC_CRYPTO) arch_ppc_crc32 = 1; ++#endif  /* __powerpc64__ */ ++ ++  return arch_ppc_crc32; ++} + #endif  // __linux__ +  + static bool isAltiVec() { +--- utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h.orig	2021-10-17 17:02:20 UTC ++++ utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h +@@ -58,7 +58,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliate + #include <stdint.h> + #include <sys/time.h> + #include <time.h> +-#if defined(__powerpc__) ++#if defined(__powerpc__) && defined(__linux__) + #include <sys/platform/ppc.h> + #endif +  +@@ -132,7 +132,13 @@ static inline tokutime_t toku_time_now(void) { +   __asm __volatile__("mrs %[rt], cntvct_el0" : [ rt ] "=r"(result)); +   return result; + #elif defined(__powerpc__) ++#ifdef __linux__ +   return __ppc_get_timebase(); ++#elif defined(__FreeBSD__) ++  int64_t tbr; ++  asm volatile("mfspr %0, 268" : "=r"(tbr)); ++  return tbr; ++#endif + #else + #error No timer implementation for this platform + #endif | 
