xref: /openbmc/linux/arch/x86/include/asm/kvmclock.h (revision ad9af930)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2f4066c2bSMarcelo Tosatti #ifndef _ASM_X86_KVM_CLOCK_H
3f4066c2bSMarcelo Tosatti #define _ASM_X86_KVM_CLOCK_H
4f4066c2bSMarcelo Tosatti 
5*ad9af930SZelin Deng #include <linux/percpu.h>
6*ad9af930SZelin Deng 
7f4066c2bSMarcelo Tosatti extern struct clocksource kvm_clock;
8f4066c2bSMarcelo Tosatti 
9*ad9af930SZelin Deng DECLARE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu);
10*ad9af930SZelin Deng 
11*ad9af930SZelin Deng static inline struct pvclock_vcpu_time_info *this_cpu_pvti(void)
12*ad9af930SZelin Deng {
13*ad9af930SZelin Deng 	return &this_cpu_read(hv_clock_per_cpu)->pvti;
14*ad9af930SZelin Deng }
15*ad9af930SZelin Deng 
16*ad9af930SZelin Deng static inline struct pvclock_vsyscall_time_info *this_cpu_hvclock(void)
17*ad9af930SZelin Deng {
18*ad9af930SZelin Deng 	return this_cpu_read(hv_clock_per_cpu);
19*ad9af930SZelin Deng }
20*ad9af930SZelin Deng 
21f4066c2bSMarcelo Tosatti #endif /* _ASM_X86_KVM_CLOCK_H */
22