Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/macppc/macppc Make the device_register code work on...



details:   https://anonhg.NetBSD.org/src/rev/c0ae2eab66cf
branches:  trunk
changeset: 481611:c0ae2eab66cf
user:      danw <danw%NetBSD.org@localhost>
date:      Wed Feb 02 16:41:56 2000 +0000

description:
Make the device_register code work on machines with multiple PCI bridges
with the same bus number (like the new G4s). Also, don't hardcode the
size of the pci_bridges array.

diffstat:

 sys/arch/macppc/macppc/autoconf.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (29 lines):

diff -r 0e87eb1d401c -r c0ae2eab66cf sys/arch/macppc/macppc/autoconf.c
--- a/sys/arch/macppc/macppc/autoconf.c Wed Feb 02 16:04:51 2000 +0000
+++ b/sys/arch/macppc/macppc/autoconf.c Wed Feb 02 16:41:56 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.16 2000/02/01 04:04:19 danw Exp $       */
+/*     $NetBSD: autoconf.c,v 1.17 2000/02/02 16:41:56 danw Exp $       */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -162,14 +162,15 @@
 
        if (DEVICE_IS(parent, "mainbus") && DEVICE_IS(dev, "pci")) {
                struct pcibus_attach_args *pba = aux;
-               int n;
+               int n, size = sizeof(pci_bridges) / sizeof(struct pci_bridge);
 
-               for (n = 0; n < 2; n++) {
+               for (n = 0; n < size; n++) {
                        if (pci_bridges[n].present &&
-                           pci_bridges[n].bus == pba->pba_bus)
+                           pci_bridges[n].bus == pba->pba_bus &&
+                           pci_bridges[n].reg[0] == addr)
                                break;
                }
-               if (n == 2 || addr != pci_bridges[n].reg[0])
+               if (n == size)
                        return;
        } else if (DEVICE_IS(parent, "pci")) {
                struct pci_attach_args *pa = aux;



Home | Main Index | Thread Index | Old Index