diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2008-06-12 04:47:58 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-12 04:47:58 -0400 |
commit | d5e181f78ac753893eb930868a52a4488cd3de0a (patch) | |
tree | 7d2f71fd3c84196f0d81a9e44861743b74e58ef6 /lib/div64.c | |
parent | f595ec964daf7f99668039d7303ddedd09a75142 (diff) |
add an inlined version of iter_div_u64_rem
iter_div_u64_rem is used in the x86-64 vdso, which cannot call other
kernel code. For this case, provide the always_inlined version,
__iter_div_u64_rem.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'lib/div64.c')
-rw-r--r-- | lib/div64.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/div64.c b/lib/div64.c index 76c01542d3e1..a111eb8de9cf 100644 --- a/lib/div64.c +++ b/lib/div64.c | |||
@@ -105,19 +105,6 @@ EXPORT_SYMBOL(div64_u64); | |||
105 | */ | 105 | */ |
106 | u32 iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder) | 106 | u32 iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder) |
107 | { | 107 | { |
108 | u32 ret = 0; | 108 | return __iter_div_u64_rem(dividend, divisor, remainder); |
109 | |||
110 | while (dividend >= divisor) { | ||
111 | /* The following asm() prevents the compiler from | ||
112 | optimising this loop into a modulo operation. */ | ||
113 | asm("" : "+rm"(dividend)); | ||
114 | |||
115 | dividend -= divisor; | ||
116 | ret++; | ||
117 | } | ||
118 | |||
119 | *remainder = dividend; | ||
120 | |||
121 | return ret; | ||
122 | } | 109 | } |
123 | EXPORT_SYMBOL(iter_div_u64_rem); | 110 | EXPORT_SYMBOL(iter_div_u64_rem); |