Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221819
b: refs/heads/master
c: 1f523bf
h: refs/heads/master
i:
  221817: 487bc16
  221815: 4ef765b
v: v3
  • Loading branch information
Kusanagi Kouichi authored and Ingo Molnar committed Nov 10, 2010
1 parent 15a1117 commit 9664ab4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2a8dcbd6cd2270f912ca141547d9296ce08abe4a
refs/heads/master: 1f523bf36734375dd6e986c9f47f010d00a8caca
38 changes: 0 additions & 38 deletions trunk/arch/x86/kernel/pvclock.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,44 +41,6 @@ void pvclock_set_flags(u8 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)
{
u64 delta = native_read_tsc() - shadow->tsc_timestamp;
Expand Down

0 comments on commit 9664ab4

Please sign in to comment.