|
|
1.1 root 1: /* ttyoin.c - ttyoin */
2:
3: #include <conf.h>
4: #include <kernel.h>
5: #include <tty.h>
6: #include <io.h>
1.1.1.2 ! root 7:
! 8: /* set up macros for appropriate SLU as spec. by SLUCHIP:
! 9: if SLUCHIP==6850, #include slu6850.h, #define TTYOIN ttyoin6850, etc.
! 10: if SLUCHIP==7201, #include slu7201.h, #define TTYOIN ttyoin7201, etc.
! 11: if SLUCHIP undef.,#include slu.h, #define TTYOIN ttyoin (orig. case)
! 12: similarly sluaccess.h, other TTY fns */
! 13: #include <sluinclude.h>
1.1 root 14:
15: /*------------------------------------------------------------------------
1.1.1.2 ! root 16: * ttyoin -- output character to uart
1.1 root 17: *------------------------------------------------------------------------
18: */
1.1.1.2 ! root 19: TTYOIN(ttyp, cptr)
! 20: register struct tty *ttyp;
1.1 root 21: register struct csr *cptr;
1.1.1.2 ! root 22: {
! 23: int count;
1.1 root 24:
1.1.1.2 ! root 25: if (ttyp->ehead != ttyp->etail) {
! 26: sluputch(cptr, ttyp->ebuff[ttyp->etail++]);
! 27: if (ttyp->etail >= EBUFLEN)
! 28: ttyp->etail = 0;
1.1 root 29: return;
30: }
1.1.1.2 ! root 31: if (ttyp->oheld) { /* honor flow control */
! 32: slutdisable(cptr); /* disable transmitter ints if on */
1.1 root 33: return;
34: }
1.1.1.2 ! root 35: if ((count=scount(ttyp->osem)) < OBUFLEN) {
! 36: sluputch(cptr, ttyp->obuff[ttyp->otail++]);
! 37: if (ttyp->otail >= OBUFLEN)
! 38: ttyp->otail = 0;
! 39: if (count > OBMINSP)
! 40: signal(ttyp->osem);
! 41: else if ( ++(ttyp->odsend) == OBMINSP) {
! 42: ttyp->odsend = 0;
! 43: signaln(ttyp->osem, OBMINSP);
1.1 root 44: }
45: } else
1.1.1.2 ! root 46: slutdisable(cptr);
1.1 root 47: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.