Date: Tue, 7 May 1996 16:46:43 -0700 From: Andrew McRae <amcrae@cisco.com> To: hackers@freebsd.org Subject: Re: shared interrupts? Message-ID: <199605072346.QAA09955@doberman.cisco.com>
next in thread | raw e-mail | index | archive | help
se@zpr.uni-koeln.de (Stefan Esser): > On May 6, 16:02, "Amancio Hasty Jr." wrote: > } Subject: Re: shared interrupts? > } > > Is it possible for PCI devices to shared interrupts? > } > > } > Yes. > } > > } > > And if so how does one identify which device is generating the interrupt? > } > > } > One asks each device sharing the interrupt "Are *yo* talking to *me*?". > } > > } > 8-). > } > } Okay, specifically how does one ask each device "Are you really talking > } to me?" > > Well, that specific question is easy to answer (but I > don't know whether you'll like this particular answer :) As an example, the PC-Card stuff does this to allow multiple devices (Ether, modem) to exist together on the same PC-Card slot. A standard interrupt handler is installed that polls each actual device interrupt handler in turn; a device interrupt handler returning 0 indicates that this particular device has no interrupt outstanding e.g: /* * slot_irq_handler - Interrupt handler for shared irq devices. */ static void slot_irq_handler(int sp) { struct pccard_dev *dp; /* * For each device that has the shared interrupt, * call the interrupt handler. If the interrupt was * caught, the handler returns true. */ for (dp = ((struct slot *)sp)->devices; dp; dp = dp->next) if (dp->isahd.id_irq && dp->running && dp->drv->handler(dp)) return; printf("Slot %d, unfielded interrupt (%d)\n", ((struct slot *)sp)->slot, ((struct slot *)sp)->irq); } One problem with this are bugs (h/w or s/w) that cause an interrupt but the device doesn't own up (often caused by a race condition when the device is manipulated by interrupt unmasked code). Another common problem is dumb devices that don't have interrupt pending testable bits. The interrupt mechanism of the PC sucks. Andrew McRae (amcrae@cisco.com)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605072346.QAA09955>