Subject: Re: Floating point in the kernel
To: Dr. Bill Studenmund <firstname.lastname@example.org>
From: Todd Vierling <email@example.com>
Date: 09/18/1998 16:57:25
On Fri, 18 Sep 1998, Dr. Bill Studenmund wrote:
: Would it be possible to let the lkm do floating point, assuming it's
: sufficiently careful? I.E. how much as to change in the kernel to let code
: do this?
: I agree that in general we don't want to permit it, but it sounds like
: this application needs it. So a viable compromise would be for the driver
: to set some sort of soft interupt level to keep the scheduler from
: switching to a different user process, saving the FPU state, and then
: letting the code have at it. When the code's done, it just resets the FPU
: state, and lowers the spl level.
The only level that prevents that kind of switch is splhigh(), and you
definitely don't want your FPU intrinsics running there. Particularly when
kernel threads arrive (and your code will be required to be reentrant), that
will break anyway.
The best answer is "sorry, you can't do it, OK?" A less appropriate answer
is "you can do it, but it would be highly machine dependent and NetBSD
-- Todd Vierling (Personal firstname.lastname@example.org; Bus. email@example.com)