|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH] stubdom: x86_32 compilation fix
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
|
|
|
|
|