diff options
author | 2016-01-22 08:23:09 -0500 | |
---|---|---|
committer | 2016-01-22 08:23:27 -0500 | |
commit | 61efa140b1f44e0c568697fbc31cf3f430131ab2 (patch) | |
tree | 780880f2fce0882840b204eb26bd7465ed7c7e09 /vppinfra/vppinfra/time.h | |
parent | bfdedbd5a3ba7e6fdc036d212253aa55c9062211 (diff) |
aarch64 CPU arch / ThunderX platform initial support
Change-Id: Ia2edd3cee2c25c26c7c47a9023744b97226434c7
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vppinfra/vppinfra/time.h')
-rw-r--r-- | vppinfra/vppinfra/time.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/vppinfra/vppinfra/time.h b/vppinfra/vppinfra/time.h index 524eff6c7a1..3c481082ced 100644 --- 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; } -#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 |