Annotation of researchv9/sys.vax/dev/dr.c, revision 1.1

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: #include "../h/param.h"
        !            10: #include "../h/dir.h"
        !            11: #include "../h/user.h"
        !            12: #include "../h/conf.h"
        !            13: #include "../h/inode.h"
        !            14: #include "../h/file.h"
        !            15: #include "../h/systm.h"
        !            16: #include "../h/pte.h"
        !            17: #include "../h/buf.h"
        !            18: #include "../h/ubareg.h"
        !            19: #include "../h/ubavar.h"
        !            20: 
        !            21: /* number of output bits available in a DR -- must be a power of 2 */
        !            22: #define DRWIDTH 16
        !            23: 
        !            24: /* DRWIDTH is 2**DRSHIFT */
        !            25: #define DRSHIFT 4
        !            26: 
        !            27: struct drreg {
        !            28:        u_short drcsr, drout, drin;
        !            29: };
        !            30: 
        !            31: int    drattach(), drprobe();
        !            32: struct uba_device *drinfo[NDR];
        !            33: u_short        drstd[] = { 0 };
        !            34: struct uba_driver drdriver =
        !            35:        { drprobe, 0, drattach, 0, drstd, "dr", drinfo };
        !            36: 
        !            37: drprobe(reg)
        !            38: caddr_t reg;
        !            39: {
        !            40:        register int br, cvec;
        !            41:        register struct drreg *draddr = (struct drreg *) reg;
        !            42: 
        !            43:        draddr->drcsr = 0;
        !            44:        br = 0x15;
        !            45:        cvec = 0700;            /* hope this will not be used */
        !            46:        return 1;
        !            47: }
        !            48: 
        !            49: drattach()
        !            50: {
        !            51: }
        !            52: 
        !            53: /* set bit n of the dr-11 complex to v */
        !            54: drsetbit (n, v)
        !            55:        register int n;
        !            56:        register int v;
        !            57: {
        !            58:        if (drinfo[n>>DRSHIFT]->ui_alive == 0)
        !            59:                return;
        !            60:        if (n >= 0 && n < (NDR << DRSHIFT)) {
        !            61:                register u_short bit;
        !            62:                register struct drreg *drptr;
        !            63:                drptr = (struct drreg *) drinfo[n>>DRSHIFT] -> ui_addr;
        !            64:                bit = 1 << (n & (DRWIDTH - 1));
        !            65:                if (v)
        !            66:                        drptr->drout |= bit;
        !            67:                else
        !            68:                        drptr->drout &= ~bit;
        !            69:        }
        !            70: }
        !            71: 
        !            72: drrint()
        !            73: {
        !            74: }
        !            75: 
        !            76: drxint()
        !            77: {
        !            78: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.