[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Fix the 64-bit build.



ChangeSet 1.1550, 2005/05/25 13:44:27+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Fix the 64-bit build.
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 div64.h |   32 +++++++++++++++-----------------
 1 files changed, 15 insertions(+), 17 deletions(-)


diff -Nru a/xen/include/asm-x86/div64.h b/xen/include/asm-x86/div64.h
--- a/xen/include/asm-x86/div64.h       2005-05-25 09:01:33 -04:00
+++ b/xen/include/asm-x86/div64.h       2005-05-25 09:01:33 -04:00
@@ -1,6 +1,20 @@
 #ifndef __I386_DIV64
 #define __I386_DIV64
 
+#include <xen/types.h>
+
+#if BITS_PER_LONG == 64
+
+# define do_div(n,base) ({                                     \
+       uint32_t __base = (base);                               \
+       uint32_t __rem;                                         \
+       __rem = ((uint64_t)(n)) % __base;                       \
+       (n) = ((uint64_t)(n)) / __base;                         \
+       __rem;                                                  \
+ })
+
+#else
+
 /*
  * do_div() is NOT a C function. It wants to return
  * two values (the quotient and the remainder), but
@@ -27,22 +41,6 @@
        __mod; \
 })
 
-/*
- * (long)X = ((long long)divs) / (long)div
- * (long)rem = ((long long)divs) % (long)div
- *
- * Warning, this will do an exception if X overflows.
- */
-#define div_long_long_rem(a,b,c) div_ll_X_l_rem(a,b,c)
-
-extern inline long
-div_ll_X_l_rem(long long divs, long div, long *rem)
-{
-       long dum2;
-      __asm__("divl %2":"=a"(dum2), "=d"(*rem)
-      :        "rm"(div), "A"(divs));
-
-       return dum2;
+#endif
 
-}
 #endif

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.