xref: /linux/arch/x86/include/asm/clock_inlined.h (revision aec2f682d47c54ef434b2d440992626d80b1ebdc)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_CLOCK_INLINED_H
3 #define _ASM_X86_CLOCK_INLINED_H
4 
5 #include <asm/tsc.h>
6 
7 struct clocksource;
8 
9 static __always_inline u64 arch_inlined_clocksource_read(struct clocksource *cs)
10 {
11 	return (u64)rdtsc_ordered();
12 }
13 
14 struct clock_event_device;
15 
16 static __always_inline void
17 arch_inlined_clockevent_set_next_coupled(u64 cycles, struct clock_event_device *evt)
18 {
19 	native_wrmsrq(MSR_IA32_TSC_DEADLINE, cycles);
20 }
21 
22 #endif
23