adapt to systems with out interrupt-map & interrupt-map-mask properties.
This commit is contained in:
parent
b11582be50
commit
af58b235e0
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pci_machdep.c,v 1.20 2001/03/06 08:09:16 mrg Exp $ */
|
||||
/* $NetBSD: pci_machdep.c,v 1.21 2001/03/21 01:33:48 mrg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999, 2000 Matthew R. Green
|
||||
|
@ -149,7 +149,7 @@ pci_attach_hook(parent, self, pba)
|
|||
if (getprop(node, "interrupts", sizeof(int), &n, (void **)&ip))
|
||||
continue;
|
||||
DPRINTF(SPDB_INTFIX, (" got interrupts"));
|
||||
|
||||
|
||||
/* and if there isn't an "assigned-addresses" we can't find b/d/f */
|
||||
if (getprop(node, "assigned-addresses", sizeof(int), &n,
|
||||
(void **)&ap))
|
||||
|
@ -171,6 +171,17 @@ pci_attach_hook(parent, self, pba)
|
|||
tag = pci_make_tag(pc, bus, dev, fn);
|
||||
|
||||
DPRINTF(SPDB_INTFIX, ("; tag %08x\n\t; reg: hi %x mid %x lo %x intr %x", tag, pr->phys_hi, pr->phys_mid, pr->phys_lo, *ip));
|
||||
|
||||
/*
|
||||
* if there is no interrupt-map property in the parent, we must
|
||||
* assume our "interrupts" property is valid.
|
||||
*/
|
||||
if (pp->pp_nintmap == 0) {
|
||||
intr = *ip;
|
||||
DPRINTF((SPDB_INTFIX|SPDB_INTMAP), ("\n\t ; no interrupt-map, using intr %x", *ip));
|
||||
goto bingo;
|
||||
}
|
||||
|
||||
DPRINTF(SPDB_INTFIX, ("\n\t; intmapmask: hi %x mid %x lo %x intr %x", pp->pp_intmapmask.phys_hi, pp->pp_intmapmask.phys_mid,
|
||||
pp->pp_intmapmask.phys_lo, pp->pp_intmapmask.intr));
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: psycho.c,v 1.31 2001/03/06 08:09:16 mrg Exp $ */
|
||||
/* $NetBSD: psycho.c,v 1.32 2001/03/21 01:33:47 mrg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999, 2000 Matthew R. Green
|
||||
|
@ -645,7 +645,8 @@ psycho_get_registers(node, rp, np)
|
|||
|
||||
if (getprop(node, "reg", sizeof(**rp), np, (void **)rp))
|
||||
panic("could not get psycho registers");
|
||||
DPRINTF(PDB_PROM, ("psycho debug: got `reg' for node %08x: %d entries\n", node, *np));
|
||||
DPRINTF(PDB_PROM,
|
||||
("psycho debug: got `reg' for node %08x: %d entries\n", node, *np));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -655,9 +656,14 @@ psycho_get_intmap(node, imp, np)
|
|||
int *np;
|
||||
{
|
||||
|
||||
if (getprop(node, "interrupt-map", sizeof(**imp), np, (void **)imp))
|
||||
panic("could not get psycho interrupt-map");
|
||||
DPRINTF(PDB_PROM, ("psycho debug: got `interupt-map' for node %08x\n", node));
|
||||
if (getprop(node, "interrupt-map", sizeof(**imp), np, (void **)imp)) {
|
||||
DPRINTF(PDB_PROM,
|
||||
("psycho debug: no `interupt-map' for node %08x\n", node));
|
||||
*imp = 0;
|
||||
*np = 0;
|
||||
} else
|
||||
DPRINTF(PDB_PROM,
|
||||
("psycho debug: got `interupt-map' for node %08x\n", node));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -668,11 +674,16 @@ psycho_get_intmapmask(node, immp)
|
|||
int n;
|
||||
|
||||
if (getprop(node, "interrupt-map-mask", sizeof(*immp), &n,
|
||||
(void **)&immp))
|
||||
panic("could not get psycho interrupt-map-mask");
|
||||
(void **)&immp)) {
|
||||
DPRINTF(PDB_PROM,
|
||||
("psycho debug: no `interrupt-map-mask' for node %08x\n",
|
||||
node));
|
||||
return;
|
||||
}
|
||||
if (n != 1)
|
||||
panic("broken psycho interrupt-map-mask");
|
||||
DPRINTF(PDB_PROM, ("psycho debug: got `interrupt-map-mask' for node %08x\n", node));
|
||||
DPRINTF(PDB_PROM,
|
||||
("psycho debug: got `interrupt-map-mask' for node %08x\n", node));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue