How can I decide whether my code is running in interrupt context or not?

Yong Fan yong.fan at exar.com
Tue Mar 20 01:43:30 UTC 2012


Thanks your warm reply.
I see.

Thanks
Yongfan

-----Original Message-----
From: John Baldwin [mailto:jhb at freebsd.org]
Sent: Monday, March 19, 2012 7:24 AM
To: freebsd-drivers at freebsd.org
Cc: Yong Fan; drivers at FreeBSD.org
Subject: Re: How can I decide whether my code is running in interrupt context or not?

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

The information and any attached documents contained in this message
may be confidential and/or legally privileged.  The message is
intended solely for the addressee(s).  If you are not the intended
recipient, you are hereby notified that any use, dissemination, or
reproduction is strictly prohibited and may be unlawful.  If you are
not the intended recipient, please contact the sender immediately by
return e-mail and destroy all copies of the original message.


More information about the freebsd-drivers mailing list