From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] stubdom: x86_32 compilation fix
Date: Tue, 26 Feb 2008 15:01:31 +0000 [thread overview]
Message-ID: <20080226150131.GD10008@implementation.uk.xensource.com> (raw)
In-Reply-To: <20080225115635.GD4380@implementation.uk.xensource.com>
stubdom: fix x86_32 compilation by __moddi3 from FreeBSD
(like has been done previously for umoddi3 etc.)
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
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
next prev parent reply other threads:[~2008-02-26 15:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-19 11:39 stubdom questions Zhai, Edwin
2008-02-25 11:56 ` Samuel Thibault
2008-02-26 14:59 ` [PATCH] stubdom: log and documentation fixes Samuel Thibault
2008-02-26 15:01 ` Samuel Thibault [this message]
2008-02-26 15:03 ` [PATCH] stubdom: x86_32 compilation fix Samuel Thibault
2008-02-27 2:05 ` stubdom questions Zhai, Edwin
2008-02-27 11:12 ` Samuel Thibault
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080226150131.GD10008@implementation.uk.xensource.com \
--to=samuel.thibault@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.