From owner-freebsd-hackers Thu Jan 4 8: 0: 3 2001 From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 4 07:59:59 2001 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from theo.forman.homeip.net (pc68-lei2.cable.ntl.com [62.254.20.68]) by hub.freebsd.org (Postfix) with ESMTP id E8E2937B400 for ; Thu, 4 Jan 2001 07:59:58 -0800 (PST) Received: from localhost (mcf@localhost) by theo.forman.homeip.net (8.11.0/8.11.0) with ESMTP id f04Fxvd13769 for ; Thu, 4 Jan 2001 15:59:57 GMT (envelope-from mcf@forman.homeip.net) Date: Thu, 4 Jan 2001 15:59:57 +0000 (GMT) From: "Matthew C. Forman" To: freebsd-hackers@freebsd.org Subject: Allocating an IRQ on PCI Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi all, I want to allocate an IRQ for a PCI device driver. Normally this is easy enough, since the BIOS would reserve it for me, then I would just have to bus_alloc_resource and not even care which IRQ line it's using. Thing is, here the BIOS hasn't allocated an IRQ, so I'll need to bus_set_resource in my probe to get one. To complicate matters, the device's interrupt generator is pretty flexible, and can generate an interrupt on (almost) any IRQ line. I have to tell it which IRQ to use when I know which one has been allocated. I can see two possibilities to get this working: 1. Hardwire it, by using bus_set_resource with a specific IRQ. This isn't nice, as it'll fail if someone else's setup is already using the one I pick (or some other device attach will fail later on). 2. Find out what IRQs are free and set and allocate one of those. This is nicer than 1), but then if some poor device attach later on in boot was expecting to use that IRQ, it'll break. Does anyone know of a sensible & portable way around this? Perhaps IRQ sharing could save me in some way... Thanks in advance, Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message