Annotation of xinu/sys/vcuinit.c, revision 1.1

1.1     ! root        1: /* vcuinit.c - vcuinit */
        !             2: 
        !             3: #include <conf.h>
        !             4: #include <kernel.h>
        !             5: #include <proc.h>
        !             6: #include <tty.h>
        !             7: #include <io.h>
        !             8: #include <vcu.h>
        !             9: #include <procreg.h>
        !            10: 
        !            11: /*------------------------------------------------------------------------
        !            12:  *  vcuinit - initialize buffers and modes for a vax console device
        !            13:  *------------------------------------------------------------------------
        !            14:  */
        !            15: vcuinit(devptr)
        !            16:        struct  devsw   *devptr;
        !            17: {
        !            18:        register struct tty *iptr;
        !            19:        int      junk, isconsole;
        !            20: 
        !            21:        /* set up interrupt vector and interrupt dispatch table */
        !            22: 
        !            23:        iptr = &tty[devptr->dvminor];
        !            24:        iosetvec(devptr->dvnum, iptr, iptr);
        !            25: 
        !            26:        devptr->dvioblk = (char *)iptr;         /* fill tty control blk */
        !            27:        isconsole = (devptr->dvnum == CONSOLE); /* make console cooked  */
        !            28:        iptr->ioaddr=(struct csr *)devptr->dvcsr;/* not necessary       */
        !            29:        iptr->ihead = iptr->itail = 0;          /* empty input queue    */
        !            30:        iptr->isem = screate(0);                /* chars. read so far=0 */
        !            31:        iptr->osem = screate(OBUFLEN);          /* buffer available=all */
        !            32:        iptr->odsend = 0;                       /* sends delayed so far */
        !            33:        iptr->ohead = iptr->otail = 0;          /* output queue empty   */
        !            34:        iptr->ehead = iptr->etail = 0;          /* echo queue empty     */
        !            35:        iptr->imode = (isconsole ? IMCOOKED : IMRAW);
        !            36:        iptr->iecho = iptr->evis = isconsole;   /* echo console input   */
        !            37:        iptr->ierase = iptr->ieback = isconsole;/* console honors erase */
        !            38:        iptr->ierasec = BACKSP;                 /*  using ^h            */
        !            39:        iptr->ecrlf = iptr->icrlf = isconsole;  /* map RETURN on input  */
        !            40:        iptr->ocrlf = iptr->oflow = isconsole;  /* map RETURN on output */
        !            41:        iptr->ieof  = iptr->ikill = isconsole;  /* set line kill=KILLCH */
        !            42:        iptr->iintr = FALSE;
        !            43:        iptr->iintrc = INTRCH;
        !            44:        iptr->iintpid = BADPID;
        !            45:        iptr->ikillc = KILLCH;
        !            46:        iptr->ieofc = EOFC;
        !            47:        iptr->oheld = FALSE;
        !            48:        iptr->ostart = STRTCH;
        !            49:        iptr->ostop = STOPCH;
        !            50:        iptr->icursor = 0;
        !            51:        iptr->ifullc = TFULLC;
        !            52:        junk = mfpr(RXDB);                      /* clear receiver */
        !            53:        mtpr(VCURXCSENBL, RXCS);                /* enable in intrpts*/
        !            54:        mtpr(VCUTXCSDSBL, TXCS);                /* disable out "  */
        !            55: }

unix.superglobalmegacorp.com

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