about 64-bits division in kernel

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

 



hi all:
My platform is 32-bits cpu and I need following calculation in my driver.
#define longdiv(sr1, sr2, div)      (unsigned long )((((unsigned long
long)(sr1) << 32) ^ (sr2)) / (div))

my question are:
1. why "__udivdi3" has any relationship with above calculation?
2. I know the above calculation is implemented in clibc, but why
kernel still implement itself?
     why kernel try to make another wheel instead of including what
clib provided ?

-- 
Regards,

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[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