Subject: Re: splassert
To: None <itojun@iijlab.net>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 06/20/2002 10:12:16
On Thu, 20 Jun 2002 itojun@iijlab.net wrote:

> >> On some architectures the spl "level" is a bit mask that you can't compare
> >> this way.
> >I am well aware of that. I was simply suggesting to put the MD/MI boundary
> >at a different level (i.e. by implementing curspl()), so that one could
> >use the normal higher level assert functions.
>
> 	curspl() model assumes that there's total order defined between assert
> 	levels, and it is possible to detect the current spl level from the
> 	hardware setting.  it seems to me a strong assumption.

Uhm, we don't have a curspl() function right now correct? Itojun and
Frank?

So why are we discussing how a function we don't have won't work? Why not
define a routine that will work?

We have two different interrupt methods in use. Some ports use masks, some
numbers. Why not have curspl() return the correct one? either a mask or a
number?

We then have an splcompare() function (or SPLCOMPARE() macro). For mask
ports, it's the inversion followed by AND that Itojun posted. For number
ports, it's a comparison operator. We factor this out as while getting the
spl is port-specific, we will have only one of two compare types (number
or mask).

Note not sure what to do about some of the softint things Art mentioned.

Then all we need are ASSERT()s.

Take care,

Bill