From owner-freebsd-hackers Mon Jan 6 01:29:38 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id BAA22468 for hackers-outgoing; Mon, 6 Jan 1997 01:29:38 -0800 (PST) Received: from bugs.us.dell.com (bugs.us.dell.com [143.166.169.147]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id BAA22459 for ; Mon, 6 Jan 1997 01:29:35 -0800 (PST) Received: from ant.us.dell.com (ant.us.dell.com [198.64.66.34]) by bugs.us.dell.com (8.6.12/8.6.12) with SMTP id DAA13399; Mon, 6 Jan 1997 03:28:09 -0600 Message-Id: <3.0.1.32.19970106032347.0067e4ac@bugs.us.dell.com> X-Sender: tony@bugs.us.dell.com (Unverified) X-Mailer: Windows Eudora Light Version 3.0.1 beta 4 (32) Date: Mon, 06 Jan 1997 03:28:09 -0600 To: Bruce Evans , grog@lemis.de, msmith@atrad.adelaide.edu.au From: Tony Overfield Subject: Re: Ints (fwd) Cc: hackers@FreeBSD.ORG Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >One interesting side effect is that when the last device >disconnects from an IRQ line, the line usually floats high, and the >edge for this causes an interrupt. Thus "disabling" interrupts using >the tri-state control usually causes an interrupt. True, though on a "PC compatible" system, the IRQ _always_ goes high when not driven because there is always a pull-up resistor. >>> I thought the interrupt was just a pulse. It certainly was on the >>> 8251. > >Not for an 8250, or any device suitable for driving sensible (level >triggered) interrupts directly. There is a scheme for sharing ISA edge-triggered interrupts that involves pulsing. It works by declaring that the IRQ will remain high (by pull-up, not driven) until a device wants interrupt service. At that time the device pulses the IRQ low for 100-200 ns and then releases it again to cause the rising edge. Eventually, the interrupt occurs, and the interrupt service routine(s) must then check all the registered devices to see which one(s) caused the interrupt. Because the IRQ is pulled high by the pull-up resistor, spurious interrupts won't be generated. This may seem peculiar, but I've seen it in operation. >> 1) Device asserts IRQ signal. >> 2) 8259 detects edge, interrupts CPU >> 3) CPU performs interrupt acknowledge cycle, 8259 latches interrupt >> inputs. >> 4) CPU reads 8259, determines interrupting device >> 5) Interrupt handler manipulates peripheral, clears IRQ signal. >> >>If the input goes away between 2) and 3), you get a spurious interrupt (the >>8259 reports it as IRQ 7). If the input never goes away, there's no >>way for another edge to occur, so 2) never happens. > >No, the spurious interrupt is only generated if the interrupt goes away >during the interrupt ack cycle. Right, the CPU must recognize the CPU INTR signal and begin processing the interrupt before it can become spurious. A spurious interrupt results if an int-ack cycle occurs but the 8259 does not find an unmasked IRQ that is at a high level. Removing an IRQ before the 8259 sees its level during the int-ack usually causes an IRQ 7 (or always does, if the bouncing IRQ was a small one). But, as you may already know, you can also get a spurious IRQ 15 by removing an upper IRQ at just the right time (guess: during the 8259 IRQ scan, after the primary 8259 sees the cascade, but before the secondary 8259 sees the upper IRQ.) But the spurious interrupt is still usually IRQ 7, since the susceptible timing window is a little larger. It's larger because the IRQ could go away any time after the CPU recognizes the interrupt (before the int-ack even begins), but before the 8259 later scans for the (now missing) IRQ. Also, for whatever reasons, if the CPU were to wrongly see an asserted CPU INTR signal when the 8259 wasn't requesting it, a spurious IRQ 7 would result. Tony