Re: I am still talking about "system call"

Richard B. Johnson (root@chaos.analogic.com)
Fri, 23 Apr 1999 21:08:14 -0400 (EDT)


On 23 Apr 1999, Livia Catarina Soares wrote:

> Dear Colleagues
>
> I had some problems using float values into the system calls.
>
> Is there some constraints with floats in the kernel ??
>
Two floating point values are used initially during startup of
an ix86 to test FP response. From that time forth and even forever more,
the state of the FP unit is undefined within the kernel. The state
of the FP unit is saved/restored across context switches so that
user code can use the FP unit.

>From the history that I remember from a previous discussion a few
years ago (I'm sure I will be corrected if wrong) -- take it easy
I had a bad week --

The problem with using the FP Unit within the kernel is that a
kernel system call is typically executed within the context of
a task. In other words, a context switch does not normally occur
when somebody calls (interrupts) the kernel for services. Yet,
when waiting for some system services such as I/O, it is likely
that the task may volunteer to give up the CPU (sleep). If the
FPU is used at this time, its state would have to be saved and
restored. This adds additional overhead that is not necessary.

Therefore it was decreed that the FPU would not be used in the
kernel code at all.

FYI all real numbers except trancendentials can be represented
as the ratio of two integers so it's highly unlikely that anybody
would really need FP in the kernel.

Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.2.6 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

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