+#ifndef LOCORE
+/*
+ * 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 {
+ 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_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 25
+ struct map *uh_map; /* buffered data path regs free */
+};
+
+#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;
+ 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) */
+ caddr_t um_addr; /* address of device in i/o space */
+ struct uba_hd *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 */
+ struct buf um_tab; /* queue of devices for this controller */
+};