mirror of https://gerrit.osmocom.org/gapk
aarch64: add get_cycles
borrowed from arch/arm64/include/asm/arch_timer.h Change-Id: I489fb8346fbc7440f40695f01d80a89b90761165
This commit is contained in:
parent
ed469d82a0
commit
2d5fbe439b
|
@ -0,0 +1 @@
|
|||
--ignore NEW_TYPEDEFS
|
|
@ -103,6 +103,16 @@ static inline cycles_t get_cycles()
|
|||
#endif
|
||||
return ret & ~TICK_PRIV_BIT;
|
||||
}
|
||||
#elif defined(__aarch64__)
|
||||
|
||||
typedef unsigned long cycles_t;
|
||||
static inline cycles_t get_cycles(void)
|
||||
{
|
||||
cycles_t cval;
|
||||
asm volatile("isb" : : : "memory");
|
||||
asm volatile("mrs %0, cntvct_el0" : "=r" (cval));
|
||||
return cval;
|
||||
}
|
||||
#elif defined(__PPC__)
|
||||
#define CPU_FTR_601 0x00000100
|
||||
typedef unsigned long cycles_t;
|
||||
|
|
Loading…
Reference in New Issue