summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/arm.patch26
-rw-r--r--meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb1
2 files changed, 27 insertions, 0 deletions
diff --git a/meta-oe/recipes-dbs/rocksdb/files/arm.patch b/meta-oe/recipes-dbs/rocksdb/files/arm.patch
new file mode 100644
index 000000000..d428a6624
--- /dev/null
+++ b/meta-oe/recipes-dbs/rocksdb/files/arm.patch
@@ -0,0 +1,26 @@
1implement timer for arm >= v6
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4--- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
5+++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
6@@ -161,6 +161,20 @@ static inline tokutime_t toku_time_now(v
7 struct timeval tv;
8 gettimeofday(&tv, nullptr);
9 return (uint64_t)tv.tv_sec * 1000000 + tv.tv_usec;
10+#elif (__ARM_ARCH >= 6)
11+ uint32_t pmccntr;
12+ uint32_t pmuseren;
13+ uint32_t pmcntenset;
14+ // Read the user mode perf monitor counter access permissions.
15+ asm volatile("mrc p15, 0, %0, c9, c14, 0" : "=r"(pmuseren));
16+ if (pmuseren & 1) { // Allows reading perfmon counters for user mode code.
17+ asm volatile("mrc p15, 0, %0, c9, c12, 1" : "=r"(pmcntenset));
18+ if (pmcntenset & 0x80000000ul) { // Is it counting?
19+ asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(pmccntr));
20+ // The counter is set up to count every 64th cycle
21+ return (uint64_t)pmccntr * 64; // Should optimize to << 6
22+ }
23+ }
24 #else
25 #error No timer implementation for this platform
26 #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 6516edade..99bfdd426 100644
--- a/meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb
+++ b/meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb
@@ -17,6 +17,7 @@ SRC_URI = "git://github.com/facebook/${BPN}.git;branch=${SRCBRANCH} \
17 file://0001-range_tree-Implement-toku_time_now-for-rv32-rv64-in-.patch \ 17 file://0001-range_tree-Implement-toku_time_now-for-rv32-rv64-in-.patch \
18 file://ppc64.patch \ 18 file://ppc64.patch \
19 file://mips.patch \ 19 file://mips.patch \
20 file://arm.patch \
20 " 21 "
21 22
22S = "${WORKDIR}/git" 23S = "${WORKDIR}/git"