Subject: Re: how do I tell if I'm on the interrupt stack?
To: Bill Studenmund <wrstuden@netbsd.org>
From: Matthew Jacob <mjacob@feral.com>
List: tech-kern
Date: 09/05/2001 16:26:50
On Tue, 4 Sep 2001, Bill Studenmund wrote:

> On Wed, 5 Sep 2001, Matthew Jacob wrote:
>
> >
> > Hmm? How?
> >
> > I mean, without mucking with the code that got started outside my driver?
>
> I think the idea is that you make can-sleep and can't-sleep entry points.
> All they might do is set a parameter and then call a common routine, which
> uses that parameter to tell if it can sleep.
>
> You then tell the things which will call you when you can sleep to use the
> can-sleep entry, and the ones which will call you in an interrupt context
> you give the can't sleep one.
>
> I am making one big assumption here - that there is no way that one single
> registration (like registering an interrupt handler or a call back, etc.)
> won't call you sometimes in an interrupt context and sometimes not.
>
> Does that make sense?

Yes. But the problem turns out to be that there are entry points which I
*can't* vary that can, apparently, be called from interrupt context or not-
and I'd been assuming that I could at least be the one to tell if they were in
interrupt context because it couldn't have gotten there w/o going through me.
That turns out to not be the case.


-matt