From: Jens Axboe Date: Fri, 11 Feb 2022 13:58:12 +0000 (-0700) Subject: Add aarch64 cpu clock support X-Git-Tag: fio-3.30~50 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=f57a3a31c8d074b309f797a4336101e4c1e5ed39;p=fio.git Add aarch64 cpu clock support We can use cntvct_el0 to read the CPU clock. Signed-off-by: Jens Axboe --- diff --git a/arch/arch-aarch64.h b/arch/arch-aarch64.h index 2a86cc5a..94571709 100644 --- a/arch/arch-aarch64.h +++ b/arch/arch-aarch64.h @@ -27,4 +27,21 @@ static inline int arch_ffz(unsigned long bitmask) #define ARCH_HAVE_FFZ +static inline unsigned long long get_cpu_clock(void) +{ + unsigned long val; + + asm volatile("mrs %0, cntvct_el0" : "=r" (val)); + return val; +} +#define ARCH_HAVE_CPU_CLOCK + +#define ARCH_HAVE_INIT +extern bool tsc_reliable; +static inline int arch_init(char *envp[]) +{ + tsc_reliable = true; + return 0; +} + #endif