aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-06-16 23:28:09 -0700
committerKhem Raj <raj.khem@gmail.com>2021-06-18 08:42:25 -0700
commit4f5b55896b9288e39870537700f2b0fff67a6531 (patch)
tree451b00cb0b9bce408a177492ccb1bbae74ea6a7e
parent3c1e72d62ccf2c2f94bf280a2500e23fdb01a57c (diff)
downloadmeta-openembedded-contrib-4f5b55896b9288e39870537700f2b0fff67a6531.tar.gz
meta-openembedded-contrib-4f5b55896b9288e39870537700f2b0fff67a6531.tar.bz2
meta-openembedded-contrib-4f5b55896b9288e39870537700f2b0fff67a6531.zip
rocksdb: Implement timer for mips
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/mips.patch19
-rw-r--r--meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb1
2 files changed, 20 insertions, 0 deletions
diff --git a/meta-oe/recipes-dbs/rocksdb/files/mips.patch b/meta-oe/recipes-dbs/rocksdb/files/mips.patch
new file mode 100644
index 0000000000..db2305d296
--- /dev/null
+++ b/meta-oe/recipes-dbs/rocksdb/files/mips.patch
@@ -0,0 +1,19 @@
+implement timer implementation for mips platform
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+--- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
++++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
+@@ -155,7 +155,12 @@ static inline tokutime_t toku_time_now(v
+ __asm __volatile__("rdcycle %0" : "=r"(result));
+ return result;
+ #endif
+-
++#elif defined(__mips__)
++ // mips apparently only allows rdtsc for superusers, so we fall
++ // back to gettimeofday. It's possible clock_gettime would be better.
++ struct timeval tv;
++ gettimeofday(&tv, nullptr);
++ return (uint64_t)tv.tv_sec * 1000000 + tv.tv_usec;
+ #else
+ #error No timer implementation for this platform
+ #endif
diff --git a/meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb b/meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb
index d03d0c9529..6516edade6 100644
--- a/meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb
+++ b/meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb
@@ -16,6 +16,7 @@ SRC_URI = "git://github.com/facebook/${BPN}.git;branch=${SRCBRANCH} \
file://0001-jemalloc_helper-Limit-the-mm_malloc.h-hack-to-glibc-.patch \
file://0001-range_tree-Implement-toku_time_now-for-rv32-rv64-in-.patch \
file://ppc64.patch \
+ file://mips.patch \
"
S = "${WORKDIR}/git"