x86, pvclock: Remove leftover scale_delta() function
Commit 92580d64e16402762e2acc3022f065397c780425 ("x86: pvclock: Move scale_delta into common header") forgot to remove scale_delta. Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp> Cc: Zachary Amsden <zamsden@redhat.com> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: Glauber Costa <glommer@redhat.com> LKML-Reference: <20101105110444.BAF6D6FC03B@msa105.auone-net.jp> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
2a8dcbd6cd
commit
1f523bf367
1 changed files with 0 additions and 38 deletions
|
@ -41,44 +41,6 @@ void pvclock_set_flags(u8 flags)
|
||||||
valid_flags = flags;
|
valid_flags = flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
|
|
||||||
* yielding a 64-bit result.
|
|
||||||
*/
|
|
||||||
static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift)
|
|
||||||
{
|
|
||||||
u64 product;
|
|
||||||
#ifdef __i386__
|
|
||||||
u32 tmp1, tmp2;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (shift < 0)
|
|
||||||
delta >>= -shift;
|
|
||||||
else
|
|
||||||
delta <<= shift;
|
|
||||||
|
|
||||||
#ifdef __i386__
|
|
||||||
__asm__ (
|
|
||||||
"mul %5 ; "
|
|
||||||
"mov %4,%%eax ; "
|
|
||||||
"mov %%edx,%4 ; "
|
|
||||||
"mul %5 ; "
|
|
||||||
"xor %5,%5 ; "
|
|
||||||
"add %4,%%eax ; "
|
|
||||||
"adc %5,%%edx ; "
|
|
||||||
: "=A" (product), "=r" (tmp1), "=r" (tmp2)
|
|
||||||
: "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
|
|
||||||
#elif defined(__x86_64__)
|
|
||||||
__asm__ (
|
|
||||||
"mul %%rdx ; shrd $32,%%rdx,%%rax"
|
|
||||||
: "=a" (product) : "0" (delta), "d" ((u64)mul_frac) );
|
|
||||||
#else
|
|
||||||
#error implement me!
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return product;
|
|
||||||
}
|
|
||||||
|
|
||||||
static u64 pvclock_get_nsec_offset(struct pvclock_shadow_time *shadow)
|
static u64 pvclock_get_nsec_offset(struct pvclock_shadow_time *shadow)
|
||||||
{
|
{
|
||||||
u64 delta = native_read_tsc() - shadow->tsc_timestamp;
|
u64 delta = native_read_tsc() - shadow->tsc_timestamp;
|
||||||
|
|
Reference in a new issue