aboutsummaryrefslogtreecommitdiff
path: root/include/asm-x86/div64.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 10:22:01 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 10:22:01 -0700
commit5b34653963de7a6d0d8c783527457d68fddc60fb (patch)
tree1a234741e1823a54cd0514616f783b4cf503a528 /include/asm-x86/div64.h
parent765426e8ee4c0ab2bc9d44951f4865b8494cdbd0 (diff)
parent5e1b00758b5a8bee9d42515bffdaf305a32f1b04 (diff)
Merge branch 'x86/um-header' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86/um-header' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (26 commits) x86: canonicalize remaining header guards x86: drop double underscores from header guards x86: Fix ASM_X86__ header guards x86, um: get rid of uml-config.h x86, um: get rid of arch/um/Kconfig.arch x86, um: get rid of arch/um/os symlink x86, um: get rid of excessive includes of uml-config.h x86, um: get rid of header symlinks x86, um: merge Kconfig.i386 and Kconfig.x86_64 x86, um: get rid of sysdep symlink x86, um: trim the junk from uml ptrace-*.h x86, um: take vm-flags.h to sysdep x86, um: get rid of uml asm/arch x86, um: get rid of uml highmem.h x86, um: get rid of uml unistd.h x86, um: get rid of system.h -> system.h include x86, um: uml atomic.h is not needed anymore x86, um: untangle uml ldt.h x86, um: get rid of more uml asm/arch uses x86, um: remove dead header (uml module-generic.h; never used these days) ...
Diffstat (limited to 'include/asm-x86/div64.h')
-rw-r--r--include/asm-x86/div64.h60
1 files changed, 0 insertions, 60 deletions
diff --git a/include/asm-x86/div64.h b/include/asm-x86/div64.h
deleted file mode 100644
index f9530f23f1d..00000000000
--- a/include/asm-x86/div64.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef ASM_X86__DIV64_H
-#define ASM_X86__DIV64_H
-
-#ifdef CONFIG_X86_32
-
-#include <linux/types.h>
-
-/*
- * do_div() is NOT a C function. It wants to return
- * two values (the quotient and the remainder), but
- * since that doesn't work very well in C, what it
- * does is:
- *
- * - modifies the 64-bit dividend _in_place_
- * - returns the 32-bit remainder
- *
- * This ends up being the most efficient "calling
- * convention" on x86.
- */
-#define do_div(n, base) \
-({ \
- unsigned long __upper, __low, __high, __mod, __base; \
- __base = (base); \
- asm("":"=a" (__low), "=d" (__high) : "A" (n)); \
- __upper = __high; \
- if (__high) { \
- __upper = __high % (__base); \
- __high = __high / (__base); \
- } \
- asm("divl %2":"=a" (__low), "=d" (__mod) \
- : "rm" (__base), "0" (__low), "1" (__upper)); \
- asm("":"=A" (n) : "a" (__low), "d" (__high)); \
- __mod; \
-})
-
-static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
-{
- union {
- u64 v64;
- u32 v32[2];
- } d = { dividend };
- u32 upper;
-
- upper = d.v32[1];
- d.v32[1] = 0;
- if (upper >= divisor) {
- d.v32[1] = upper / divisor;
- upper %= divisor;
- }
- asm ("divl %2" : "=a" (d.v32[0]), "=d" (*remainder) :
- "rm" (divisor), "0" (d.v32[0]), "1" (upper));
- return d.v64;
-}
-#define div_u64_rem div_u64_rem
-
-#else
-# include <asm-generic/div64.h>
-#endif /* CONFIG_X86_32 */
-
-#endif /* ASM_X86__DIV64_H */