Subject: Re: intlock
To: YAMAMOTO Takashi <firstname.lastname@example.org>
From: Frank van der Linden <email@example.com>
Date: 02/23/2004 13:08:30
> while x86_intlock() currently uses the previous spl (if_ppl) to
> determine if the kernel lock is needed or not,
> what really matters there is the interrupt handler's own IPL_.
> i'd like to check the attached diff if no one objects.
> (it's a little ugly but i don't think it's a problem because
> the kernel lock should go away eventually anyway :-)
It's true that the ipl at the time of the interruption is checked.
However, that works out fine, because if you get as far as calling
the handler, it means that the handler has registered at a level
> the current spl. So, the test is the same, you're just moving
it to a different place.
What's the advantage of doing that?
If you want to get rid of this hack in a proper way, it would be
to store an "mpsafe" attribute in the handler structure, always
call a stub function, and have that take the lock depending
on the flag.
Of course, for that, all intr_establish functions need an extra
flag passed in, and all device drivers must be changed to use it..