Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
aarch64 CPU arch / ThunderX platform initial support
[vpp.git]
/
vppinfra
/
vppinfra
/
time.h
diff --git
a/vppinfra/vppinfra/time.h
b/vppinfra/vppinfra/time.h
index
524eff6
..
3c48108
100644
(file)
--- a/
vppinfra/vppinfra/time.h
+++ b/
vppinfra/vppinfra/time.h
@@
-143,8
+143,18
@@
always_inline u64 clib_cpu_time_now (void)
return ((u64)h << 32) | l;
}
return ((u64)h << 32) | l;
}
-#else
+#elif defined (__aarch64__)
+always_inline u64 clib_cpu_time_now (void)
+{
+ u64 tsc;
+
+ /* Works on Cavium ThunderX. Other platforms: YMMV */
+ asm volatile("mrs %0, cntvct_el0" : "=r" (tsc));
+ return tsc;
+}
+
+#else
#error "don't know how to read CPU time stamp"
#endif
#error "don't know how to read CPU time stamp"
#endif