Merge to kernel-2.6.20-1.2949.fc6.vs2.2.0.1
[linux-2.6.git] / include / asm-mips / div64.h
index 7e7e2ea..d107832 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2000 Maciej W. Rozycki
+ * Copyright (C) 2000, 2004  Maciej W. Rozycki
  * Copyright (C) 2003 Ralf Baechle
  *
  * This file is subject to the terms and conditions of the GNU General Public
@@ -11,6 +11,8 @@
 
 #if (_MIPS_SZLONG == 32)
 
+#include <asm/compiler.h>
+
 /*
  * No traps on overflows for any of these...
  */
@@ -67,7 +69,8 @@
        if (__high) \
                __asm__("divu   $0, %z2, %z3" \
                        : "=h" (__upper), "=l" (__high) \
-                       : "Jr" (__high), "Jr" (__base)); \
+                       : "Jr" (__high), "Jr" (__base) \
+                       : GCC_REG_ACCUM); \
        \
        __mod = do_div64_32(__low, __upper, __low, __base); \
        \
 
 #if (_MIPS_SZLONG == 64)
 
-/*
- * Don't use this one in new code
- */
-#define do_div64_32(res, high, low, base) ({ \
-       unsigned int __quot, __mod; \
-       unsigned long __div; \
-       unsigned int __low, __high, __base; \
-       \
-       __high = (high); \
-       __low = (low); \
-       __div = __high; \
-       __div = __div << 32 | __low; \
-       __base = (base); \
-       \
-       __mod = __div % __base; \
-       __div = __div / __base; \
-       \
-       __quot = __div; \
-       (res) = __quot; \
-       __mod; })
-
 /*
  * Hey, we're already 64-bit, no
  * need to play games..