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