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-devel

[Xen-devel] [PATCH] stubdom: x86_32 compilation fix

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] stubdom: x86_32 compilation fix
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Date: Tue, 26 Feb 2008 15:01:31 +0000
Delivery-date: Tue, 26 Feb 2008 07:02:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20080225115635.GD4380@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
References: <20080219113941.GF21201@xxxxxxxxxxxxxxxxxxxxxx> <20080225115635.GD4380@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
stubdom: fix x86_32 compilation by __moddi3 from FreeBSD
(like has been done previously for umoddi3 etc.)

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>

diff -r 09af1b46f89f extras/mini-os/lib/math.c
--- a/extras/mini-os/lib/math.c Tue Feb 26 13:12:55 2008 +0000
+++ b/extras/mini-os/lib/math.c Tue Feb 26 14:57:50 2008 +0000
@@ -388,6 +388,30 @@ __umoddi3(u_quad_t a, u_quad_t b)
         return (r);
 }
 
+/*
+ * Return remainder after dividing two signed quads.
+ *
+ * XXX
+ * If -1/2 should produce -1 on this machine, this code is wrong.
+ */
+quad_t
+__moddi3(a, b)
+       quad_t a, b;
+{
+       u_quad_t ua, ub, ur;
+       int neg;
+
+       if (a < 0)
+               ua = -(u_quad_t)a, neg = 1;
+       else
+               ua = a, neg = 0;
+       if (b < 0)
+               ub = -(u_quad_t)b;
+       else
+               ub = b;
+       (void)__qdivrem(ua, ub, &ur);
+       return (neg ? -ur : ur);
+}
 #endif /* !defined(__ia64__) */
 
 #ifndef HAVE_LIBC

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

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