📄 ubavar.h
字号:
/* * @(#)ubavar.h 4.1 (ULTRIX) 7/2/90 *//************************************************************************ * * * Copyright (c) 1984, 85, 86, 87, 88 by * * Digital Equipment Corporation, Maynard, MA * * All rights reserved. * * * * This software is furnished under a license and may be used and * * copied only in accordance with the terms of such license and * * with the inclusion of the above copyright notice. This * * software or any other copies thereof may not be provided or * * otherwise made available to any other person. No title to and * * ownership of the software is hereby transferred. * * * * This software is derived from software received from the * * University of California, Berkeley, and from Bell * * Laboratories. Use, duplication, or disclosure is subject to * * restrictions under license agreements with University of * * California and with AT&T. * * * * The information in this software is subject to change without * * notice and should not be construed as a commitment by Digital * * Equipment Corporation. * * * * Digital assumes no responsibility for the use or reliability * * of its software on equipment which is not supplied by Digital. * * * ************************************************************************//* * Modification history: * * 23-Feb-90 Mark Parenti (map) * Added structure for bus head structures. * Added interrupt parameter field. * Added defines for bus number. * * 20-Dec-89 Paul Grist * Added VMEbus support (vba adapters). Had to add four new fields * to the uba_ctlr and uba_device structures for the support of VMEbus * devices: * 1. addr2: address of the second csr * 2. bus_priority: VME device priority level * 3. ivnum: 1st configured VMEbus device interrupt vector * 4. priority: the main bus request level of the VMEbus device * The first three are initalized by config, the last is left to be * initalized when the devices are auto-configured at boot time. * * 24-Jul-89 robin * made tty_ubinfo and uba_hd be of size 1. This will need to be changed * to extern of size 0 when the "OTHER" code is merged into the V4.0 pool. * * 20-Jul-89 Mark A. Parenti * Add define for UBAXMI for new SSP port. * * 26-Apr-89 Kong * Changed some variables to have "volatile" attributes when * compiled on a mips. * * 08-Jun-88 darrell for Ali * Added VAX60 (Firefox LEGSS) support. * * 19-May-88 Fred Canter * PTE maps for SCSI driver and extended I/O mode on CVAXstar/PVAX. * * 15-Feb-88 Fred Canter * Added defines for VAX420 (CVAXstar/PVAX) cache size and address. * * 12-11-87 Robin L. and Larry C. * Added portclass support to the system. * * 3-Aug-87 -- rafiey (Ali Rafieymehr) * Added sgsys and SGSYSmap for VAXstation 2000. * * 23-Apr-87 -- darrell * Added a vsdev (vaxstar device) structure and changed constant * definitions in order to make vs_bufctl() in uba.c accept * a pointer to the routine to be called. * * 20-Apr-87 -- afd * Moved Mayfair externals to ka650.h * * 06-Mar-87 -- afd * Added external definitions for map names (& correponding virtual * address names) for Mayfair/CVAX local register space, as per * definitions in spt.s. * * 13-Dec-86 -- fred (Fred Canter) * Added shmem and SHMEMmap for MicroVAX 2000 8 line SLU. * * 5-Aug-86 -- darrell (Darrell Dunnuck) * Added definitions for VAXstar disk and TZK50 drivers * sharing common disk buffer. * * 2-Jul-86 -- fred (Fred Canter) * Added mapping for TEAMmate 8 line SLU registers. * * 18-Jun-86 -- fred (Fred Canter) * Changes for VAXstar kernel support. * * 13-Jun-86 -- jaw fix to uba reset and drivers. * * 5-Jun-86 -- jaw changes to config. * * 18-mar-86 -- jaw br/cvec changed to NOT use registers. * * 05-Mar-86 -- jaw VAXBI device and controller config code added. * todr code put in cpusw. * * 08-Aug-85 -- darrell * Add constants for zero vector timer fix, and an integer * definition. * * 11-jul-85 -- jaw * fix bua/bda map registers. * * 19-Jun-85 -- jaw * VAX8200 name change. * * 06-Jun-85 -jaw * added support for BDA. * * 13-Mar-85 -jaw * Changes for support of the VAX8200 were merged in. * * 27-Feb-85 -tresvik * Changes for support of the VAX8600 were merged in. * *//* * This file contains definitions related to the kernel structures * for dealing with the unibus adapters. * * Each uba has a uba_hd structure. * Each unibus controller which is not a device has a uba_ctlr structure. * Each unibus device has a uba_device structure. */#ifndef LOCORE/* */struct bus_dispatch { int bus_num; int bus_vec;};/* * Per-uba structure. * * This structure holds the interrupt vector for the uba, * and its address in physical and virtual space. At boot time * we determine the devices attached to the uba's and their * interrupt vectors, filling in uh_vec. We free the map * register and bdp resources of the uba into the structures * defined here. * * During normal operation, resources are allocated and returned * to the structures here. We watch the number of passive releases * on each uba, and if the number is excessive may reset the uba. * * When uba resources are needed and not available, or if a device * which can tolerate no other uba activity (rk07) gets on the bus, * then device drivers may have to wait to get to the bus and are * queued here. It is also possible for processes to block in * the unibus driver in resource wait (mrwant, bdpwant); these * wait states are also recorded here. */struct uba_hd { int uba_type; /* see defines below. */ struct uba_regs *uh_uba; /* virt addr of uba */ struct uba_regs *uh_physuba; /* phys addr of uba */ int (**uh_vec)(); /* interrupt vector */ 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 */ short uh_bdpwant; /* someone awaits bdp's */ int uh_bdpfree; /* free bdp's */ int uh_hangcnt; /* number of ticks hung */ int uh_zvcnt; /* number of 0 vectors */ int uh_zvflg; /* flag for timing zero vectors */ int uh_errcnt; /* number of errors */ int uh_lastiv; /* last free interrupt vector */ short uh_users; /* transient bdp use count */ short uh_xclu; /* an rk07 is using this uba! */#define UAMSIZ 100 struct map *uh_map; /* buffered data path regs free */#define QAMSIZ 1000 struct map *uq_map; /* Q22 bus data path regs free */};#define UBA780 0x1#define UBA750 0x2#define UBA730 0x4#define UBAUVI 0x8#define UBAUVII 0x10#define UBABUA 0x20#define UBABDA 0x40#define UBABLA 0x80#define UBAXMI 0x100#ifndef LOCORE/* * Per-controller structure. * (E.g. one for each disk and tape controller, and other things * which use and release buffered data paths.) * * If a controller has devices attached, then there are * cross-referenced uba_drive structures. * This structure is the one which is queued in unibus resource wait, * and saves the information about unibus resources which are used. * The queue of devices waiting to transfer is also attached here. */struct uba_ctlr { struct uba_driver *um_driver; char *um_ctlrname; /* name of the controller */ short um_ctlr; /* controller index in driver */ caddr_t ui_parent; int um_adpt; /* which i/o bus it is on */ short um_nexus; /* which nexus on i/o bus */ short um_rctlr; /* remote controller number */ short um_ubanum; /* the uba it is on */#define um_vbanum um_ubanum short um_alive; /* controller exists */ int (**um_intr)(); /* interrupt handler(s) */ caddr_t um_addr; /* address of device in i/o space */ caddr_t um_addr2; /* address of second csr */ int um_bus_priority;/* i/o bus specific priority */ int um_ivnum; /* first interrupt vector number */ int um_priority; /* main bus request level of ctrl */ caddr_t um_physaddr; /* phys address of device in i/o space */ union { struct uba_hd *uba; struct vba_hd *vba; }bus_head;#define um_hd bus_head.uba#define um_vbahd bus_head.vba/* the driver saves the prototype command here for use in its go routine */ int um_cmd; /* communication to dgo() */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -