Subject: Re: how to detect if kernel is running in interrupt ctx
To: Ming Lei <>
From: Jaromir Dolecek <>
List: tech-kern
Date: 06/29/2003 16:08:49
Ming Lei wrote:
> In linux, there is a macro called in_interrupt which can tell if the kernel
> is running in interrupt(including hardware or software) or not because linux
> changes some flags when in or out of the interrupt. Is there any same
> facility in netbsd?

In NetBSD, the code needs to be structured so that the driver code
would know whether it's running from interrupt or not. Normally
you shouldn't even worry about this, typically most of driver code
runs from within interrupt handler (driver's foo_intr() routine).
Why would you need to distinguish the two cases?

Jaromir Dolecek <>  
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-