Re: Integer Division In Module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > > 64 bit math must be explicitly requested ... see do_div and co.
> >  __div64_32() from src/lib/div64.c
>
> Which is what do_div() calls. AFAIK, do_div() is what any code in
I did some small research into this.
There are two definitions for do_div() macro, in asm-generic and asm-i386.
The asm-<arch> definition provides the optimized method (i386 in
assembly) and generic version implements it in software, using
repeated subtraction method using div64_32().

I am confused at one point. Even though lib/div64.c : __div64_32() is
exported, I could not find it in the nm | grep __div64_32. When tried
inserting a module with explicit call to __div64_32(), it refused to
load stating unresolved symbol.

Any idea?
Om

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux