Correct parsing of the grackle and uninorthpci ranges property.

Approved by: nwhitehorn (mentor)
This commit is contained in:
andreast 2011-01-20 20:22:19 +00:00
parent 6d8a904d49
commit ad366db201
4 changed files with 10 additions and 4 deletions

View File

@ -199,11 +199,14 @@ grackle_attach(device_t dev)
return (ENXIO);
}
sc->sc_nrange /= sizeof(sc->sc_range[0]);
sc->sc_range[6].pci_hi = 0;
io = NULL;
nmem = 0;
for (rp = sc->sc_range; rp->pci_hi != 0; rp++) {
for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange &&
rp->pci_hi != 0; rp++) {
switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) {
case OFW_PCI_PHYS_HI_SPACE_CONFIG:
break;

View File

@ -45,7 +45,7 @@ struct grackle_softc {
vm_offset_t sc_addr;
vm_offset_t sc_data;
int sc_bus;
struct grackle_range sc_range[6];
struct grackle_range sc_range[7];
int sc_nrange;
int sc_iostart;
struct rman sc_io_rman;

View File

@ -231,11 +231,14 @@ uninorth_attach(device_t dev)
return (ENXIO);
}
sc->sc_nrange /= sizeof(sc->sc_range[0]);
sc->sc_range[6].pci_hi = 0;
io = NULL;
nmem = 0;
for (rp = sc->sc_range; rp->pci_hi != 0; rp++) {
for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange &&
rp->pci_hi != 0; rp++) {
switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) {
case OFW_PCI_PHYS_HI_SPACE_CONFIG:
break;

View File

@ -53,7 +53,7 @@ struct uninorth_softc {
vm_offset_t sc_addr;
vm_offset_t sc_data;
int sc_bus;
struct uninorth_range sc_range[6];
struct uninorth_range sc_range[7];
int sc_nrange;
int sc_iostart;
struct rman sc_io_rman;