ia64/xen-unstable

changeset 6063:2360c4d7bb2f

Really fix the x86/64 build. Get rid of push/pop from
scale_delta().
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Aug 08 12:31:04 2005 +0000 (2005-08-08)
parents 7d84bc707736
children d4e19aca1f72
files linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c xen/arch/x86/time.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Mon Aug 08 12:07:19 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Mon Aug 08 12:31:04 2005 +0000
     1.3 @@ -173,7 +173,7 @@ struct timer_opts timer_tsc = {
     1.4  static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift)
     1.5  {
     1.6  	u64 product;
     1.7 -	u32 tmp;
     1.8 +	u32 tmp1, tmp2;
     1.9  
    1.10  	if ( shift < 0 )
    1.11  		delta >>= -shift;
    1.12 @@ -181,17 +181,15 @@ static inline u64 scale_delta(u64 delta,
    1.13  		delta <<= shift;
    1.14  
    1.15  	__asm__ (
    1.16 -		"push %%edx    ; "
    1.17 -		"mul  %3       ; "
    1.18 -		"pop  %%eax    ; "
    1.19 -		"push %%edx    ; "
    1.20 -		"mul  %3       ; "
    1.21 -		"pop  %3       ; "
    1.22 -		"add  %3,%%eax ; "
    1.23 -		"xor  %3,%3    ; "
    1.24 -		"adc  %3,%%edx ; "
    1.25 -		: "=A" (product), "=r" (tmp)
    1.26 -		: "A" (delta), "1" (mul_frac) );
    1.27 +		"mul  %5       ; "
    1.28 +		"mov  %4,%%eax ; "
    1.29 +		"mov  %%edx,%4 ; "
    1.30 +		"mul  %5       ; "
    1.31 +		"add  %4,%%eax ; "
    1.32 +		"xor  %5,%5    ; "
    1.33 +		"adc  %5,%%edx ; "
    1.34 +		: "=A" (product), "=r" (tmp1), "=r" (tmp2)
    1.35 +		: "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
    1.36  
    1.37  	return product;
    1.38  }
     2.1 --- a/xen/arch/x86/time.c	Mon Aug 08 12:07:19 2005 +0000
     2.2 +++ b/xen/arch/x86/time.c	Mon Aug 08 12:31:04 2005 +0000
     2.3 @@ -103,7 +103,7 @@ static inline u32 mul_frac(u32 multiplic
     2.4  static inline u64 scale_delta(u64 delta, struct time_scale *scale)
     2.5  {
     2.6      u64 product;
     2.7 -    u32 tmp;
     2.8 +    u32 tmp1, tmp2;
     2.9  
    2.10      if ( scale->shift < 0 )
    2.11          delta >>= -scale->shift;
    2.12 @@ -111,17 +111,15 @@ static inline u64 scale_delta(u64 delta,
    2.13          delta <<= scale->shift;
    2.14  
    2.15      __asm__ (
    2.16 -        "push %%edx    ; "
    2.17 -        "mul  %3       ; "
    2.18 -        "pop  %%eax    ; "
    2.19 -        "push %%edx    ; "
    2.20 -        "mul  %3       ; "
    2.21 -        "pop  %3       ; "
    2.22 -        "add  %3,%%eax ; "
    2.23 -        "xor  %3,%3    ; "
    2.24 -        "adc  %3,%%edx ; "
    2.25 -        : "=A" (product), "=r" (tmp)
    2.26 -        : "A" (delta), "1" (scale->mul_frac) );
    2.27 +        "mul  %5       ; "
    2.28 +        "mov  %4,%%eax ; "
    2.29 +        "mov  %%edx,%4 ; "
    2.30 +        "mul  %5       ; "
    2.31 +        "add  %4,%%eax ; "
    2.32 +        "xor  %5,%5    ; "
    2.33 +        "adc  %5,%%edx ; "
    2.34 +        : "=A" (product), "=r" (tmp1), "=r" (tmp2)
    2.35 +        : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (scale->mul_frac) );
    2.36  
    2.37      return product;
    2.38  }