xen: arm64: div64
authorIan Campbell <ian.campbell@citrix.com>
Fri, 22 Feb 2013 08:57:56 +0000 (08:57 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 22 Feb 2013 12:14:52 +0000 (12:14 +0000)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
xen/include/asm-arm/div64.h

index f2574e5c8c8dfa7df9b4dad3aa2ca61584512d70..1cd58bc51a22ee4c12b6f1224503320f951298a3 100644 (file)
  * 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"
        __nr;                                                           \
 })
 
-#endif
+#endif /* GCC version */
+
+#endif /* BITS_PER_LONG */
 
 #endif
 /*