RE: Division involving u64 : undefined reference to __udivdi3

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

 



1. Try upgrading your GCC compiler to 4.3.2
2. To avoid Division in code: try using shift operation instead of div. 

E.g. "c = c >> x" instead of "c = c / x;"

Regards
Vivek

-----Original Message-----
From: kernelnewbies-bounce@xxxxxxxxxxxx
[mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of Sukanto Ghosh
Sent: Thursday, February 05, 2009 10:56 AM
To: Manish Katiyar
Cc: kernelnewbies@xxxxxxxxxxxx
Subject: Re: Division involving u64 : undefined reference to __udivdi3

> Have a look at the file arch/x86/include/asm/div64.h. That might help
>

Thanks Manish.

I was trying to use the macro do_div defined in that file. But when I
am trying to divide two u64 values using that, I am not getting the
correct quotient.

I am using it like this:

u64, a,b,c;

/* for c = a/b */
c = a;
do_div(c,b);



-- 
Regards,
Sukanto Ghosh

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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