All of lore.kernel.org
 help / color / mirror / Atom feed
From: dhylands@gmail.com (Dave Hylands)
To: kernelnewbies@lists.kernelnewbies.org
Subject: about 64-bits division in kernel
Date: Sat, 21 May 2011 00:22:14 -0700	[thread overview]
Message-ID: <BANLkTik_9taPLq5h2iCHmADioA5VJaF7ZQ@mail.gmail.com> (raw)
In-Reply-To: <BANLkTimx1rAjiKefMdyvVrTONgf4HWka0g@mail.gmail.com>

Hi miloody,

...snip...
> I found div64.h is located at includ/asm-generic/div64.h instead of
> include/linux/
> BTW, I still cannot figure out why kernel doesn't adopt the gcc's solution.
> libgcc.a will be compiled by different platform, arm, mips, etc.
> And that should be safe for kernel to adopt it.

I believe that the gcc approach is only safe from user-space, and may
cause traps from within kernel space.

>From the reading I've done, gcc expects a certain environment, and the
kernel provides a different environment.

I believe that the primary reason has to do with the fact that libgcc
also provides floating point support, which doesn't work in the
kernel, so they don't allow any of libgcc to be used. I believe that
there are people working on getting support for the integer stuff, but
I'm not sure what the status of this is.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

      reply	other threads:[~2011-05-21  7:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-20  3:34 about 64-bits division in kernel loody
2011-05-20  4:15 ` 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 [this message]

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=BANLkTik_9taPLq5h2iCHmADioA5VJaF7ZQ@mail.gmail.com \
    --to=dhylands@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.