Oversized math in kernel modules?
I recently realized that simple C arithmetic operators (+-/*%) for operations that can't be done in a register require separately linked functions to work when compiling with gcc. What I mean by this is that a 64 bit integer operation on a 32 bit processor cannot be done in a register obviously, therefore gcc uses the function i.e. _divdi3 for division, etc. This is all fine unless you are using this operation in a kernel module where you can't link. Does anyone know of a way around this; perhaps the actual C functions that are used for the calculations? Thanks.
ta0kira
|