|
|
1.1 ! root 1: /* ! 2: * DR-11C interface ! 3: * The routines in this driver are not called through the normal ! 4: * device interface. Instead, they are available for other device ! 5: * drivers to use to send arbitrary information out on a DR-11C. ! 6: */ ! 7: ! 8: #include "dr.h" ! 9: #if NDR > 0 ! 10: #include "../h/param.h" ! 11: #include "../h/dir.h" ! 12: #include "../h/user.h" ! 13: #include "../h/conf.h" ! 14: #include "../h/inode.h" ! 15: #include "../h/file.h" ! 16: #include "../h/systm.h" ! 17: #include "../h/pte.h" ! 18: #include "../h/buf.h" ! 19: #include "../h/ubareg.h" ! 20: #include "../h/ubavar.h" ! 21: ! 22: /* number of output bits available in a DR -- must be a power of 2 */ ! 23: #define DRWIDTH 16 ! 24: ! 25: /* DRWIDTH is 2**DRSHIFT */ ! 26: #define DRSHIFT 4 ! 27: ! 28: struct drreg { ! 29: u_short drcsr, drout, drin; ! 30: }; ! 31: ! 32: int drattach(), drprobe(); ! 33: struct uba_device *drinfo[NDR]; ! 34: u_short drstd[] = { 0 }; ! 35: struct uba_driver drdriver = ! 36: { drprobe, 0, drattach, 0, drstd, "dr", drinfo }; ! 37: ! 38: drprobe(reg) ! 39: caddr_t reg; ! 40: { ! 41: register int br, cvec; ! 42: register struct drreg *draddr = (struct drreg *) reg; ! 43: ! 44: draddr->drcsr = 0; ! 45: br = 0x15; ! 46: cvec = 0700; /* hope this will not be used */ ! 47: return 1; ! 48: } ! 49: ! 50: drattach() ! 51: { ! 52: } ! 53: ! 54: /* set bit n of the dr-11 complex to v */ ! 55: drsetbit (n, v) ! 56: register int n; ! 57: register int v; ! 58: { ! 59: if (drinfo[n>>DRSHIFT]->ui_alive == 0) ! 60: return; ! 61: if (n >= 0 && n < (NDR << DRSHIFT)) { ! 62: register u_short bit; ! 63: register struct drreg *drptr; ! 64: drptr = (struct drreg *) drinfo[n>>DRSHIFT] -> ui_addr; ! 65: bit = 1 << (n & (DRWIDTH - 1)); ! 66: if (v) ! 67: drptr->drout |= bit; ! 68: else ! 69: drptr->drout &= ~bit; ! 70: } ! 71: } ! 72: ! 73: drrint() ! 74: { ! 75: } ! 76: ! 77: drxint() ! 78: { ! 79: } ! 80: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.