pass a bus_chipset_tag_t (defined in <machine/bus.h>) to the bus when

attaching, and to the devices when attaching them.  #include <machine/bus.h>
to make this backward compatible with old #include requirements.
Also, clean up idempotency so that isa/eisa/pci "var.h" headers are
consistent (make them all idempotent).
This commit is contained in:
cgd 1996-03-08 20:25:22 +00:00
parent 91d7642d30
commit 5087096150
3 changed files with 30 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: eisavar.h,v 1.3 1996/02/27 00:21:03 cgd Exp $ */
/* $NetBSD: eisavar.h,v 1.4 1996/03/08 20:25:22 cgd Exp $ */
/*
* Copyright (c) 1995, 1996 Christopher G. Demetriou
@ -41,6 +41,7 @@
* for EISA autoconfiguration.
*/
#include <machine/bus.h>
#include <dev/eisa/eisareg.h> /* For ID register & string info. */
@ -52,12 +53,16 @@ typedef int eisa_slot_t; /* really only needs to be 4 bits */
*/
struct eisabus_attach_args {
char *eba_busname; /* XXX should be common */
bus_chipset_tag_t eba_bc; /* XXX should be common */
};
/*
* EISA device attach arguments.
*/
struct eisa_attach_args {
bus_chipset_tag_t ea_bc;
eisa_slot_t ea_slot;
u_int8_t ea_vid[EISA_NVIDREGS];
u_int8_t ea_pid[EISA_NPIDREGS];

View File

@ -1,4 +1,4 @@
/* $NetBSD: isavar.h,v 1.18 1996/02/28 01:43:49 cgd Exp $ */
/* $NetBSD: isavar.h,v 1.19 1996/03/08 20:25:25 cgd Exp $ */
/*
* Copyright (c) 1995 Chris G. Demetriou
@ -36,23 +36,30 @@
* BSDI Id: isavar.h,v 1.5 1992/12/01 18:06:00 karels Exp
*/
#ifndef _DEV_ISA_ISAVAR_H_
#define _DEV_ISA_ISAVAR_H_
/*
* Definitions for ISA autoconfiguration.
*/
#include <sys/queue.h>
#include <machine/bus.h>
/*
* ISA bus attach arguments
*/
struct isabus_attach_args {
char *iba_busname; /* XXX should be common */
char *iba_busname; /* XXX should be common */
bus_chipset_tag_t iba_bc; /* XXX should be common */
};
/*
* ISA driver attach arguments
*/
struct isa_attach_args {
bus_chipset_tag_t ia_bc; /* bus chipset tag */
int ia_iobase; /* base i/o address */
int ia_iosize; /* span of ports used */
int ia_irq; /* interrupt request */
@ -83,6 +90,8 @@ struct isa_softc {
struct device sc_dev; /* base device */
TAILQ_HEAD(, isadev)
sc_subdevs; /* list of all children */
bus_chipset_tag_t sc_bc; /* bus chipset tag */
};
#define cf_iobase cf_loc[0]
@ -128,3 +137,5 @@ void isa_establish __P((struct isadev *, struct device *));
typedef enum { BUS_ISA, BUS_EISA } isa_type;
extern isa_type isa_bustype; /* type of bus; XXX should be in softc */
#endif /* _DEV_ISA_ISAVAR_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcivar.h,v 1.11 1996/02/28 01:44:44 cgd Exp $ */
/* $NetBSD: pcivar.h,v 1.12 1996/03/08 20:25:30 cgd Exp $ */
/*
* Copyright (c) 1994 Charles Hannum. All rights reserved.
@ -29,6 +29,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _DEV_PCI_PCIVAR_H_
#define _DEV_PCI_PCIVAR_H_
/*
* Definitions for PCI autoconfiguration.
*
@ -37,6 +40,8 @@
* separated into pci_machdep.h.
*/
#include <machine/bus.h>
#if (alpha + i386 != 1)
ERROR: COMPILING FOR UNSUPPORTED MACHINE, OR MORE THAN ONE.
#endif
@ -54,6 +59,7 @@ ERROR: COMPILING FOR UNSUPPORTED MACHINE, OR MORE THAN ONE.
*/
struct pcibus_attach_args {
char *pba_busname; /* XXX should be common */
bus_chipset_tag_t pba_bc; /* XXX should be common */
int pba_bus; /* PCI bus number */
int pba_maxndevs; /* max # of devs on bus [0..n-1] */
@ -63,6 +69,8 @@ struct pcibus_attach_args {
* PCI device attach arguments.
*/
struct pci_attach_args {
bus_chipset_tag_t pa_bc; /* bus chipset tag */
int pa_device;
int pa_function;
pcitag_t pa_tag;
@ -75,3 +83,5 @@ void pci_devinfo __P((pcireg_t, pcireg_t, int, char *));
pcitag_t pci_make_tag __P((int, int, int));
void *pci_map_int __P((pcitag_t, int, int (*)(void *), void *));
int pci_map_mem __P((pcitag_t, int, vm_offset_t *, vm_offset_t *));
#endif /* _DEV_PCI_PCIVAR_H_ */