Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

3.0 and double operations in device drivers

0 views
Skip to first unread message

Luigi Rizzo

unread,
Dec 3, 1998, 3:00:00 AM12/3/98
to
> My question is: "Is floating point math now taboo in the kernel?"

it has always been!

luigi


To Unsubscribe: send mail to majo...@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message

Julian Elischer

unread,
Dec 4, 1998, 3:00:00 AM12/4/98
to
it always was taboo..
floating point operations need a process context to store results etc.
in the case of context changes (e.g. interrupts) etc.
BDE can be more accurate on this point I'm sure.

julian


On Thu, 3 Dec 1998, Mark Tinguely wrote:

> I was testing a device driver that I wrote for FreeBSD 2.2.x on a
> FreeBSD 3.0-RELEASE. When some double multiplication and divisions
> were executed, the system froze.
>
> It took a long time to find it was a FP problem, it acted like
> some aweful infinite loop.
>
> These routines are only used on a circuit setup to calculate some scheduling
> parameters, and I guess they can be done with integer math after some head
> scratching.


>
> My question is: "Is floating point math now taboo in the kernel?"
>

> --mark.

Doug Rabson

unread,
Dec 4, 1998, 3:00:00 AM12/4/98
to
On Thu, 3 Dec 1998, Eivind Eklund wrote:

> On Thu, Dec 03, 1998 at 09:47:46AM -0600, Mark Tinguely wrote:
> > > > My question is: "Is floating point math now taboo in the kernel?"
> > >

> > > it has always been!
> >
> > I asked for that one :). remove taboo and replace with "forbidden".
>
> It always has been.
>
> (Ie, it has never worked reliably, and this has been a known property
> of the design).

On the alpha, any floating point instructions executed by the kernel
(except some very careful ones during task switching) should cause a
panic.

--
Doug Rabson Mail: d...@nlsystems.com
Nonlinear Systems Ltd. Phone: +44 181 442 9037

Bruce Evans

unread,
Dec 4, 1998, 3:00:00 AM12/4/98
to
>> > > > My question is: "Is floating point math now taboo in the kernel?"
>> > >
>> > > it has always been!
>> >
>> > I asked for that one :). remove taboo and replace with "forbidden".
>>
>> It always has been.
>>
>> (Ie, it has never worked reliably, and this has been a known property
>> of the design).

What design? Most implementations don't support floating point in the
kernel because supporting would slow down interrupt handling and
context switching. Since some implementations don't support it, it
should never be used.

>On the alpha, any floating point instructions executed by the kernel
>(except some very careful ones during task switching) should cause a
>panic.

Same for all versions of FreeBSD on i386's, except there are also
some very careful ones in some versions of bcopy() and bzero().
Actually, not so careful. The panic for unexepected ones went away,
apparently to support unexpected ones in bcopy() or bzero(). See
trap.c rev.1.78.

Bruce

Andrzej Bialecki

unread,
Dec 6, 1998, 3:00:00 AM12/6/98
to
On Thu, 3 Dec 1998, Eivind Eklund wrote:

> On Thu, Dec 03, 1998 at 09:47:46AM -0600, Mark Tinguely wrote:

> > > > My question is: "Is floating point math now taboo in the kernel?"
> > >
> > > it has always been!
> >
> > I asked for that one :). remove taboo and replace with "forbidden".
>
> It always has been.
>
> (Ie, it has never worked reliably, and this has been a known property
> of the design).

Ok, guys, tell me what I'm missing here: if the FP math cannot be used in
kernel, then what for is the FPU emulator needed for SX processors???

Andrzej Bialecki

-------------------- ++-------++ -------------------------------------
<ab...@nask.pl> ||PicoBSD|| FreeBSD in your pocket? Go and see:
Research & Academic |+-------+| "Small & Embedded FreeBSD"
Network in Poland | |TT~~~| | http://www.freebsd.org/~picobsd/
-------------------- ~-+==---+-+ -------------------------------------

Poul-Henning Kamp

unread,
Dec 6, 1998, 3:00:00 AM12/6/98
to

>Ok, guys, tell me what I'm missing here: if the FP math cannot be used in
>kernel, then what for is the FPU emulator needed for SX processors???

For userland programs. If you execute an FP instruction the CPU traps into
the kernel which has to carry out the stuff (or kill the process).

--
Poul-Henning Kamp FreeBSD coreteam member
p...@FreeBSD.ORG "Real hackers run -current on their laptop."
"ttyv0" -- What UNIX calls a $20K state-of-the-art, 3D, hi-res color terminal

0 new messages