public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Helge Hafting <helge.hafting@aitel.hist.no>
To: beware <wimille@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Float numbers in module programming
Date: Wed, 29 Mar 2006 17:07:16 +0200	[thread overview]
Message-ID: <442AA2A4.5010104@aitel.hist.no> (raw)
In-Reply-To: <3fd7d9680603290634n6fabcdc7r193c30447acc1858@mail.gmail.com>

beware wrote:

>Hi
>
>i wonder if it is available to use float numbers in a module programming.
>Because, when I'm look for the param_get functions, i find them only
>for integers (long, short, and others) but none for the float numbers.
>
>Thanks for yours answer.
>  
>
The short answer is no, don't bother.

If you touch the floating point registers in kernel code, then
you mess them up for any user program that use floating point.

It can be done, but then you have to take all sorts of precations
saving the registers before using them, and restoring them
when finished.  And you must prevent context switching
while you have them! 

If you need a few computations, try to do it with fixed point
instead if at all possible. Or emulate floating point,
or have a userspace helper app to do it.
It all depends on what you think you need floats for.

Helge Hafting

  parent reply	other threads:[~2006-03-29 15:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-29 14:34 Float numbers in module programming beware
2006-03-29 15:02 ` linux-os (Dick Johnson)
2006-03-30  8:11   ` Jan Engelhardt
2006-03-30 13:09     ` linux-os (Dick Johnson)
2006-03-30 17:23       ` Phillip Susi
2006-04-03  6:55         ` Helge Hafting
2006-04-03  9:20           ` Jan Engelhardt
2006-03-30 17:31       ` Al Viro
2006-03-30 17:40         ` Roland Dreier
2006-03-30 18:02       ` Valdis.Kletnieks
2006-03-30 18:26       ` Andre Noll
2006-03-30 18:46         ` linux-os (Dick Johnson)
2006-03-31  7:57           ` Olivier Galibert
2006-03-31 11:05             ` Peter Williams
2006-03-29 15:07 ` Helge Hafting [this message]
2006-03-30  8:12   ` Jan Engelhardt

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=442AA2A4.5010104@aitel.hist.no \
    --to=helge.hafting@aitel.hist.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wimille@gmail.com \
    /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