From owner-freebsd-current@FreeBSD.ORG Wed Jun 16 22:20:26 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 D529516A4CE for ; Wed, 16 Jun 2004 22:20:26 +0000 (GMT) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 59DE943D55 for ; Wed, 16 Jun 2004 22:20:26 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87])i5GMK05v020466; Thu, 17 Jun 2004 08:20:00 +1000 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i5GMJwaU002212; Thu, 17 Jun 2004 08:19:59 +1000 Date: Thu, 17 Jun 2004 08:19:58 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Roman Kurakin In-Reply-To: <40D070B7.5000009@cronyx.ru> Message-ID: <20040617080547.F8883@gamplex.bde.org> References: <40D070B7.5000009@cronyx.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: Wed, 16 Jun 2004 22:20:26 -0000 On Wed, 16 Jun 2004, Roman Kurakin wrote: > How to catch interrupt for ISA device before registering handler for it? This cannot be done without duplicating lots of interrupt handler registration code. (Actually only a little for a quick MD hack: just setidt() to point to an interrupt handler, plus enabling the ICU^WPIC, plus changing the normal code to not un-enable the PIC. npx.c still does something like this in RELENG_4.) 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 pending irqs. See sio.c. On i386's there are also some newer harder to use even less portable interfaces for determining pending irqs. See i386/include/intr_machdep.h. Bruce