--- xinu/sys/ttyoin.c 2018/04/24 17:39:04 1.1.1.1 +++ xinu/sys/ttyoin.c 2018/04/24 17:39:53 1.1.1.2 @@ -4,39 +4,44 @@ #include #include #include -#include + +/* set up macros for appropriate SLU as spec. by SLUCHIP: + if SLUCHIP==6850, #include slu6850.h, #define TTYOIN ttyoin6850, etc. + if SLUCHIP==7201, #include slu7201.h, #define TTYOIN ttyoin7201, etc. + if SLUCHIP undef.,#include slu.h, #define TTYOIN ttyoin (orig. case) + similarly sluaccess.h, other TTY fns */ +#include /*------------------------------------------------------------------------ - * ttyoin -- lower-half tty device driver for output interrupts + * ttyoin -- output character to uart *------------------------------------------------------------------------ */ -INTPROC ttyoin(iptr) - register struct tty *iptr; -{ +TTYOIN(ttyp, cptr) + register struct tty *ttyp; register struct csr *cptr; - int ct; +{ + int count; - cptr = iptr->ioaddr; - if (iptr->ehead != iptr->etail) { - cptr->ctbuf = iptr->ebuff[iptr->etail++]; - if (iptr->etail >= EBUFLEN) - iptr->etail = 0; + if (ttyp->ehead != ttyp->etail) { + sluputch(cptr, ttyp->ebuff[ttyp->etail++]); + if (ttyp->etail >= EBUFLEN) + ttyp->etail = 0; return; } - if (iptr->oheld) { /* honor flow control */ - cptr->ctstat = SLUDISABLE; + if (ttyp->oheld) { /* honor flow control */ + slutdisable(cptr); /* disable transmitter ints if on */ return; } - if ((ct=scount(iptr->osem)) < OBUFLEN) { - cptr->ctbuf = iptr->obuff[iptr->otail++]; - if (iptr->otail >= OBUFLEN) - iptr->otail = 0; - if (ct > OBMINSP) - signal(iptr->osem); - else if ( ++(iptr->odsend) == OBMINSP) { - iptr->odsend = 0; - signaln(iptr->osem, OBMINSP); + if ((count=scount(ttyp->osem)) < OBUFLEN) { + sluputch(cptr, ttyp->obuff[ttyp->otail++]); + if (ttyp->otail >= OBUFLEN) + ttyp->otail = 0; + if (count > OBMINSP) + signal(ttyp->osem); + else if ( ++(ttyp->odsend) == OBMINSP) { + ttyp->odsend = 0; + signaln(ttyp->osem, OBMINSP); } } else - cptr->ctstat = SLUDISABLE; + slutdisable(cptr); }