Subject: Re: splassert
To: None <itojun@iijlab.net>
From: Frank van der Linden <fvdl@wasabisystems.com>
List: tech-kern
Date: 06/20/2002 15:11:10
On Thu, Jun 20, 2002 at 09:53:37PM +0900, itojun@iijlab.net wrote:
> 	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.
> 	for instance, if i look at i386/include/intr.h, you see splfoo()
> 	implemented as splraise(imask[level]), and the "level" is not recorded
> 	anywhere.  i think it difficult to know the current spl level
> 	from the cpl value (= imask[level]).

Yes, it assumes ordering. And so does the diff you posted, it compares
wantedipl to cpl. Which is ok on OpenBSD, since they compare the
level. However, we compare masks, and the masks are in reverse IPL
order. So this code won't work correctly.

Please don't commit this, we can revisit this shortly, I am redoing
some of the i386 interrupt code for the i386mp merge.

- Frank

-- 
Frank van der Linden                           fvdl@wasabisystems.com
======================================================================
Quality NetBSD CDs, Support & Service.   http://www.wasabisystems.com/