From bc5fda682bbe08bfa33c5c8b6ab2de02621a4131 Mon Sep 17 00:00:00 2001 From: Pablo Tesone Date: Mon, 28 Nov 2022 15:21:23 +0100 Subject: [PATCH] Implementation for ARM64 Unix --- extracted/vm/src/common/heartbeat.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extracted/vm/src/common/heartbeat.c b/extracted/vm/src/common/heartbeat.c index e40b94788b..4f74ca8d4d 100644 --- a/extracted/vm/src/common/heartbeat.c +++ b/extracted/vm/src/common/heartbeat.c @@ -223,7 +223,11 @@ ioHighResClock(void) : "=a" (value) : : "rdx"); -#elif (defined(__arm__) && (defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__))) || defined(__aarch64__) || defined(_M_ARM64) +#elif defined(__GNUC__) && defined(__aarch64__) + + __asm__ __volatile__("mrs %0, cntvct_el0" : "=r"(value)); + +#elif (defined(__arm__) && (defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__))) /* tpr - do nothing for now; needs input from eliot to decide further */ /* Tim, not sure I have input beyond: Is there a 64-bit clock on ARM? If so, access it here :-)