From: rahnds Date: Fri, 31 Mar 2000 04:25:41 +0000 (+0000) Subject: Find last memory or io segment, in case multiple happen to be found, X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9a3bdd6101a5090d91c4a94600ae4e7df29f9f94;p=openbsd Find last memory or io segment, in case multiple happen to be found, allows imac to configure ohci. --- diff --git a/sys/arch/powerpc/pci/mpcpcibus.c b/sys/arch/powerpc/pci/mpcpcibus.c index 274b6df5e45..cb7dea20641 100644 --- a/sys/arch/powerpc/pci/mpcpcibus.c +++ b/sys/arch/powerpc/pci/mpcpcibus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpcpcibus.c,v 1.14 2000/03/24 06:56:41 rahnds Exp $ */ +/* $OpenBSD: mpcpcibus.c,v 1.15 2000/03/31 04:25:41 rahnds Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -386,6 +386,7 @@ mpcpcibrattach(parent, self, aux) } else #endif { + int found; /* mac configs */ @@ -395,29 +396,31 @@ mpcpcibrattach(parent, self, aux) sc->sc_iobus_space.bus_reverse = 1; /* find io(config) base, flag == 0x01000000 */ + found = 0; for (i = 0; prange[i].flags != 0; i++) { if (prange[i].flags == 0x01000000) { - /* find first? */ - break; + /* find last? */ + found = i; } } /* found the io space ranges */ - if (prange[i].flags == 0x01000000) { + if (prange[found].flags == 0x01000000) { sc->sc_iobus_space.bus_base = - prange[i].base; + prange[found].base; } + found = 0; /* find mem base, flag == 0x02000000 */ for (i = 0; prange[i].flags != 0; i++) { if (prange[i].flags == 0x02000000) { - /* find first? */ - break; + /* find last? */ + found = i; } } /* found the mem space ranges */ - if (prange[i].flags == 0x02000000) { + if (prange[found].flags == 0x02000000) { sc->sc_membus_space.bus_base = - prange[i].base; + prange[found].base; } if ( (sc->sc_iobus_space.bus_base == 0) || (sc->sc_membus_space.bus_base == 0)) {