ia64/xen-unstable

changeset 5148:561f71aa056d

bitkeeper revision 1.1550 (4294732bb-16oL8fVDfFOUaEjoM4oA)

Fix the 64-bit build.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed May 25 12:44:27 2005 +0000 (2005-05-25)
parents 63d8220a9b26
children 321a7af76a9b fed73636e06b
files xen/include/asm-x86/div64.h
line diff
     1.1 --- a/xen/include/asm-x86/div64.h	Wed May 25 10:56:29 2005 +0000
     1.2 +++ b/xen/include/asm-x86/div64.h	Wed May 25 12:44:27 2005 +0000
     1.3 @@ -1,6 +1,20 @@
     1.4  #ifndef __I386_DIV64
     1.5  #define __I386_DIV64
     1.6  
     1.7 +#include <xen/types.h>
     1.8 +
     1.9 +#if BITS_PER_LONG == 64
    1.10 +
    1.11 +# define do_div(n,base) ({					\
    1.12 +	uint32_t __base = (base);				\
    1.13 +	uint32_t __rem;						\
    1.14 +	__rem = ((uint64_t)(n)) % __base;			\
    1.15 +	(n) = ((uint64_t)(n)) / __base;				\
    1.16 +	__rem;							\
    1.17 + })
    1.18 +
    1.19 +#else
    1.20 +
    1.21  /*
    1.22   * do_div() is NOT a C function. It wants to return
    1.23   * two values (the quotient and the remainder), but
    1.24 @@ -27,22 +41,6 @@
    1.25  	__mod; \
    1.26  })
    1.27  
    1.28 -/*
    1.29 - * (long)X = ((long long)divs) / (long)div
    1.30 - * (long)rem = ((long long)divs) % (long)div
    1.31 - *
    1.32 - * Warning, this will do an exception if X overflows.
    1.33 - */
    1.34 -#define div_long_long_rem(a,b,c) div_ll_X_l_rem(a,b,c)
    1.35 +#endif
    1.36  
    1.37 -extern inline long
    1.38 -div_ll_X_l_rem(long long divs, long div, long *rem)
    1.39 -{
    1.40 -	long dum2;
    1.41 -      __asm__("divl %2":"=a"(dum2), "=d"(*rem)
    1.42 -      :	"rm"(div), "A"(divs));
    1.43 -
    1.44 -	return dum2;
    1.45 -
    1.46 -}
    1.47  #endif