add the -s option to summarize multiple runs
[unix-history] / usr / src / sys / vax / stand / uba.c
CommitLineData
d54f1867 1/* uba.c 4.4 81/04/03 */
1e215e14
BJ
2
3#include "../h/param.h"
4#include "../h/inode.h"
99fe9747 5#include "../h/cpu.h"
1e215e14 6#include "../h/pte.h"
99fe9747 7#include "../h/ubareg.h"
1e215e14
BJ
8#include "../h/vm.h"
9#include "saio.h"
99fe9747 10#include "savax.h"
1e215e14 11
19542281
BJ
12/*
13 * Note... this routine does not
14 * really allocate; unless bdp == 2
15 * you always get the same space.
16 * When bdp == 2 you get some other space.
17 */
1e215e14 18ubasetup(io, bdp)
99fe9747
BJ
19 register struct iob *io;
20 int bdp;
1e215e14 21{
1e215e14
BJ
22 int npf;
23 unsigned v;
24 register struct pte *pte;
19542281 25 int o, temp, reg;
1e215e14 26
19542281
BJ
27 if (bdp == 2) {
28 reg = 128+64; /* for stupid ts-11 */
29 bdp = 0;
30 } else
31 reg = 0;
1e215e14
BJ
32 v = btop(io->i_ma);
33 o = (int)io->i_ma & PGOFSET;
34 npf = btoc(io->i_cc + o) +1;
19542281 35 pte = &ubauba(io->i_unit)->uba_map[reg];
99fe9747 36 temp = (bdp << 21) | UBAMR_MRV;
1e215e14 37 if (bdp && (o & 01))
99fe9747 38 temp |= UBAMR_BO;
1e215e14
BJ
39 v &= 0x1fffff; /* drop to physical addr */
40 while (--npf != 0)
41 *(int *)pte++ = v++ | temp;
42 *(int *)pte++ = 0;
19542281 43 return ((bdp << 28) | (reg << 9) | o);
1e215e14
BJ
44}
45
99fe9747
BJ
46ubafree(io, mr)
47 struct iob *io;
1e215e14
BJ
48 int mr;
49{
99fe9747 50 register int bdp;
1e215e14
BJ
51
52 bdp = (mr >> 28) & 0x0f;
99fe9747
BJ
53 if (bdp == 0)
54 return;
55 switch (cpu) {
56
57 case VAX_780:
58 ubauba(io->i_unit)->uba_dpr[bdp] |= UBADPR_BNE;
59 break;
60
61 case VAX_750:
62 ubauba(io->i_unit)->uba_dpr[bdp] |=
63 UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE;
64 break;
d54f1867 65 case VAX_7ZZ:
19542281 66 break;
99fe9747 67 }
1e215e14 68}