Loading...
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#include <asm/vdso/clocksource.h>
8
9extern unsigned int vclocks_used;
10
11static inline bool vclock_was_used(int vclock)
12{
13 return READ_ONCE(vclocks_used) & (1U << vclock);
14}
15
16static inline void vclocks_set_used(unsigned int which)
17{
18 WRITE_ONCE(vclocks_used, READ_ONCE(vclocks_used) | (1 << which));
19}
20
21#endif /* _ASM_X86_CLOCKSOURCE_H */
1/* x86-specific clocksource additions */
2
3#ifndef _ASM_X86_CLOCKSOURCE_H
4#define _ASM_X86_CLOCKSOURCE_H
5
6#define VCLOCK_NONE 0 /* No vDSO clock available. */
7#define VCLOCK_TSC 1 /* vDSO should use vread_tsc. */
8#define VCLOCK_HPET 2 /* vDSO should use vread_hpet. */
9#define VCLOCK_PVCLOCK 3 /* vDSO should use vread_pvclock. */
10#define VCLOCK_MAX 3
11
12struct arch_clocksource_data {
13 int vclock_mode;
14};
15
16#endif /* _ASM_X86_CLOCKSOURCE_H */