Re: How to use floating point in a module?

From: Richard B. Johnson
Date: Mon May 31 2004 - 21:16:26 EST


On Sun, 30 May 2004 ndiamond@xxxxxxxxxxxxx wrote:

> A driver, implemented as a module, must do some floating-point
> computations including trig functions. Fortunately the architecture
> is x86. A few hundred kilograms of searching (almost a ton of searching :-) seems to reveal the following possibilities.
>

Since you are using one of those Windows mailers and didn't enter a
single end-of-line character, I detect that this is probably one
of those trolls. Nevertheless, the use of floating-point is forbidden
within the kernel. Period. Because anybody who thinks they need
floating-point mathematics within the kernel is completely without
a clue, the floating-point context is not saved/restored during system
calls.

You must pair a user-mode program (usually called a daemon) with
the kernel-mode interface to your hardware (your module). This
combination will provide whatever functionality you require. The
user-mode daemon does the math and probably a lot of other things
as well.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.26 on an i686 machine (5583.66 BogoMips).
Note 96.31% of all statistics are fiction.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/