projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
71989c1
)
Add aarch64 cpu clock support
author
Jens Axboe
<axboe@kernel.dk>
Fri, 11 Feb 2022 13:58:12 +0000
(06:58 -0700)
committer
Jens Axboe
<axboe@kernel.dk>
Fri, 11 Feb 2022 13:58:12 +0000
(06:58 -0700)
We can use cntvct_el0 to read the CPU clock.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
arch/arch-aarch64.h
patch
|
blob
|
blame
|
history
diff --git
a/arch/arch-aarch64.h
b/arch/arch-aarch64.h
index 2a86cc5ab4d9b9cb1bef2dcf5d0aab24bfc38fb8..94571709eb2756d41a921f981b669ae27ee7b1ae 100644
(file)
--- 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
#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
#endif