Rev 6934 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6934 | Rev 6936 | ||
---|---|---|---|
Line 11... | Line 11... | ||
11 | * |
11 | * |
12 | * The fast case for (n>>32 == 0) is handled inline by do_div(). |
12 | * The fast case for (n>>32 == 0) is handled inline by do_div(). |
13 | * |
13 | * |
14 | * Code generated for this function might be very inefficient |
14 | * Code generated for this function might be very inefficient |
15 | * for some CPUs. __div64_32() can be overridden by linking arch-specific |
15 | * for some CPUs. __div64_32() can be overridden by linking arch-specific |
16 | * assembly versions such as arch/ppc/lib/div64.S and arch/sh/lib/div64.S. |
16 | * assembly versions such as arch/ppc/lib/div64.S and arch/sh/lib/div64.S |
- | 17 | * or by defining a preprocessor macro in arch/include/asm/div64.h. |
|
17 | */ |
18 | */ |
Line 18... | Line 19... | ||
18 | 19 | ||
19 | #include |
20 | #include |
20 | #include |
21 | #include |
Line 21... | Line 22... | ||
21 | #include |
22 | #include |
22 | 23 | ||
Line -... | Line 24... | ||
- | 24 | /* Not needed on 64bit architectures */ |
|
23 | /* Not needed on 64bit architectures */ |
25 | #if BITS_PER_LONG == 32 |
24 | #if BITS_PER_LONG == 32 |
26 | |
25 | 27 | #ifndef __div64_32 |
|
26 | uint32_t __attribute__((weak)) __div64_32(uint64_t *n, uint32_t base) |
28 | uint32_t __attribute__((weak)) __div64_32(uint64_t *n, uint32_t base) |
27 | { |
29 | { |
Line 53... | Line 55... | ||
53 | } while (d); |
55 | } while (d); |
Line 54... | Line 56... | ||
54 | 56 | ||
55 | *n = res; |
57 | *n = res; |
56 | return rem; |
58 | return rem; |
57 | } |
- | |
58 | 59 | } |
|
- | 60 | EXPORT_SYMBOL(__div64_32); |
|
Line 59... | Line 61... | ||
59 | EXPORT_SYMBOL(__div64_32); |
61 | #endif |
60 | 62 | ||
61 | #ifndef div_s64_rem |
63 | #ifndef div_s64_rem |
62 | s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) |
64 | s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) |