x86: pvclock: Move scale_delta into common header
The scale_delta function for shift / multiply with 31-bit precision moves to a common header so it can be used by both kernel and kvm module. Signed-off-by: Zachary Amsden <zamsden@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
committed by
Avi Kivity
parent
ca84d1a24c
commit
347bb4448c
@@ -82,7 +82,8 @@ static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift)
|
||||
static u64 pvclock_get_nsec_offset(struct pvclock_shadow_time *shadow)
|
||||
{
|
||||
u64 delta = native_read_tsc() - shadow->tsc_timestamp;
|
||||
return scale_delta(delta, shadow->tsc_to_nsec_mul, shadow->tsc_shift);
|
||||
return pvclock_scale_delta(delta, shadow->tsc_to_nsec_mul,
|
||||
shadow->tsc_shift);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user