xref: /linux/arch/x86/include/asm/clocksource.h (revision f86fd32db706613fe8d0104057efa6e83e0d7e8f)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* x86-specific clocksource additions */
3 
4 #ifndef _ASM_X86_CLOCKSOURCE_H
5 #define _ASM_X86_CLOCKSOURCE_H
6 
7 #define VDSO_ARCH_CLOCKMODES	\
8 	VDSO_CLOCKMODE_TSC,	\
9 	VDSO_CLOCKMODE_PVCLOCK,	\
10 	VDSO_CLOCKMODE_HVCLOCK
11 
12 extern unsigned int vclocks_used;
13 
14 static inline bool vclock_was_used(int vclock)
15 {
16 	return READ_ONCE(vclocks_used) & (1U << vclock);
17 }
18 
19 static inline void vclocks_set_used(unsigned int which)
20 {
21 	WRITE_ONCE(vclocks_used, READ_ONCE(vclocks_used) | (1 << which));
22 }
23 
24 #endif /* _ASM_X86_CLOCKSOURCE_H */
25