From mboxrd@z Thu Jan 1 00:00:00 1970 From: miloody@gmail.com (loody) Date: Fri, 20 May 2011 11:34:11 +0800 Subject: about 64-bits division in kernel Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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,