ia64/xen-unstable

changeset 17130:e6c3006fd9be

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>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Feb 26 15:11:07 2008 +0000 (2008-02-26)
parents 450be98ef36b
children 2a8eaba24bf0
files extras/mini-os/lib/math.c
line diff
     1.1 --- a/extras/mini-os/lib/math.c	Tue Feb 26 15:02:26 2008 +0000
     1.2 +++ b/extras/mini-os/lib/math.c	Tue Feb 26 15:11:07 2008 +0000
     1.3 @@ -388,6 +388,29 @@ u_quad_t
     1.4          return (r);
     1.5  }
     1.6  
     1.7 +/*
     1.8 + * Return remainder after dividing two signed quads.
     1.9 + *
    1.10 + * XXX
    1.11 + * If -1/2 should produce -1 on this machine, this code is wrong.
    1.12 + */
    1.13 +quad_t
    1.14 +__moddi3(quad_t a, quad_t b)
    1.15 +{
    1.16 +	u_quad_t ua, ub, ur;
    1.17 +	int neg;
    1.18 +
    1.19 +	if (a < 0)
    1.20 +		ua = -(u_quad_t)a, neg = 1;
    1.21 +	else
    1.22 +		ua = a, neg = 0;
    1.23 +	if (b < 0)
    1.24 +		ub = -(u_quad_t)b;
    1.25 +	else
    1.26 +		ub = b;
    1.27 +	(void)__qdivrem(ua, ub, &ur);
    1.28 +	return (neg ? -ur : ur);
    1.29 +}
    1.30  #endif /* !defined(__ia64__) */
    1.31  
    1.32  #ifndef HAVE_LIBC