mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
hgext3rd: fix build on aarch64
Summary: On aarch64, use `rdtsc` equivalent. Test Plan: built on aarch64 Reviewers: durham, rmcelroy, tracelog, phillco, quark Reviewed By: tracelog, quark Subscribers: medson, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D6368688 Tags: aarch64 Signature: 6368688:1511039472:9b26a569ca1f185d6652ac8fb0c3c5a5d306b0cc
This commit is contained in:
parent
5b16b0ac57
commit
ab16183253
@ -84,9 +84,15 @@ static double rdtscratio; /* set by disable() */
|
||||
|
||||
/* fast way to get wall time */
|
||||
inline static rdtsc_t rdtsc() {
|
||||
#ifdef __aarch64__
|
||||
unsigned long long val;
|
||||
asm volatile("mrs %0, cntvct_el0" : "=r" (val));
|
||||
return val;
|
||||
#else
|
||||
unsigned long lo, hi;
|
||||
asm volatile ("rdtsc" : "=a" (lo), "=d" (hi));
|
||||
return (rdtsc_t)(lo | (hi << 32));
|
||||
#endif
|
||||
}
|
||||
|
||||
/* fast, but inaccurate hashing of a Python frame */
|
||||
|
Loading…
Reference in New Issue
Block a user