|
|
1.1 ! root 1: /* ! 2: * stuff for dealing with io nexus on comets ! 3: */ ! 4: ! 5: #include "sys/param.h" ! 6: #include "sys/nexus.h" ! 7: #include "sys/nxaddr.h" ! 8: #include "sys/pte.h" ! 9: ! 10: static int nexcnt; ! 11: char *iospace; /* an array of struct nexus */ ! 12: ! 13: static int nexwind(), nexreg(); ! 14: ! 15: /* ! 16: * how much address space ! 17: * is needed for nexus space? ! 18: * needed when allocating system page table ! 19: */ ! 20: ! 21: mchiopsize() ! 22: { ! 23: register int i; ! 24: ! 25: for (i = 0; nextab[i].bus >= 0; i++) ! 26: ; ! 27: nexcnt = i; ! 28: return (i * sizeof(struct nexus)); ! 29: } ! 30: ! 31: /* ! 32: * map appropriate parts of nexus space into kernel space ! 33: * called early on, before memory mapping is set up ! 34: * argument is the first relevant spt entry ! 35: */ ! 36: ! 37: mchiopinit(pt) ! 38: struct pte *pt; ! 39: { ! 40: register long *p; ! 41: register int i, n; ! 42: register int b; ! 43: ! 44: p = (long *)pt; ! 45: for (i = 0; i < nexcnt; i++) { ! 46: b = nexreg(&nextab[i]); ! 47: for (n = 0; n < btoc(NXSIZE); n++) ! 48: if (b) ! 49: *p++ = PG_V|PG_KW|(b+n); ! 50: else ! 51: *p++ = 0; ! 52: b = nexwind(&nextab[i]); ! 53: for (n = 0; n < btoc(NXWSIZE); n++) ! 54: if (b) ! 55: *p++ = PG_V|PG_KW|(b+n); ! 56: else ! 57: *p++ = 0; ! 58: } ! 59: } ! 60: ! 61: static ! 62: nexreg(n) ! 63: register struct nextab *n; ! 64: { ! 65: if (n->bus) ! 66: return (0); /* only one set of registers in comet */ ! 67: if (n->adp >= 16) ! 68: return (0); ! 69: return (btoc(n->adp * NXSIZE + 0xf20000)); ! 70: } ! 71: ! 72: static ! 73: nexwind(n) ! 74: register struct nextab *n; ! 75: { ! 76: if (n->bus) ! 77: return (0); /* only one set of registers in comet */ ! 78: switch (n->adp) { ! 79: case 8: /* first DW750 */ ! 80: return (btoc(0xfc0000)); ! 81: ! 82: case 9: /* second DW750 */ ! 83: return (btoc(0xf80000)); ! 84: ! 85: default: ! 86: return (0); ! 87: } ! 88: } ! 89: ! 90: caddr_t ! 91: nxaddr(np) ! 92: register struct nxaddr *np; ! 93: { ! 94: if (np->adno != 0) ! 95: return (0); ! 96: if (np->nexus < 0 || np->nexus >= nexcnt) ! 97: return (0); ! 98: return((caddr_t)(iospace + np->nexus*sizeof(struct nexus))); ! 99: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.