Make sure the i/o and/or mem addresses aren't wildcarded (i.e. -1) before

using the address in a bus_space_map() call.
This commit is contained in:
thorpej 1997-10-19 18:56:39 +00:00
parent baa72d9de9
commit 29500b20c0
19 changed files with 107 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.111 1997/10/13 00:46:34 explorer Exp $ */
/* $NetBSD: fd.c,v 1.112 1997/10/19 19:00:20 thorpej Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995, 1996
@ -271,6 +271,10 @@ fdcprobe(parent, match, aux)
iot = ia->ia_iot;
rv = 0;
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == IOBASEUNK)
return 0;
/* Map the i/o space. */
if (bus_space_map(iot, ia->ia_iobase, FDC_NPORT, 0, &ioh))
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: lms.c,v 1.30 1996/10/21 22:27:41 thorpej Exp $ */
/* $NetBSD: lms.c,v 1.31 1997/10/19 19:00:24 thorpej Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles Hannum.
@ -95,6 +95,10 @@ lmsprobe(parent, match, aux)
bus_space_handle_t ioh;
int rv;
/* Disallow wildcarded i/o base. */
if (ia->ia_iobase == IOBASEUNK)
return 0;
/* Map the i/o space. */
if (bus_space_map(iot, ia->ia_iobase, LMS_NPORTS, 0, &ioh))
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: aha_isa.c,v 1.5 1997/08/27 11:25:04 bouyer Exp $ */
/* $NetBSD: aha_isa.c,v 1.6 1997/10/19 18:56:39 thorpej Exp $ */
/*
* Copyright (c) 1994, 1996, 1997 Charles M. Hannum. All rights reserved.
@ -81,6 +81,10 @@ aha_isa_probe(parent, match, aux)
struct aha_probe_data apd;
int rv;
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
if (bus_space_map(iot, ia->ia_iobase, AHA_ISA_IOSIZE, 0, &ioh))
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: aic_isa.c,v 1.2 1997/10/16 22:55:34 enami Exp $ */
/* $NetBSD: aic_isa.c,v 1.3 1997/10/19 18:56:43 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Charles M. Hannum. All rights reserved.
@ -105,6 +105,10 @@ aic_isa_probe(parent, match, aux)
bus_space_handle_t ioh;
int rv;
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
if (bus_space_map(iot, ia->ia_iobase, AIC_ISA_IOSIZE, 0, &ioh))
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ast.c,v 1.39 1997/10/16 00:29:28 thorpej Exp $ */
/* $NetBSD: ast.c,v 1.40 1997/10/19 18:56:46 thorpej Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -101,6 +101,10 @@ astprobe(parent, self, aux)
* XXX Needs more robustness.
*/
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
/* if the first port is in use as console, then it. */
if (com_is_console(iot, iobase, 0))
goto checkmappings;

View File

@ -1,4 +1,4 @@
/* $NetBSD: bha_isa.c,v 1.8 1997/08/27 11:25:07 bouyer Exp $ */
/* $NetBSD: bha_isa.c,v 1.9 1997/10/19 18:56:48 thorpej Exp $ */
/*
* Copyright (c) 1994, 1996, 1997 Charles M. Hannum. All rights reserved.
@ -81,6 +81,10 @@ bha_isa_probe(parent, match, aux)
struct bha_probe_data bpd;
int rv;
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
if (bus_space_map(iot, ia->ia_iobase, BHA_ISA_IOSIZE, 0, &ioh))
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: boca.c,v 1.25 1997/10/16 00:29:30 thorpej Exp $ */
/* $NetBSD: boca.c,v 1.26 1997/10/19 18:56:50 thorpej Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -93,6 +93,10 @@ bocaprobe(parent, self, aux)
* XXX Needs more robustness.
*/
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
/* if the first port is in use as console, then it. */
if (com_is_console(iot, iobase, 0))
goto checkmappings;

View File

@ -1,4 +1,4 @@
/* $NetBSD: com_isa.c,v 1.8 1997/10/16 00:29:32 thorpej Exp $ */
/* $NetBSD: com_isa.c,v 1.9 1997/10/19 18:56:52 thorpej Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995, 1996
@ -95,6 +95,10 @@ com_isa_probe(parent, match, aux)
int rv = 1;
struct isa_attach_args *ia = aux;
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
iot = ia->ia_iot;
iobase = ia->ia_iobase;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cy_isa.c,v 1.5 1996/10/21 22:40:36 thorpej Exp $ */
/* $NetBSD: cy_isa.c,v 1.6 1997/10/19 18:56:54 thorpej Exp $ */
/*
* cy.c
@ -45,6 +45,10 @@ cy_probe_isa(parent, match, aux)
sc.sc_memt = ia->ia_memt;
sc.sc_bustype = CY_BUSTYPE_ISA;
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
if (ia->ia_irq == IRQUNK) {
printf("%s: interrupt not defined\n", sc.sc_dev.dv_xname);
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: i82365_isa.c,v 1.2 1997/10/16 23:21:41 thorpej Exp $ */
/* $NetBSD: i82365_isa.c,v 1.3 1997/10/19 18:56:55 thorpej Exp $ */
#define PCICISADEBUG
@ -99,6 +99,10 @@ pcic_isa_probe(parent, match, aux)
bus_space_handle_t ioh, memh;
int val, found;
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
if (bus_space_map(iot, ia->ia_iobase, PCIC_IOSIZE, 0, &ioh))
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ed.c,v 1.116 1997/10/15 05:58:59 explorer Exp $ */
/* $NetBSD: if_ed.c,v 1.117 1997/10/19 18:57:00 thorpej Exp $ */
/*
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@ -269,6 +269,14 @@ ed_find_WD80x3(sc, cf, ia)
memsize = 8192;
isa16bit = 0;
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
/* Disallow wildcarded mem address. */
if (ia->ia_maddr == ISACF_IOMEM_DEFAULT)
return (0);
if (bus_space_map(iot, ia->ia_iobase, ED_WD_IO_PORTS, 0, &ioh))
return (0);
@ -709,6 +717,14 @@ ed_find_3Com(sc, cf, ia)
iot = ia->ia_iot;
memt = ia->ia_memt;
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
/* Disallow wildcarded mem address. */
if (ia->ia_maddr == ISACF_IOMEM_DEFAULT)
return (0);
if (bus_space_map(iot, ia->ia_iobase, ED_3COM_IO_PORTS, 0, &ioh))
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_eg.c,v 1.37 1997/10/15 05:59:16 explorer Exp $ */
/* $NetBSD: if_eg.c,v 1.38 1997/10/19 18:57:04 thorpej Exp $ */
/*
* Copyright (c) 1993 Dean Huxley <dean@fsa.ca>
@ -343,6 +343,10 @@ egprobe(parent, match, aux)
return 0;
}
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
/* Map i/o space. */
if (bus_space_map(iot, ia->ia_iobase, 0x08, 0, &ioh)) {
DPRINTF(("egprobe: can't map i/o space in probe\n"));

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_le_isa.c,v 1.13 1997/09/10 03:31:31 mycroft Exp $ */
/* $NetBSD: if_le_isa.c,v 1.14 1997/10/19 18:57:06 thorpej Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -171,6 +171,10 @@ le_isa_probe(parent, match, aux)
struct le_softc *lesc = match;
struct isa_attach_args *ia = aux;
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
if (bicc_isa_probe(lesc, ia))
return (1);
if (ne2100_isa_probe(lesc, ia))

View File

@ -1,4 +1,4 @@
/* $NetBSD: lpt_isa.c,v 1.45 1997/10/14 15:50:21 is Exp $ */
/* $NetBSD: lpt_isa.c,v 1.46 1997/10/19 18:57:09 thorpej Exp $ */
/*
* Copyright (c) 1993, 1994 Charles Hannum.
@ -173,6 +173,10 @@ lpt_isa_probe(parent, match, aux)
#define ABORT goto out
#endif
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
iot = ia->ia_iot;
base = ia->ia_iobase;
if (bus_space_map(iot, base, LPT_NPORTS, 0, &ioh))

View File

@ -1,4 +1,4 @@
/* $NetBSD: mcd.c,v 1.55 1997/10/08 23:10:06 thorpej Exp $ */
/* $NetBSD: mcd.c,v 1.56 1997/10/19 18:57:11 thorpej Exp $ */
/*
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
@ -867,6 +867,10 @@ mcdprobe(parent, match, aux)
bus_space_handle_t ioh;
int rv;
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
/* Map i/o space */
if (bus_space_map(iot, ia->ia_iobase, MCD_NPORT, 0, &ioh))
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtfps.c,v 1.33 1997/10/16 00:29:36 thorpej Exp $ */
/* $NetBSD: rtfps.c,v 1.34 1997/10/19 18:57:15 thorpej Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -95,6 +95,10 @@ rtfpsprobe(parent, self, aux)
* XXX Needs more robustness.
*/
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
/* if the first port is in use as console, then it. */
if (com_is_console(iot, iobase, 0))
goto checkmappings;

View File

@ -1,4 +1,4 @@
/* $NetBSD: uha_isa.c,v 1.9 1997/08/27 11:25:11 bouyer Exp $ */
/* $NetBSD: uha_isa.c,v 1.10 1997/10/19 18:57:17 thorpej Exp $ */
/*
* Copyright (c) 1994, 1996, 1997 Charles M. Hannum. All rights reserved.
@ -95,6 +95,10 @@ uha_isa_probe(parent, match, aux)
struct uha_probe_data upd;
int rv;
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
if (bus_space_map(iot, ia->ia_iobase, UHA_ISA_IOSIZE, 0, &ioh))
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: wds.c,v 1.21 1997/09/26 04:00:09 mycroft Exp $ */
/* $NetBSD: wds.c,v 1.22 1997/10/19 18:57:19 thorpej Exp $ */
#undef WDSDIAG
#ifdef DDB
@ -281,6 +281,10 @@ wdsprobe(parent, match, aux)
struct wds_probe_data wpd;
int rv;
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
if (bus_space_map(iot, ia->ia_iobase, WDS_ISA_IOSIZE, 0, &ioh))
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: wt.c,v 1.39 1997/08/08 09:38:18 jonathan Exp $ */
/* $NetBSD: wt.c,v 1.40 1997/10/19 18:57:22 thorpej Exp $ */
/*
* Streamer tape driver.
@ -200,6 +200,10 @@ wtprobe(parent, match, aux)
int rv = 0;
/* Disallow wildcarded i/o address. */
if (ia->ia_iobase == ISACF_PORT_DEFAULT)
return (0);
/* Map i/o space */
if (bus_space_map(iot, ia->ia_iobase, AV_NPORT, 0, &ioh))
return 0;