aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/time.h
diff options
context:
space:
mode:
authorCarl Smith <carl.smith@alliedtelesis.co.nz>2018-07-26 15:45:28 +1200
committerDave Barach <openvpp@barachs.net>2018-07-27 12:04:37 +0000
commit28d4271d1a9103099e6711fc58f9a479c8722e60 (patch)
tree40839c9981cbcf4e14585c118955d28993c407f9 /src/vppinfra/time.h
parentfc5dda3d0a96fd9722cdac055dfa4865823d5ebd (diff)
mips64: Add timer and longjump support
Also correct types.h for mips64 which could never be hit as _mips was part of the previous ifdef. Change-Id: Id0435c8fc960c5d25c43129b9d9f1606e39ba8e3 Signed-off-by: Carl Smith <carl.smith@alliedtelesis.co.nz>
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"