From: Ian Campbell Date: Fri, 22 Feb 2013 08:57:56 +0000 (+0000) Subject: xen: arm64: div64 X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~7209 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7e6f5b0c94c6cbc5e625c41988fcf46e041f4ed1;p=xen.git xen: arm64: div64 Signed-off-by: Ian Campbell Acked-by: Tim Deegan --- diff --git a/xen/include/asm-arm/div64.h b/xen/include/asm-arm/div64.h index f2574e5c8c..1cd58bc51a 100644 --- a/xen/include/asm-arm/div64.h +++ b/xen/include/asm-arm/div64.h @@ -21,6 +21,19 @@ * calling convention for arguments and results (beware). */ + +#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; \ + }) + +#elif BITS_PER_LONG == 32 + #ifdef __ARMEB__ #define __xh "r0" #define __xl "r1" @@ -222,7 +235,9 @@ __nr; \ }) -#endif +#endif /* GCC version */ + +#endif /* BITS_PER_LONG */ #endif /*