xref: /kvm-unit-tests/lib/riscv/asm/timer.h (revision 93bcbb0982adb2d83a524a3f8026c5a6c101e143)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef _ASMRISCV_TIMER_H_
3 #define _ASMRISCV_TIMER_H_
4 
5 #include <asm/csr.h>
6 
7 extern void timer_get_frequency(void);
8 
9 static inline uint64_t timer_get_cycles(void)
10 {
11 	return csr_read(CSR_TIME);
12 }
13 
14 #endif /* _ASMRISCV_TIMER_H_ */
15