1 #ifndef _ASM_X86_PVCLOCK_H
2 #define _ASM_X86_PVCLOCK_H
4 #include <linux/clocksource.h>
5 #include <asm/pvclock-abi.h>
7 /* some helper functions for xen and kvm pv clock sources */
8 cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src);
9 void pvclock_set_flags(u8 flags);
10 unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src);
11 void pvclock_read_wallclock(struct pvclock_wall_clock *wall,
12 struct pvclock_vcpu_time_info *vcpu,
16 * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
17 * yielding a 64-bit result.
19 static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift)
40 : "=A" (product), "=r" (tmp1), "=r" (tmp2)
41 : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
42 #elif defined(__x86_64__)
44 "mul %%rdx ; shrd $32,%%rdx,%%rax"
45 : "=a" (product) : "0" (delta), "d" ((u64)mul_frac) );
53 #endif /* _ASM_X86_PVCLOCK_H */