|
|
__udivdi3 __umoddi3 - 64 bit division in linux
If you've encountered an error message like this
Unknown symbol __udivdi3
Unknown symbol __umoddi3
Unresolved symbol __udivdi3
Unresolved symbol __umoddi3
you most likely want to make a 64 bit division, which is not supported by default in linux kernel space.
To solve this problem, you need to use the do_div macro available in asm/div64.h:
#include <asm/div64.h>
unsigned long long x, y, result;
unsigned long mod;
mod = do_div(x, y);
result = x;
If you want to calculate x / y with do_div(x, y), the result of the division is in x,
the remainder is returned from the do_div function.
Since do_div is just an asm (assembler) macro, it doesn't break real time determinism, so it's also
suitable for use in RTAI classic, RTAI fusion and ADEOS/ADEOS-IPIPE applications.
Last-Modified: Sat, 04 Feb 2006 16:03:00 GMT
|
|