aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vppinfra/time.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vppinfra/time.c b/src/vppinfra/time.c
index 2bdb9da4b39..168d7375915 100644
--- a/src/vppinfra/time.c
+++ b/src/vppinfra/time.c
@@ -147,6 +147,12 @@ os_cpu_clock_frequency (void)
if (clib_cpu_supports_invariant_tsc ())
return estimate_clock_frequency (1e-3);
+#if defined (__aarch64__)
+ u64 tsc;
+ asm volatile ("mrs %0, CNTFRQ_EL0":"=r" (tsc));
+ return (f64) tsc;
+#endif
+
/* First try /sys version. */
cpu_freq = clock_frequency_from_sys_filesystem ();
if (cpu_freq != 0)