sync to 99.9% of the WEGA kernel

This commit is contained in:
Oliver Lehmann 2008-05-07 04:51:51 +00:00
parent 338d90258f
commit 4c0135e7e2
1 changed files with 96 additions and 100 deletions

View File

@ -11,6 +11,12 @@
*************************************************************************** ***************************************************************************
**************************************************************************/ **************************************************************************/
/*
* Line discipline 0
*/
char tt0wstr[] = "@[$]tt0.c Rev : 4.1 09/29/83 01:02:58";
#include <sys/param.h> #include <sys/param.h>
#include <sys/state.h> #include <sys/state.h>
#include <sys/conf.h> #include <sys/conf.h>
@ -27,14 +33,6 @@
#include <sys/s.out.h> #include <sys/s.out.h>
#include <sys/user.h> #include <sys/user.h>
/*
* Line discipline 0
*/
char tt0wstr[] = "@[$]tt0.c Rev : 4.1 09/29/83 01:02:58";
extern putcb();
extern char partab[]; extern char partab[];
/* /*
@ -62,7 +60,6 @@ int ncode;
register flg; register flg;
register unsigned char *cp; register unsigned char *cp;
char *csp; char *csp;
extern tttimeo();
flg = tp->t_iflag; flg = tp->t_iflag;
switch (ncode) { switch (ncode) {
@ -144,11 +141,10 @@ int ncode;
flg = tp->t_lflag; flg = tp->t_lflag;
if (!(tp->t_state&IEXTPROC) && tp->t_lflag) if (!(tp->t_state&IEXTPROC) && tp->t_lflag) {
while (ncode--) { while (ncode--) {
c = *cp++; c = *cp++;
flg = tp->t_lflag; flg = tp->t_lflag;
if (flg&ISIG) { if (flg&ISIG) {
if (c == tp->t_cc[VINTR]) { if (c == tp->t_cc[VINTR]) {
signal(tp->t_pgrp, SIGINT); signal(tp->t_pgrp, SIGINT);
@ -221,6 +217,7 @@ int ncode;
(*tp->t_proc)(tp, T_OUTPUT); (*tp->t_proc)(tp, T_OUTPUT);
} }
} }
}
if (!(flg&ICANON)) { if (!(flg&ICANON)) {
tp->t_state &= ~RTO; tp->t_state &= ~RTO;
if (tp->t_rawq.c_cc >= tp->t_cc[VMIN]) if (tp->t_rawq.c_cc >= tp->t_cc[VMIN])
@ -258,13 +255,12 @@ union {
} ucp; } ucp;
int ncode; int ncode;
{ {
register c; register c;
register flg; register flg;
register unsigned char *cp; register unsigned char *cp;
register char *colp; register char *colp;
int ctype; int ctype;
register int cs; int cs;
struct cblock *scf; struct cblock *scf;
flg = tp->t_oflag; flg = tp->t_oflag;
@ -290,7 +286,6 @@ int ncode;
cp = (unsigned char *)&ucp.ptr->c_data[ucp.ptr->c_first]; cp = (unsigned char *)&ucp.ptr->c_data[ucp.ptr->c_first];
scf = ucp.ptr; scf = ucp.ptr;
} }
while (ncode--) { while (ncode--) {
c = *cp++; c = *cp++;
if (c >= DELAYDEL){ if (c >= DELAYDEL){
@ -332,6 +327,7 @@ int ncode;
colp = &tp->t_col; colp = &tp->t_col;
c = 0; c = 0;
switch (ctype&077) { switch (ctype&077) {
case 0: /* ordinary */ case 0: /* ordinary */
(*colp)++; (*colp)++;
@ -344,6 +340,7 @@ int ncode;
if (*colp) if (*colp)
(*colp)--; (*colp)--;
break; break;
case 3: /* line feed */ case 3: /* line feed */
if (flg&ONLRET) if (flg&ONLRET)
goto cr; goto cr;
@ -361,6 +358,7 @@ int ncode;
if (flg&NLDLY) if (flg&NLDLY)
c = 5; c = 5;
break; break;
case 4: /* tab */ case 4: /* tab */
c = 8 - ((*colp)&07); c = 8 - ((*colp)&07);
*colp += c; *colp += c;
@ -405,6 +403,7 @@ int ncode;
} }
*colp = 0; *colp = 0;
break; break;
case 7: /* form feed */ case 7: /* form feed */
if (flg&FFDLY) if (flg&FFDLY)
c = 0177; c = 0177;
@ -431,7 +430,6 @@ int ncode;
putcf(scf); putcf(scf);
} }
/* /*
* Get next function from output queue. * Get next function from output queue.
* Called from xmit interrupt complete. * Called from xmit interrupt complete.
@ -442,11 +440,9 @@ register struct tty *tp;
return; return;
} }
extern timeout();
tttimeo(tp) tttimeo(tp)
register struct tty *tp; register struct tty *tp;
{ {
tp->t_state &= ~TACT; /* timeout waiting on rawq */ tp->t_state &= ~TACT; /* timeout waiting on rawq */
if (tp->t_lflag&ICANON) if (tp->t_lflag&ICANON)
return; /* enable canonicalization */ return; /* enable canonicalization */