summaryrefslogtreecommitdiffstats
path: root/sys/alpha/isa
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1998-11-18 23:53:12 +0000
committerdfr <dfr@FreeBSD.org>1998-11-18 23:53:12 +0000
commita9a7505ea55da0dae2adcdd16b923b525db56915 (patch)
tree7fe81537bbce02016b388ab42b241160e2f609b5 /sys/alpha/isa
parent86637d9d69b15e53584133a4b1ffd05cddf6fdf6 (diff)
downloadFreeBSD-src-a9a7505ea55da0dae2adcdd16b923b525db56915.zip
FreeBSD-src-a9a7505ea55da0dae2adcdd16b923b525db56915.tar.gz
Fix things so that pci interrupts can be registered correctly on apecs
and lca machines (which route PCI interrupts through the ISA PIC). Reviewed by: dima
Diffstat (limited to 'sys/alpha/isa')
-rw-r--r--sys/alpha/isa/isa.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/sys/alpha/isa/isa.c b/sys/alpha/isa/isa.c
index 7eebcd2..84ef87b 100644
--- a/sys/alpha/isa/isa.c
+++ b/sys/alpha/isa/isa.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: isa.c,v 1.5 1998/10/25 01:30:16 paul Exp $
+ * $Id: isa.c,v 1.6 1998/11/15 18:25:16 dfr Exp $
*/
#include <sys/param.h>
@@ -468,27 +468,36 @@ isa_alloc_resource(device_t bus, device_t child, int type, int *rid,
{
int isdefault;
struct resource *rv, **rvp;
- struct isa_device *id = DEVTOISA(child);
+ struct isa_device *id;
+ if (child)
+ id = DEVTOISA(child);
+ else
+ id = NULL;
isdefault = (start == 0UL && end == ~0UL && *rid == 0);
if (*rid > 1)
return 0;
switch (type) {
case SYS_RES_IRQ:
- if (isdefault && id->id_irq[0] >= 0) {
+ /*
+ * The hack implementation of intr_create() passes a
+ * NULL child device.
+ */
+ if (isdefault && (id == NULL || id->id_irq[0] >= 0)) {
start = id->id_irq[0];
end = id->id_irq[0];
count = 1;
}
- rvp = &id->id_irqres[*rid];
rv = rman_reserve_resource(&isa_irq_rman,
start, end, count,
0, child);
if (!rv)
return 0;
- *rvp = rv;
- id->id_irq[*rid] = rv->r_start;
+ if (id) {
+ id->id_irqres[*rid] = rv;
+ id->id_irq[*rid] = rv->r_start;
+ }
return rv;
case SYS_RES_MEMORY:
OpenPOWER on IntegriCloud