diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-12-14 05:29:32 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-12-14 05:29:32 +0000 |
commit | 86b4fdd623d3c50d7bfd9427c2c9208454cd0da7 (patch) | |
tree | 5d95abcaf58d01703a30c7ab600537d3b8f67989 /sys/arch/vax/uba/ubavar.h | |
parent | e2cd6c399798843e13e76f49dc8ee048b51f99f1 (diff) |
update from netbsd (verbatim)
Diffstat (limited to 'sys/arch/vax/uba/ubavar.h')
-rw-r--r-- | sys/arch/vax/uba/ubavar.h | 72 |
1 files changed, 28 insertions, 44 deletions
diff --git a/sys/arch/vax/uba/ubavar.h b/sys/arch/vax/uba/ubavar.h index 24052ad19b6..23d190ebcc6 100644 --- a/sys/arch/vax/uba/ubavar.h +++ b/sys/arch/vax/uba/ubavar.h @@ -1,4 +1,4 @@ -/* $NetBSD: ubavar.h,v 1.6 1995/05/11 16:53:17 jtc Exp $ */ +/* $NetBSD: ubavar.h,v 1.8 1995/12/01 19:23:01 ragge Exp $ */ /* * Copyright (c) 1982, 1986 Regents of the University of California. @@ -39,14 +39,13 @@ * This file contains definitions related to the kernel structures * for dealing with the unibus adapters. * - * Each uba has a uba_hd structure. + * Each uba has a uba_softc structure. * Each unibus controller which is not a device has a uba_ctlr structure. * Each unibus device has a uba_device structure. */ -#ifndef LOCORE - #include "sys/buf.h" +#include "sys/device.h" /* * Per-uba structure. * @@ -68,7 +67,8 @@ * the unibus driver in resource wait (mrwant, bdpwant); these * wait states are also recorded here. */ -struct uba_hd { +struct uba_softc { + struct device uh_dev; /* Device struct, autoconfig */ int uh_type; /* type of adaptor */ struct uba_regs *uh_uba; /* virt addr of uba adaptor regs */ struct uba_regs *uh_physuba; /* phys addr of uba adaptor regs */ @@ -76,7 +76,9 @@ struct uba_hd { int uh_memsize; /* size of uba memory, pages */ caddr_t uh_mem; /* start of uba memory address space */ caddr_t uh_iopage; /* start of uba io page */ - int (**Nuh_vec)(); /* interrupt vector */ + void (**Nuh_vec)(); /* interrupt vector */ + struct ivec_dsp *uh_idsp; /* Interrupt dispatch area */ + u_int *uh_iarea; /* Interrupt vector array */ struct uba_device *uh_actf; /* head of queue to transfer */ struct uba_device *uh_actl; /* tail of queue to transfer */ short uh_mrwant; /* someone is waiting for map reg */ @@ -96,7 +98,7 @@ struct uba_hd { }; /* given a pointer to uba_regs, find DWBUA registers */ -/* this should be replaced with a union in uba_hd */ +/* this should be replaced with a union in uba_softc */ #define BUA(uba) ((struct dwbua_regs *)(uba)) /* @@ -115,9 +117,9 @@ struct uba_ctlr { short um_ctlr; /* controller index in driver */ short um_ubanum; /* the uba it is on */ short um_alive; /* controller exists */ - int (*um_intr)(); /* interrupt handler(s) */ + void (*um_intr)(); /* interrupt handler(s) */ caddr_t um_addr; /* address of device in i/o space */ - struct uba_hd *um_hd; + struct uba_softc *um_hd; /* the driver saves the prototype command here for use in its go routine */ int um_cmd; /* communication to dgo() */ int um_ubinfo; /* save unibus registers, etc */ @@ -147,7 +149,7 @@ struct uba_device { short ui_ctlr; /* mass ctlr number; -1 if none */ short ui_ubanum; /* the uba it is on */ short ui_slave; /* slave on controller */ - int (*ui_intr)(); /* interrupt handler(s) */ + void (*ui_intr)(); /* interrupt handler(s) */ caddr_t ui_addr; /* address of device in i/o space */ short ui_dk; /* if init 1 set to number for iostat */ int ui_flags; /* parameter from system specification */ @@ -158,7 +160,7 @@ struct uba_device { struct uba_device *ui_forw; /* if the device is connected to a controller, this is the controller */ struct uba_ctlr *ui_mi; - struct uba_hd *ui_hd; + struct uba_softc *ui_hd; }; /* @@ -182,7 +184,19 @@ struct uba_driver { short ud_keepbdp; /* hang on to bdp's once allocated */ int (*ud_ubamem)(); /* see if dedicated memory is present */ }; -#endif + +/* + * uba_attach_args is used during autoconfiguration. It is sent + * from ubascan() to each (possible) device. + */ +struct uba_attach_args { + caddr_t ua_addr; + void (*ua_ivec)(); + int ua_iarg; + int ua_iaddr; + int ua_br; + int ua_cvec; +}; /* * Flags to UBA map/bdp allocation routines @@ -222,45 +236,15 @@ struct ubinfo { #define ubago(ui) ubaqueue(ui, 0) /* - * UBA related kernel variables - */ -int numuba; /* number of uba's */ -struct uba_hd uba_hd[]; - -/* * Ubminit and ubdinit initialize the mass storage controller and * device tables specifying possible devices. */ extern struct uba_ctlr ubminit[]; extern struct uba_device ubdinit[]; -/* - * UNIBUS device address space is mapped by UMEMmap - * into virtual address umem[][]. - * The IO page is mapped to the last 8K of each. - * This should be enlarged for the Q22 bus. - */ -extern struct pte *UMEMmap[]; /* uba device addr pte's */ -/* extern char umem[][512*NBPG]; /* uba device addr space */ -extern char *Numem; -#define Tumem(x) (Numem+(UBAPAGES+UBAIOPAGES)*NBPG*x) +extern struct cfdriver ubacd; -/* - * Since some VAXen vector their unibus interrupts - * just adjacent to the system control block, we must - * allocate space there when running on ``any'' cpu. This space is - * used for the vectors for all ubas. - */ -extern int (*UNIvec[][128])(); /* unibus vec for ubas */ -extern int (*eUNIvec)(); /* end of unibus vec */ +void ubainit __P((struct uba_softc *)); -#if defined(VAX780) || defined(VAX8600) -/* - * On DW780's, we must set the scb vectors for the nexus of the - * UNIbus adaptors to vector to locore unibus adaptor interrupt dispatchers - * which make 780's look like the other VAXen. - */ -extern Xua0int(), Xua1int(), Xua2int(), Xua3int(); -#endif VAX780 #endif /* _KERNEL */ #endif !LOCORE |