|
|
1.1 ! root 1: /* mba.c 4.3 81/03/15 */ ! 2: ! 3: #include "../h/param.h" ! 4: #include "../h/inode.h" ! 5: #include "../h/pte.h" ! 6: #include "../h/mbareg.h" ! 7: #include "../h/mtpr.h" ! 8: #include "../h/vm.h" ! 9: #include "saio.h" ! 10: #include "savax.h" ! 11: ! 12: mbastart(io, func) ! 13: register struct iob *io; ! 14: int func; ! 15: { ! 16: struct mba_regs *mba = mbamba(io->i_unit); ! 17: struct mba_drv *drv = mbadrv(io->i_unit); ! 18: register struct pte *pte = mba->mba_map; ! 19: int npf; ! 20: unsigned v; ! 21: int o; ! 22: int vaddr; ! 23: ! 24: v = btop(io->i_ma); ! 25: o = (int)io->i_ma & PGOFSET; ! 26: npf = btoc(io->i_cc + o); ! 27: vaddr = o; ! 28: while (--npf >= 0) ! 29: *(int *)pte++ = v++ | PG_V; ! 30: mba->mba_sr = -1; ! 31: mba->mba_bcr = -io->i_cc; ! 32: mba->mba_var = vaddr; ! 33: if (func == WRITE) ! 34: drv->mbd_cs1 = MB_WCOM | MB_GO; ! 35: else ! 36: drv->mbd_cs1 = MB_RCOM | MB_GO; ! 37: } ! 38: ! 39: mbainit(mbanum) ! 40: int mbanum; ! 41: { ! 42: register struct mba_regs *mba = mbaddr[mbanum]; ! 43: ! 44: /* SHOULD BADADDR IT */ ! 45: if (mbaact & (1<<mbanum)) ! 46: return; ! 47: mba->mba_cr = MBCR_INIT; ! 48: mbaact |= 1<<mbanum; ! 49: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.