All of lore.kernel.org
 help / color / mirror / Atom feed
From: miloody@gmail.com (loody)
To: kernelnewbies@lists.kernelnewbies.org
Subject: about 64-bits division in kernel
Date: Fri, 20 May 2011 11:34:11 +0800	[thread overview]
Message-ID: <BANLkTimGGQgmg+nULVLAUPJ3Z3qj6pgSbg@mail.gmail.com> (raw)

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,

             reply	other threads:[~2011-05-20  3:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-20  3:34 loody [this message]
2011-05-20  4:15 ` about 64-bits division in kernel Dave Hylands
2011-05-20  5:51   ` loody
2011-05-20  6:47     ` Dave Hylands
2011-05-21  6:57       ` loody
2011-05-21  7:22         ` Dave Hylands

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTimGGQgmg+nULVLAUPJ3Z3qj6pgSbg@mail.gmail.com \
    --to=miloody@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.