WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix the 64-bit build.
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Wed, 25 May 2005 12:44:27 +0000
Delivery-date: Wed, 25 May 2005 13:00:49 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>