Re: How to use floating point in a module?

From: Calvin Spealman
Date: Sun May 30 2004 - 21:45:40 EST


MÃns RullgÃrd wrote:
> Floating point is forbidden in kernel code since the floating point
> registers (and other floating point context) is not saved/restored
> during system calls, for efficiency. I'm speculating here, but it
> might be possible to manually save the floating point context while
> doing some floating point operations. The problem arises if this code
> is interrupted midway. Using a preemptive 2.6 kernel would easily
> break here.

What about adding some functions such as enable_fpreg_syscalls() and
disable_fpreg_syscalls() that could be called before and after any floating
point operations? They could set a flag somewhere that would cause the
float registers to be saved/restored. Forgive me if this is somehow stupid.
I'm very much a kernel newbie.

-
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/