diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2010-07-01 03:20:40 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2010-07-01 03:20:40 +0000 |
commit | b2735ac78382db6f10e2c1a21582733693b825bb (patch) | |
tree | b8011a9cdd5222b156fe4b36da8358ebf62b031f /sys/arch | |
parent | 241672bb6dfbe3c1c24caad5b6dc595bb19ffd59 (diff) |
Change scsibus(4)'s scsi_link array to an SLIST to save memory on
sparsely populated buses.
ok dlg@, krw@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mac68k/mac68k/autoconf.c | 10 | ||||
-rw-r--r-- | sys/arch/macppc/dev/mesh.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/autoconf.c | 6 |
3 files changed, 9 insertions, 11 deletions
diff --git a/sys/arch/mac68k/mac68k/autoconf.c b/sys/arch/mac68k/mac68k/autoconf.c index 4e4d1235155..f441a840df0 100644 --- a/sys/arch/mac68k/mac68k/autoconf.c +++ b/sys/arch/mac68k/mac68k/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.32 2009/03/15 20:40:25 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.33 2010/07/01 03:20:37 matthew Exp $ */ /* $NetBSD: autoconf.c,v 1.38 1996/12/18 05:46:09 scottr Exp $ */ /* @@ -160,8 +160,8 @@ target_to_unit(bus, target, lun) if (scsibus_cd.cd_devs[bus]) { scsi = (struct scsibus_softc *) scsibus_cd.cd_devs[bus]; - if (scsi->sc_link[target][lun]) { - sc_link = scsi->sc_link[target][lun]; + sc_link = scsi_get_link(scsi, target, lun); + if (sc_link != NULL) { sc_dev = (struct device *) sc_link->device_softc; return sc_dev->dv_unit; @@ -176,8 +176,8 @@ target_to_unit(bus, target, lun) } if (scsibus_cd.cd_devs[bus]) { scsi = (struct scsibus_softc *) scsibus_cd.cd_devs[bus]; - if (scsi->sc_link[target][lun]) { - sc_link = scsi->sc_link[target][lun]; + sc_link = scsi_get_link(scsi, target, lun); + if (sc_link != NULL) { sc_dev = (struct device *) sc_link->device_softc; return sc_dev->dv_unit; } diff --git a/sys/arch/macppc/dev/mesh.c b/sys/arch/macppc/dev/mesh.c index e5ac438ecc2..cb7d0031f49 100644 --- a/sys/arch/macppc/dev/mesh.c +++ b/sys/arch/macppc/dev/mesh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mesh.c,v 1.27 2010/06/28 18:31:01 krw Exp $ */ +/* $OpenBSD: mesh.c,v 1.28 2010/07/01 03:20:38 matthew Exp $ */ /* $NetBSD: mesh.c,v 1.1 1999/02/19 13:06:03 tsubai Exp $ */ /*- @@ -176,8 +176,6 @@ struct mesh_softc { struct device sc_dev; /* us as a device */ struct scsi_link sc_link; - struct scsibus_softc *sc_scsibus; - u_char *sc_reg; /* MESH base address */ bus_dmamap_t sc_dmamap; bus_dma_tag_t sc_dmat; diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c index 914d857cdc7..5473726a7c3 100644 --- a/sys/arch/sparc/sparc/autoconf.c +++ b/sys/arch/sparc/sparc/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.89 2010/06/29 21:28:10 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.90 2010/07/01 03:20:38 matthew Exp $ */ /* $NetBSD: autoconf.c,v 1.73 1997/07/29 09:41:53 fair Exp $ */ /* @@ -1707,14 +1707,14 @@ device_register(struct device *dev, void *aux) #if defined(SUN4) if (CPU_ISSUN4 && dev->dv_xname[0] == 's' && - target == 0 && sbsc->sc_link[0][0] == NULL) { + target == 0 && scsi_get_link(sbsc, 0, 0) == NULL) { /* * disk unit 0 is magic: if there is actually no * target 0 scsi device, the PROM will call * target 3 `sd0'. * XXX - what if someone puts a tape at target 0? */ - /* Note that sc_link[0][0] will be NULL when we are + /* Note that sbsc:0:0 will be NULL when we are * invoked to match the device for target 0, if it * exists. But then the attachment args will have * its own target set to zero. It this case, skip |