diff options
| author | Bernardo Innocenti <bernie@develer.com> | 2003-07-05 22:58:25 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-07-05 22:58:25 -0700 |
| commit | f0a8aa740a24500b3379396ace6737722d0de1d4 (patch) | |
| tree | d8b8d37cbf28c2bbc419d13b461830da5a972a9f /kernel | |
| parent | a6a6977c72a8382ef4daf85585fd438e58c7aa4a (diff) | |
[PATCH] Fix do_div() for all architectures
This offers a generic do_div64() that actually does the right thing,
unlike some architectures that "optimized" the 64-by-32 divide into
just a 32-bit divide.
Both ppc and sh were already providing an assembly optimized
__div64_32(). I called my function the same, so that their optimized
versions will automatically override mine in lib.a.
I've only tested extensively on m68knommu (uClinux) and made
sure generated code is reasonably short. Should be ok also on
parisc, since it's the same algorithm they were using before.
- add generic C implementations of the do_div() for 32bit and 64bit
archs in asm-generic/div64.h;
- add generic library support function __div64_32() to handle the
full 64/32 case on 32bit archs;
- kill multiple copies of generic do_div() in architecture
specific subdirs. Most copies were either buggy or not doing
what they were supposed to do;
- ensure all surviving instances of do_div() have their parameters
correctly parenthesized to avoid funny side-effects;
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions
