Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Mar 2012 09:24:06 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-drivers@freebsd.org
Cc:        Yong Fan <yong.fan@exar.com>, "drivers@FreeBSD.org" <drivers@freebsd.org>
Subject:   Re: How can I decide whether my code is running in interrupt context or not?
Message-ID:  <201203190924.06912.jhb@freebsd.org>
In-Reply-To: <88AB8EB2D3F1D249AE07FAFFF17A396F0384C3956A@HZU1EXCH02.hq.exar.com>
References:  <88AB8EB2D3F1D249AE07FAFFF17A396F0384C3956A@HZU1EXCH02.hq.exar.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, March 15, 2012 10:06:13 pm Yong Fan wrote:
> Hi all,
> 
> In Linux, I can use in_interrupt() function.
> FreeBSD has such a similar kernel function for drivers?

Hmm, we do not, though the only part of your driver that can run in primary 
interrupt context is an interrupt filter.  If you mean interrupt-thread 
context (i.e. when sleeping is not permitted), then that would apply to your 
normal interrupt handler and any callout routines that you have.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203190924.06912.jhb>