summaryrefslogtreecommitdiffstats
path: root/sys/isa
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-07-08 18:56:58 +0000
committerjhb <jhb@FreeBSD.org>2003-07-08 18:56:58 +0000
commit810e95d9a74415521fcdc42fec34f678a610e04a (patch)
tree2c8ec1ca0802f7a41f339b63f59cd44e147b3eee /sys/isa
parent6c736e55e449a0fa1a9047c02939778d0d4687a4 (diff)
downloadFreeBSD-src-810e95d9a74415521fcdc42fec34f678a610e04a.zip
FreeBSD-src-810e95d9a74415521fcdc42fec34f678a610e04a.tar.gz
- Make the isab devclass global to allow for multiple ISA bridge drivers.
- Factor out code common to all ISA bridge drivers attach methods into a isab_attach() function. - Rename the PCI-ISA bridge driver's attach function to pci_isab_attach() and have it call isab_attach().
Diffstat (limited to 'sys/isa')
-rw-r--r--sys/isa/isa_common.c17
-rw-r--r--sys/isa/isavar.h5
2 files changed, 22 insertions, 0 deletions
diff --git a/sys/isa/isa_common.c b/sys/isa/isa_common.c
index 3e36a52..4f84093 100644
--- a/sys/isa/isa_common.c
+++ b/sys/isa/isa_common.c
@@ -1117,3 +1117,20 @@ DRIVER_MODULE(isa, eisab, isa_driver, isa_devclass, 0, 0);
DRIVER_MODULE(isa, legacy, isa_driver, isa_devclass, 0, 0);
#endif
MODULE_VERSION(isa, 1);
+
+/*
+ * Code common to ISA bridges.
+ */
+
+devclass_t isab_devclass;
+
+int
+isab_attach(device_t dev)
+{
+ device_t child;
+
+ child = device_add_child(dev, "isa", 0);
+ if (child != NULL)
+ return (bus_generic_attach(dev));
+ return (ENXIO);
+}
diff --git a/sys/isa/isavar.h b/sys/isa/isavar.h
index d0306e0..5a7621e 100644
--- a/sys/isa/isavar.h
+++ b/sys/isa/isavar.h
@@ -152,6 +152,9 @@ ISA_ACCESSOR(logicalid, LOGICALID, int)
ISA_ACCESSOR(compatid, COMPATID, int)
ISA_ACCESSOR(configattr, CONFIGATTR, int)
+/* Device class for ISA bridges. */
+extern devclass_t isab_devclass;
+
extern intrmask_t isa_irq_pending(void);
extern void isa_probe_children(device_t dev);
@@ -164,6 +167,8 @@ extern void isa_dma_release(int chan);
extern int isa_dmastatus(int chan);
extern int isa_dmastop(int chan);
+int isab_attach(device_t dev);
+
#ifdef PC98
#include <machine/bus.h>
OpenPOWER on IntegriCloud