Annotation of xinu/sys/ttyoin.c, revision 1.1.1.1

1.1       root        1: /* ttyoin.c - ttyoin */
                      2: 
                      3: #include <conf.h>
                      4: #include <kernel.h>
                      5: #include <tty.h>
                      6: #include <io.h>
                      7: #include <slu.h>
                      8: 
                      9: /*------------------------------------------------------------------------
                     10:  *  ttyoin  --  lower-half tty device driver for output interrupts
                     11:  *------------------------------------------------------------------------
                     12:  */
                     13: INTPROC        ttyoin(iptr)
                     14:        register struct tty     *iptr;
                     15: {
                     16:        register struct csr     *cptr;
                     17:        int     ct;
                     18: 
                     19:        cptr = iptr->ioaddr;
                     20:        if (iptr->ehead != iptr->etail) {
                     21:                cptr->ctbuf = iptr->ebuff[iptr->etail++];
                     22:                if (iptr->etail >= EBUFLEN)
                     23:                        iptr->etail = 0;
                     24:                return;
                     25:        }
                     26:        if (iptr->oheld) {                      /* honor flow control   */
                     27:                cptr->ctstat = SLUDISABLE;
                     28:                return;
                     29:        }
                     30:        if ((ct=scount(iptr->osem)) < OBUFLEN) {
                     31:                cptr->ctbuf = iptr->obuff[iptr->otail++];
                     32:                if (iptr->otail >= OBUFLEN)
                     33:                        iptr->otail = 0;
                     34:                if (ct > OBMINSP)
                     35:                        signal(iptr->osem);
                     36:                else if ( ++(iptr->odsend) == OBMINSP) {
                     37:                        iptr->odsend = 0;
                     38:                        signaln(iptr->osem, OBMINSP);
                     39:                }
                     40:        } else
                     41:                cptr->ctstat = SLUDISABLE;
                     42: }

unix.superglobalmegacorp.com

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