sh: Prevent leaking of CONFIG_SUPERH32 to userspace in asm/unistd.h.
[safe/jmp/linux-2.6] / include / asm-mips / div64.h
index 5f7dcf5..d1d6991 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2000, 2004  Maciej W. Rozycki
- * Copyright (C) 2003 Ralf Baechle
+ * Copyright (C) 2003, 07 Ralf Baechle (ralf@linux-mips.org)
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
@@ -9,6 +9,8 @@
 #ifndef _ASM_DIV64_H
 #define _ASM_DIV64_H
 
+#include <linux/types.h>
+
 #if (_MIPS_SZLONG == 32)
 
 #include <asm/compiler.h>
@@ -18,7 +20,7 @@
  */
 
 #define do_div64_32(res, high, low, base) ({ \
-       unsigned long __quot, __mod; \
+       unsigned long __quot32, __mod32; \
        unsigned long __cf, __tmp, __tmp2, __i; \
        \
        __asm__(".set   push\n\t" \
                "bnez   %4, 0b\n\t" \
                " srl   %5, %1, 0x1f\n\t" \
                ".set   pop" \
-               : "=&r" (__mod), "=&r" (__tmp), "=&r" (__quot), "=&r" (__cf), \
+               : "=&r" (__mod32), "=&r" (__tmp), \
+                 "=&r" (__quot32), "=&r" (__cf), \
                  "=&r" (__i), "=&r" (__tmp2) \
                : "Jr" (base), "0" (high), "1" (low)); \
        \
-       (res) = __quot; \
-       __mod; })
+       (res) = __quot32; \
+       __mod32; })
 
 #define do_div(n, base) ({ \
        unsigned long long __quot; \
        __quot = __quot << 32 | __low; \
        (n) = __quot; \
        __mod; })
+
 #endif /* (_MIPS_SZLONG == 32) */
 
 #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..
  */