From owner-freebsd-current@FreeBSD.ORG Thu Jun 17 17:26:19 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7C7D216A4CE for ; Thu, 17 Jun 2004 17:26:19 +0000 (GMT) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 62AF043D2F for ; Thu, 17 Jun 2004 17:26:18 +0000 (GMT) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id i5HHN4mi053992 for freebsd-current@freebsd.org.checked; (8.12.8/vak/2.1) Thu, 17 Jun 2004 21:23:04 +0400 (MSD) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (hi.cronyx.ru [144.206.181.94]) by hanoi.cronyx.ru with ESMTP id i5HHKXvG053887; (8.12.8/vak/2.1) Thu, 17 Jun 2004 21:20:33 +0400 (MSD) (envelope-from rik@cronyx.ru) Message-ID: <40D1D2A8.2070000@cronyx.ru> Date: Thu, 17 Jun 2004 21:19:36 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031208 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruce Evans References: <40D070B7.5000009@cronyx.ru> <20040617080547.F8883@gamplex.bde.org> <40D0CABA.1020101@cronyx.ru> <20040617164703.H2144@gamplex.bde.org> In-Reply-To: <20040617164703.H2144@gamplex.bde.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-current@freebsd.org Subject: Re: How to catch interrupt X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2004 17:26:19 -0000 Bruce Evans wrote: >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. > > So spin lock should help me in some cases but there is other cases were this wouldn't help or I miss smth? In this case if some driver will acquire interrupt while probing and after this it will release it (for example it will decide that this is wrong intr and will try other), and after we will try to load sio driver we may fail to load it case we would unable to check this intr line. rik >Bruce >_______________________________________________ >freebsd-current@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-current >To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > > > >