7900: /* 7901: * A clist structure is the head 7902: * of a linked list queue of characters. 7903: * The characters are stored in 4-word 7904: * blocks containing a link and 6 characters. 7905: * The routines getc and putc (m45.s or m40.s) 7906: * manipulate these structures. 7907: */ 7908: struct clist 7909: { 7910: int c_cc; /* character count */ 7911: int c_cf; /* pointer to first block */ 7912: int c_cl; /* pointer to last block */ 7913: }; 7914: /* --------------------------- */ 7915: 7916: /* 7917: * A tty structure is needed for 7918: * each UNIX character device that 7919: * is used for normal terminal IO. 7920: * The routines in tty.c handle the 7921: * common code associated with 7922: * these structures. 7923: * The definition and device dependent 7924: * code is in each driver. (kl.c dc.c dh.c) 7925: */ 7926: struct tty 7927: { 7928: struct clist t_rawq; /* input chars right off device */ 7929: struct clist t_canq; /* input chars after erase and kill */ 7930: struct clist t_outq; /* output list to device */ 7931: int t_flags; /* mode, settable by stty call */ 7932: int *t_addr; /* device address (register or startup fcn) */ 7933: 7934: char t_delct; /* number of delimiters in raw q */ 7935: char t_col; /* printing column of device */ 7936: char t_erase; /* erase character */ 7937: char t_kill; /* kill character */ 7938: char t_state; /* internal state, not visible externally */ 7939: 7940: char t_char; /* character temporary */ 7941: int t_speeds; /* output+input line speed */ 7942: int t_dev; /* device name */ 7943: }; 7944: /* --------------------------- */ 7945: 7946: 7947: char partab[]; /* ASCII table: parity, character class */ 7948: 7949: 7950: 7951: #define TTIPRI 10 7952: #define TTOPRI 20 7953: 7954: #define CERASE '#' /* default special characters */ 7955: #define CEOT 004 7956: #define CKILL '@' 7957: #define CQUIT 034 /* FS, cntl shift L */ 7958: #define CINTR 0177 /* DEL */ 7959: 7960: /* limits */ 7961: #define TTHIWAT 50 7962: #define TTLOWAT 30 7963: #define TTYHOG 256 7964: 7965: /* modes */ 7966: #define HUPCL 01 7967: #define XTABS 02 7968: #define LCASE 04 7969: #define ECHO 010 7970: #define CRMOD 020 7971: #define RAW 040 7972: #define ODDP 0100 7973: #define EVENP 0200 7974: #define NLDELAY 001400 7975: #define TBDELAY 006000 7976: #define CRDELAY 030000 7977: #define VTDELAY 040000 7978: 7979: /* Hardware bits */ 7980: #define DONE 0200 7981: #define IENABLE 0100 7982: 7983: /* Internal state bits */ 7984: #define TIMEOUT 01 /* Delay timeout in progress */ 7985: #define WOPEN 02 /* Waiting for open to complete */ 7986: 7987: #define ISOPEN 04 /* Device is open */ 7988: #define SSTART 010 /* Has special start routine at addr */ 7989: 7990: #define CARR_ON 020 /* Software copy of carrier-present */ 7991: 7992: #define BUSY 040 /* Output in progress */ 7993: #define ASLEEP 0100 /* Wakeup when output done */