|
|
1.1 root 1: /* vcucntl.c - vcucntl */
2:
3: #include <conf.h>
4: #include <kernel.h>
5: #include <tty.h>
6: #include <io.h>
7: #include <vcu.h>
8:
9: /*------------------------------------------------------------------------
10: * vcucntl - control the vax console unit device by setting modes
11: *------------------------------------------------------------------------
12: */
13: vcucntl(devptr, func, addr)
14: struct devsw *devptr;
15: int func;
16: char *addr;
17: {
18: register struct tty *ttyp;
19: char ch;
20: PStype ps;
21:
22: ttyp = &tty[devptr->dvminor];
23: switch ( func ) {
24:
25: case TCNEXTC:
26: disable(ps);
27: wait(ttyp->isem);
28: ch = ttyp->ibuff[ttyp->itail];
29: restore(ps);
30: signal(ttyp->isem);
31: return(ch);
32: case TCMODER:
33: ttyp->imode = IMRAW;
34: break;
35: case TCMODEC:
36: ttyp->imode = IMCOOKED;
37: break;
38: case TCMODEK:
39: ttyp->imode = IMCBREAK;
40: break;
41: case TCECHO:
42: ttyp->iecho = TRUE;
43: break;
44: case TCNOECHO:
45: ttyp->iecho = FALSE;
46: break;
47: case TCICHARS:
48: return(scount(ttyp->isem));
49: case TCINT:
50: ttyp->iintr = TRUE;
51: ttyp->iintpid = getpid();
52: break;
53: case TCNOINT:
54: ttyp->iintr = FALSE;
55: break;
56: default:
57: return(SYSERR);
58: }
59: return(OK);
60: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.