1*3263Swnj /* uba.c 4.2 03/15/81 */ 2328Sbill 3328Sbill #include "../h/param.h" 4328Sbill #include "../h/inode.h" 5*3263Swnj #include "../h/cpu.h" 6328Sbill #include "../h/pte.h" 7*3263Swnj #include "../h/ubareg.h" 8328Sbill #include "../h/vm.h" 9328Sbill #include "saio.h" 10*3263Swnj #include "savax.h" 11328Sbill 12328Sbill ubasetup(io, bdp) 13*3263Swnj register struct iob *io; 14*3263Swnj int bdp; 15328Sbill { 16328Sbill int npf; 17328Sbill unsigned v; 18328Sbill register struct pte *pte; 19*3263Swnj int o, temp; 20328Sbill 21328Sbill v = btop(io->i_ma); 22328Sbill o = (int)io->i_ma & PGOFSET; 23328Sbill npf = btoc(io->i_cc + o) +1; 24*3263Swnj pte = ubauba(io->i_unit)->uba_map; 25*3263Swnj temp = (bdp << 21) | UBAMR_MRV; 26328Sbill if (bdp && (o & 01)) 27*3263Swnj temp |= UBAMR_BO; 28328Sbill v &= 0x1fffff; /* drop to physical addr */ 29328Sbill while (--npf != 0) 30328Sbill *(int *)pte++ = v++ | temp; 31328Sbill *(int *)pte++ = 0; 32*3263Swnj return ((bdp << UBAMR_DPSHIFT) | o); 33328Sbill } 34328Sbill 35*3263Swnj ubafree(io, mr) 36*3263Swnj struct iob *io; 37328Sbill int mr; 38328Sbill { 39*3263Swnj register int bdp; 40328Sbill 41328Sbill bdp = (mr >> 28) & 0x0f; 42*3263Swnj if (bdp == 0) 43*3263Swnj return; 44*3263Swnj switch (cpu) { 45*3263Swnj 46*3263Swnj case VAX_780: 47*3263Swnj ubauba(io->i_unit)->uba_dpr[bdp] |= UBADPR_BNE; 48*3263Swnj break; 49*3263Swnj 50*3263Swnj case VAX_750: 51*3263Swnj ubauba(io->i_unit)->uba_dpr[bdp] |= 52*3263Swnj UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE; 53*3263Swnj break; 54*3263Swnj } 55328Sbill } 56