Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jun 2004 17:01:07 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Roman Kurakin <rik@cronyx.ru>
Cc:        freebsd-current@freebsd.org
Subject:   Re: How to catch interrupt
Message-ID:  <20040617164703.H2144@gamplex.bde.org>
In-Reply-To: <40D0CABA.1020101@cronyx.ru>
References:  <40D070B7.5000009@cronyx.ru> <20040617080547.F8883@gamplex.bde.org> <40D0CABA.1020101@cronyx.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 17 Jun 2004, Roman Kurakin wrote:

> Bruce Evans:
> >However, you may only need to test for pending interrupts.  This can
> >be done for isa interrupts using isa_irq_pending() to get a bitmap of
> >
> It seems that this function is not working for interrupts that were
> already used
> by some driver before I call it.

It only works for unacknowledged interrupts, so it can only work for
masked interrupts.  See sio.c:

% 	/*
% 	 * We don't want to get actual interrupts, just masked ones.
% 	 * Interrupts from this line should already be masked in the ICU,
% 	 * but mask them in the processor as well in case there are some
% 	 * (misconfigured) shared interrupts.
% 	 */
% 	mtx_lock_spin(&sio_lock);

Note that masking interrupts in the processor only helps for the non-SMP
case, and the comment has rotted:
- the code acquires a spinlock.  It only masks interrupts as a BAD side
  effect.  In my version, acquiring a spinlock doesn't mask processor
  interrupts, and there is an explicit intr_disable().
- interrupts can now be shared in some non-misconfigured cases.

Bruce



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