1: #
   2: /*
   3:  */
   4: 
   5: /*
   6:  * VT01 driver via DR11C to 11/20
   7:  */
   8: 
   9: #include "../param.h"
  10: #include "../user.h"
  11: 
  12: int vtflag;
  13: 
  14: struct vtreg {
  15:     int csr;
  16:     int buf;
  17: };
  18: 
  19: #define VTADDR  0167770
  20: #define RQINT   01
  21: #define BIENABL 040
  22: #define SEOF    0100000
  23: #define VTPRI   8
  24: 
  25: vtopen(dev, flag)
  26: {
  27:     if (!flag)
  28:         u.u_error = ENXIO;
  29:     else
  30:         VTADDR->csr = BIENABL;
  31: }
  32: 
  33: vtclose()
  34: {
  35:     VTADDR->buf = SEOF;
  36:     VTADDR->csr =| RQINT;
  37: }
  38: 
  39: vtwrite()
  40: {
  41:     register int c;
  42:     int register count;
  43: 
  44:     while ((c=cpass()) >= 0) {
  45:         retry:
  46:         for (count=0; count<10; count++)
  47:             if ((VTADDR->csr&RQINT)==0) {
  48:                 VTADDR->buf = c&0377;
  49:                 VTADDR->csr =| RQINT;
  50:                 goto contin;
  51:             }
  52:         spl5();
  53:         if (VTADDR->csr&RQINT) {
  54:             vtflag++;
  55:             sleep(VTADDR, VTPRI);
  56:         }
  57:         spl0();
  58:         goto retry;
  59:     contin:;
  60:     }
  61: }
  62: 
  63: vtintr()
  64: {
  65:     VTADDR->csr =& ~RQINT;
  66:     if (vtflag) {
  67:         vtflag = 0;
  68:         wakeup(VTADDR);
  69:     }
  70: }

Defined functions

vtclose defined in line 33; never used
vtintr defined in line 63; never used
vtopen defined in line 25; never used
vtwrite defined in line 39; never used

Defined variables

vtflag defined in line 12; used 3 times

Defined struct's

vtreg defined in line 14; never used

Defined macros

BIENABL defined in line 21; used 1 times
  • in line 30
RQINT defined in line 20; used 5 times
SEOF defined in line 22; used 1 times
  • in line 35
VTADDR defined in line 19; used 10 times
VTPRI defined in line 23; used 1 times
  • in line 55
Last modified: 1975-07-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 672
Valid CSS Valid XHTML 1.0 Strict