From: "Grant Likely" <grant.likely@secretlab.ca>
To: "jimmy liu" <jimmyzhmliu@yahoo.com>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: Floating Point Operation in Kernel
Date: Tue, 12 Dec 2006 15:09:01 -0700 [thread overview]
Message-ID: <528646bc0612121409r59eac2d5n7c9072d569dfebd2@mail.gmail.com> (raw)
In-Reply-To: <426172.37473.qm@web53101.mail.yahoo.com>
On 12/12/06, jimmy liu <jimmyzhmliu@yahoo.com> wrote:
> I am writing a module which need be integrated to the
> linux kernel with floating point operations for
> mpc82xx. The kernel does not provide support for
> floating point operations. Does anybody have good idea
> to implement it or make it to work around?
The official answer is: "Don't do that." :)
Here's the more generous reply: The kernel explicitly does not
support floating point in the kernel. Save/restore on floating point
registers is expensive. In fact, IIRC, floating point registers for
user space use 'lazy save/restore'; ie. the registers are not saved on
every context switch; they are only saved if another user space
process tries to perform FP operations.
To support FP access in kernel space means you must fit your code into
the already complex FP save/restore state machine; or you need to
disable all interrupts and perform your own FP register save/restore
within the context of your driver. And it's a pretty safe bet that
you'll have trouble getting the driver into mainline.
Why do you need kernel space FP?
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
next prev parent reply other threads:[~2006-12-12 22:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-12 21:16 Floating Point Operation in Kernel jimmy liu
2006-12-12 22:09 ` Grant Likely [this message]
2006-12-13 1:45 ` Carlos Munoz
2006-12-13 16:20 ` jimmy liu
2006-12-13 16:35 ` Ben Warren
2006-12-14 23:19 ` Andrew E. Mileski
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=528646bc0612121409r59eac2d5n7c9072d569dfebd2@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=jimmyzhmliu@yahoo.com \
--cc=linuxppc-embedded@ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).