Subject: Re: how to detect if kernel is running in interrupt ctx
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 06/30/2003 01:29:49
> Is there any way to detect if the code is running in interrupt, even
> in a archtect dependent way, such as, cpu register?

Without specifying what architecture(s) you care about, it's hard to
say.  On the VAX, "IPL != 0 and on the interrupt stack" is not a bad
approximation, though it can be fooled, and at some points during
context switch, I think it is, it will return true even though it's not
actually in interrupt context.  (Presumably the routine in question
won't be called then, but....)

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B