diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-06-16 23:36:36 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-06-18 08:42:25 -0700 |
commit | 5cb17dac6cda8505408618d83b887aa875b790ff (patch) | |
tree | 76997367974826a83f3d221459b8902a29c9134e /meta-oe/recipes-dbs | |
parent | 4f5b55896b9288e39870537700f2b0fff67a6531 (diff) | |
download | meta-openembedded-5cb17dac6cda8505408618d83b887aa875b790ff.tar.gz |
rocksdb: Implement timer for armv6+
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-dbs')
-rw-r--r-- | meta-oe/recipes-dbs/rocksdb/files/arm.patch | 26 | ||||
-rw-r--r-- | meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb | 1 |
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 0000000000..d428a6624a --- /dev/null +++ b/meta-oe/recipes-dbs/rocksdb/files/arm.patch @@ -0,0 +1,26 @@ +implement timer for arm >= v6 + +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 +@@ -161,6 +161,20 @@ static inline tokutime_t toku_time_now(v + struct timeval tv; + gettimeofday(&tv, nullptr); + return (uint64_t)tv.tv_sec * 1000000 + tv.tv_usec; ++#elif (__ARM_ARCH >= 6) ++ uint32_t pmccntr; ++ uint32_t pmuseren; ++ uint32_t pmcntenset; ++ // Read the user mode perf monitor counter access permissions. ++ asm volatile("mrc p15, 0, %0, c9, c14, 0" : "=r"(pmuseren)); ++ if (pmuseren & 1) { // Allows reading perfmon counters for user mode code. ++ asm volatile("mrc p15, 0, %0, c9, c12, 1" : "=r"(pmcntenset)); ++ if (pmcntenset & 0x80000000ul) { // Is it counting? ++ asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(pmccntr)); ++ // The counter is set up to count every 64th cycle ++ return (uint64_t)pmccntr * 64; // Should optimize to << 6 ++ } ++ } + #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 6516edade6..99bfdd4264 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} \ file://0001-range_tree-Implement-toku_time_now-for-rv32-rv64-in-.patch \ file://ppc64.patch \ file://mips.patch \ + file://arm.patch \ " S = "${WORKDIR}/git" |