Re: Floating point in interrupt handler
- From: "M. Warner Losh" <imp@xxxxxxxxxx>
- Date: Wed, 24 Oct 2007 15:15:13 -0600 (MDT)
In message: <200710222211.51590.Danovitsch@xxxxxxxxxx>
"Daan Vreeken [PA4DAN]" <Danovitsch@xxxxxxxxxx> writes:
: But what I haven't found is a description of exactly what the kernel is
: missing to allow floating point operations to be done there.
FPU context is assumed to only change in user processes. You'd have
to fix the FPU state saving code to cope with it changing everywhere,
or you'd have to explicitly put the goo to save/restore it around the
FP you want to do in the kernel. You had also make sure that the
floating point exceptions never trap, since trapping inside the kernel
has very limited support. You'll have to fix the problems that this
would cause, or force the FPU into a state where it never traps.
Sure, maybe you can make it happen. However, you are in for much pain
and suffering. The kernel isn't a general purpose computing
environment, and trying to pretend it is will lead to suffering.
Especially inside of an interrupt handler. It is less bad if this is
an ithread, but could be quite painful if you want to do this inside
of a fast interrupt handler to reduce latency.
I'd recommend strongly against trying this and revaluate your true
need for FP in the kernel. From your other mail, you don't seem open
to this answer. If you don't take it, you are setting yourself up for
a lot of pain and suffering. It is your choice, however. If you do
manage to pull it of, I'd be very interested in see what things I
didn't know to warn you about...
Warner
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: Floating point in interrupt handler
- From: Daan Vreeken [PA4DAN]
- Re: Floating point in interrupt handler
- References:
- Floating point in interrupt handler
- From: Daan Vreeken [PA4DAN]
- Floating point in interrupt handler
- Prev by Date: Re: USB vs PAE
- Next by Date: Re: Getting nonstandard serial baud rates w/FTDI
- Previous by thread: Re: Floating point in interrupt handler
- Next by thread: Re: Floating point in interrupt handler
- Index(es):
Relevant Pages
- Re: floating point support
... I am not allowed using floating point in kernel. ... would require an
FPU for reasonable performance. ... sign up on the kernel developers mail list,
... (comp.os.linux.hardware) - Re: unresoved symbol _gp_disp
... NO FLOATING POINT in the kernel PERIOD. ... save the FP context explicitely
and disable preemption. ... designed to support userspace. ... (Linux-Kernel) - Re: floating point support
... I am not allowed using floating point in kernel. ... Do you mean "I turned
on FPU ... I think Hagit is going for development speed over raw performance. ...
(comp.os.linux.hardware) - Re: Using math.h in driver
... but there is rarely a good reason to use a floating point value. ... Windows
2k/XP/2k3 Filesystem and Driver Consulting ... > a ceilfunction in kernel? ...
>> Don Burn (MVP, Windows DDK) ... (microsoft.public.win32.programmer.kernel) - Re: floating point emulation in 2.6 driver module
... restrictions on what the floating point can do. ... Without reading i387
datasheets, I can't tell you what guarantees that produces. ... gcc will then work "happily".
... > To all intents and purposes, there is no floating point in the kernel - ...
(comp.os.linux.development.system)