date and time created 80/06/28 10:43:17 by bill
authorBill Joy <bill@ucbvax.Berkeley.EDU>
Sun, 29 Jun 1980 01:43:17 +0000 (17:43 -0800)
committerBill Joy <bill@ucbvax.Berkeley.EDU>
Sun, 29 Jun 1980 01:43:17 +0000 (17:43 -0800)
SCCS-vsn: sys/vax/stand/uba.c 1.1

usr/src/sys/vax/stand/uba.c [new file with mode: 0644]

diff --git a/usr/src/sys/vax/stand/uba.c b/usr/src/sys/vax/stand/uba.c
new file mode 100644 (file)
index 0000000..6763134
--- /dev/null
@@ -0,0 +1,41 @@
+/*     uba.c   1.1     %G%     */
+
+#include "../h/param.h"
+#include "../h/inode.h"
+#include "../h/pte.h"
+#include "../h/uba.h"
+#include "../h/vm.h"
+#include "saio.h"
+
+ubasetup(io, bdp)
+register struct iob *io;
+{
+       register int i;
+       int npf;
+       unsigned v;
+       register struct pte *pte;
+       int o, vaddr, temp;
+
+       v = btop(io->i_ma);
+       o = (int)io->i_ma & PGOFSET;
+       npf = btoc(io->i_cc + o) +1;
+       pte = &(((struct uba_regs *)PHYSUBA0)->uba_map[0]);
+       temp = (bdp << 21) | MRV;
+       if (bdp && (o & 01))
+               temp |= BO;
+       v &= 0x1fffff;                  /* drop to physical addr */
+       while (--npf != 0)
+               *(int *)pte++ = v++ | temp;
+       *(int *)pte++ = 0;
+       return ((bdp << 28) | o);
+}
+
+ubafree(mr)
+       int mr;
+{
+       register int bdp, reg, npf, a;
+       bdp = (mr >> 28) & 0x0f;
+       if (bdp)
+               ((struct uba_regs *)PHYSUBA0)->uba_dpr[bdp] |= BNE;
+}