[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Fix time handling on x86/64.
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID 7c9513a80026d90cc97496886b05725c0b3c2f8a # Parent 50e57636bdd817f51624e40611a77036d2073e23 Fix time handling on x86/64. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> diff -r 50e57636bdd8 -r 7c9513a80026 linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c Wed Aug 10 12:21:39 2005 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c Wed Aug 10 12:56:47 2005 @@ -173,13 +173,16 @@ 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 ; " @@ -190,6 +193,11 @@ "adc %5,%%edx ; " : "=A" (product), "=r" (tmp1), "=r" (tmp2) : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) ); +#else + __asm__ ( + "mul %%rdx ; shrd $32,%%rdx,%%rax" + : "=a" (product) : "0" (delta), "d" ((u64)mul_frac) ); +#endif return product; } diff -r 50e57636bdd8 -r 7c9513a80026 xen/arch/x86/time.c --- a/xen/arch/x86/time.c Wed Aug 10 12:21:39 2005 +++ b/xen/arch/x86/time.c Wed Aug 10 12:56:47 2005 @@ -103,13 +103,16 @@ static inline u64 scale_delta(u64 delta, struct time_scale *scale) { u64 product; +#ifdef CONFIG_x86_32 u32 tmp1, tmp2; +#endif if ( scale->shift < 0 ) delta >>= -scale->shift; else delta <<= scale->shift; +#ifdef CONFIG_X86_32 __asm__ ( "mul %5 ; " "mov %4,%%eax ; " @@ -120,6 +123,11 @@ "adc %5,%%edx ; " : "=A" (product), "=r" (tmp1), "=r" (tmp2) : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (scale->mul_frac) ); +#else + __asm__ ( + "mul %%rdx ; shrd $32,%%rdx,%%rax" + : "=a" (product) : "0" (delta), "d" ((u64)scale->mul_frac) ); +#endif return product; } _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |