about 64-bits division in kernel

Dave Hylands dhylands at gmail.com
Sat May 21 03:22:14 EDT 2011


Hi miloody,

...snip...
> I found div64.h is located at includ/asm-generic/div64.h instead of
> include/linux/
> BTW, I still cannot figure out why kernel doesn't adopt the gcc's solution.
> libgcc.a will be compiled by different platform, arm, mips, etc.
> And that should be safe for kernel to adopt it.

I believe that the gcc approach is only safe from user-space, and may
cause traps from within kernel space.

>From the reading I've done, gcc expects a certain environment, and the
kernel provides a different environment.

I believe that the primary reason has to do with the fact that libgcc
also provides floating point support, which doesn't work in the
kernel, so they don't allow any of libgcc to be used. I believe that
there are people working on getting support for the integer stuff, but
I'm not sure what the status of this is.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com



More information about the Kernelnewbies mailing list