vppinfra - ARM: cycle count 64bits register is only available on ARMv8
Change-Id: I7d622e591020a482af68667f4d1ed2056258d2c8 Signed-off-by: Christophe Fontaine <christophe.fontaine@qosmos.com>
This commit is contained in:

committed by
Damjan Marion

parent
862623da6e
commit
9341a1f850
@ -113,13 +113,20 @@ always_inline u64 clib_cpu_time_now (void)
|
||||
}
|
||||
|
||||
#elif defined (__arm__)
|
||||
#if defined(__ARM_ARCH_7A__)
|
||||
always_inline u64 clib_cpu_time_now (void)
|
||||
#if defined(__ARM_ARCH_8A__)
|
||||
always_inline u64 clib_cpu_time_now (void) /* We may run arm64 in aarch32 mode, to leverage 64bit counter */
|
||||
{
|
||||
u64 tsc;
|
||||
asm volatile("mrrc p15, 0, %Q0, %R0, c9" : "=r" (tsc));
|
||||
return tsc;
|
||||
}
|
||||
#elif defined(__ARM_ARCH_7A__)
|
||||
always_inline u64 clib_cpu_time_now (void)
|
||||
{
|
||||
u32 tsc;
|
||||
asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (tsc));
|
||||
return (u64)tsc;
|
||||
}
|
||||
#else
|
||||
always_inline u64 clib_cpu_time_now (void)
|
||||
{
|
||||
|
Reference in New Issue
Block a user