In isa_attach_hook(), set a variable to indicate that an ISA bus has

been attached to the system.  If, by the time mainbus wants to attach
an ISA an ISA has not yet been attached to the system, attempt to attach
an ISA to mainbus.
This commit is contained in:
thorpej 1996-11-28 02:43:53 +00:00
parent c645414c6e
commit 9a6796b559
2 changed files with 17 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mainbus.c,v 1.15 1996/11/22 00:19:08 jtk Exp $ */
/* $NetBSD: mainbus.c,v 1.16 1996/11/28 02:43:58 thorpej Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -73,6 +73,12 @@ union mainbus_attach_args {
#endif
};
/*
* This is set when the ISA bus is attached. If it's not set by the
* time it's checked below, then mainbus attempts to attach an ISA.
*/
int isa_has_been_seen;
/*
* Probe for the mainbus; always succeeds.
*/
@ -120,7 +126,7 @@ mainbus_attach(parent, self, aux)
config_found(self, &mba.mba_eba, mainbus_print);
}
if (1 /* XXX ISA NOT YET SEEN */) {
if (isa_has_been_seen == 0) {
mba.mba_iba.iba_busname = "isa";
mba.mba_iba.iba_iot = I386_BUS_SPACE_IO;
mba.mba_iba.iba_memt = I386_BUS_SPACE_MEM;

View File

@ -1,4 +1,4 @@
/* $NetBSD: isa_machdep.c,v 1.16 1996/11/20 14:09:07 mycroft Exp $ */
/* $NetBSD: isa_machdep.c,v 1.17 1996/11/28 02:43:53 thorpej Exp $ */
/*-
* Copyright (c) 1993, 1994, 1996 Charles M. Hannum. All rights reserved.
@ -333,6 +333,13 @@ isa_attach_hook(parent, self, iba)
struct device *parent, *self;
struct isabus_attach_args *iba;
{
extern int isa_has_been_seen;
/* Nothing to do. */
/*
* Notify others that might need to know that the ISA bus
* has now been attached.
*/
if (isa_has_been_seen)
panic("isaattach: ISA bus already seen!");
isa_has_been_seen = 1;
}