summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/time.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/time.h')
-rw-r--r--src/vppinfra/time.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vppinfra/time.h b/src/vppinfra/time.h
index 39bc188ebe5..ced9677d1e2 100644
--- a/src/vppinfra/time.h
+++ b/src/vppinfra/time.h
@@ -174,6 +174,16 @@ clib_cpu_time_now (void)
return ((u64) h << 32) | l;
}
+#elif defined(_mips) && __mips == 64
+
+always_inline u64
+clib_cpu_time_now (void)
+{
+ u64 result;
+ asm volatile ("rdhwr %0,$31\n":"=r" (result));
+ return result;
+}
+
#else
#error "don't know how to read CPU time stamp"