64 bit division

If you are trying to do this inside the kernel:
unsigned long long arg1, arg2;
arg1 = arg1/arg2;


and you get this error:
Unknown symbol __udivdi3

You ought to do this instead:
unsigned long long arg1, arg2;
unsigned long temp = arg1;
do_div(temp, arg2);
arg1 = temp;

No comments: