support for display drivers as console
[unix-history] / usr / src / sys / vax / stand / uba.c
index 47e4c66..03f14d8 100644 (file)
@@ -1,11 +1,21 @@
-/*     uba.c   4.4     81/04/03        */
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)uba.c       7.3 (Berkeley) %G%
+ */
+
+#include "../machine/pte.h"
+
+#include "param.h"
+#include "inode.h"
+#include "vm.h"
+#include "fs.h"
+
+#include "../vax/cpu.h"
+#include "../vaxuba/ubareg.h"
 
 
-#include "../h/param.h"
-#include "../h/inode.h"
-#include "../h/cpu.h"
-#include "../h/pte.h"
-#include "../h/ubareg.h"
-#include "../h/vm.h"
 #include "saio.h"
 #include "savax.h"
 
 #include "saio.h"
 #include "savax.h"
 
@@ -20,19 +30,21 @@ ubasetup(io, bdp)
        int bdp;
 {
        int npf;
        int bdp;
 {
        int npf;
-       unsigned v;
+       unsigned int v;
        register struct pte *pte;
        int o, temp, reg;
        register struct pte *pte;
        int o, temp, reg;
+       static int lastreg = 128+64;
 
 
+       v = btop(io->i_ma);
+       o = (int)io->i_ma & PGOFSET;
+       npf = btoc(io->i_cc + o) +1;
        if (bdp == 2) {
        if (bdp == 2) {
-               reg = 128+64;           /* for stupid ts-11 */
+               reg = lastreg;
+               lastreg += npf;
                bdp = 0;
        } else
                reg = 0;
                bdp = 0;
        } else
                reg = 0;
-       v = btop(io->i_ma);
-       o = (int)io->i_ma & PGOFSET;
-       npf = btoc(io->i_cc + o) +1;
-       pte = &ubauba(io->i_unit)->uba_map[reg];
+       pte = &ubauba(io->i_adapt)->uba_map[reg];
        temp = (bdp << 21) | UBAMR_MRV;
        if (bdp && (o & 01))
                temp |= UBAMR_BO;
        temp = (bdp << 21) | UBAMR_MRV;
        if (bdp && (o & 01))
                temp |= UBAMR_BO;
@@ -54,15 +66,23 @@ ubafree(io, mr)
                return;
        switch (cpu) {
 
                return;
        switch (cpu) {
 
+#if VAX8200
+       case VAX_8200:
+               UBA_PURGEBUA(ubauba(io->i_adapt), bdp);
+               break;
+#endif
+
+       case VAX_8600:
        case VAX_780:
        case VAX_780:
-               ubauba(io->i_unit)->uba_dpr[bdp] |= UBADPR_BNE;
+               ubauba(io->i_adapt)->uba_dpr[bdp] |= UBADPR_BNE;
                break;
 
        case VAX_750:
                break;
 
        case VAX_750:
-               ubauba(io->i_unit)->uba_dpr[bdp] |=
+               ubauba(io->i_adapt)->uba_dpr[bdp] |=
                     UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE;
                break;
                     UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE;
                break;
-       case VAX_7ZZ:
+
+       default:
                break;
        }
 }
                break;
        }
 }