Obtained from: partly from ancient patches by ache and me via 1.1.5

Nuke `symbolic sleep message strings'.  Use unique literal messages so that
`ps l' shows unambiguously where processes are sleeping.
This commit is contained in:
bde 1995-07-21 20:57:15 +00:00
parent daf18dea5d
commit fb20709ee5
5 changed files with 45 additions and 38 deletions

View File

@ -1,6 +1,6 @@
static char _ittyid[] = "@(#)$Id: iitty.c,v 1.5 1995/03/28 07:54:43 bde Exp $";
static char _ittyid[] = "@(#)$Id: iitty.c,v 1.6 1995/07/21 16:30:37 bde Exp $";
/*******************************************************************************
* II - Version 0.1 $Revision: 1.5 $ $State: Exp $
* II - Version 0.1 $Revision: 1.6 $ $State: Exp $
*
* Copyright 1994 Dietmar Friede
*******************************************************************************
@ -10,6 +10,22 @@ static char _ittyid[] = "@(#)$Id: iitty.c,v 1.5 1995/03/28 07:54:43 bde Exp
*
*******************************************************************************
* $Log: iitty.c,v $
* Revision 1.6 1995/07/21 16:30:37 bde
* Obtained from: partly from an ancient patch of mine via 1.1.5
*
* Temporarily nuke TS_WOPEN. It was only used for the obscure MDMBUF
* flow control option in the kernel and for informational purposes
* in `pstat -t'. The latter worked properly only for ptys. In
* general there may be multiple processes sleeping in open() and
* multiple processes that successfully opened the tty by opening it
* in O_NONBLOCK mode or during a window when CLOCAL was set. tty.c
* doesn't have enough information to maintain the flag but always
* cleared it in ttyopen().
*
* TS_WOPEN should be restored someday just so that `pstat -t' can
* display it (MDMBUF is already fixed). Fixing it requires counting
* of processes sleeping in open() in too many serial drivers.
*
* Revision 1.5 1995/03/28 07:54:43 bde
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
* (except in netccitt, netiso and netns) that I didn't notice when I fixed
@ -132,7 +148,7 @@ ityopen(dev_t dev, int flag, int mode, struct proc * p)
(tp->t_state & TS_CARR_ON) == 0)
{
if (error = ttysleep(tp, (caddr_t) & tp->t_rawq, TTIPRI | PCATCH,
ttopen, 0))
"iidcd", 0))
break;
}
(void) spl0();

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.c 8.8 (Berkeley) 1/21/94
* $Id: tty.c,v 1.52 1995/07/21 16:30:51 bde Exp $
* $Id: tty.c,v 1.53 1995/07/21 17:30:12 bde Exp $
*/
/*-
@ -99,14 +99,6 @@ static void ttyblock __P((struct tty *tp));
static void ttyecho __P((int, struct tty *tp));
static void ttyrubo __P((struct tty *, int));
/* Symbolic sleep message strings. */
char ttclos[] = "ttycls";
char ttopen[] = "ttyopn";
char ttybg[] = "ttybg";
char ttybuf[] = "ttybuf";
char ttyin[] = "ttyin";
char ttyout[] = "ttyout";
/*
* Table with character classes and parity. The 8th bit indicates parity,
* the 7th bit indicates the character is an alphameric or underscore (for
@ -720,7 +712,8 @@ ttioctl(tp, cmd, data, flag)
(p->p_sigignore & sigmask(SIGTTOU)) == 0 &&
(p->p_sigmask & sigmask(SIGTTOU)) == 0) {
pgsignal(p->p_pgrp, SIGTTOU, 1);
error = ttysleep(tp, &lbolt, TTOPRI | PCATCH, ttybg, 0);
error = ttysleep(tp, &lbolt, TTOPRI | PCATCH, "ttybg1",
0);
if (error)
return (error);
}
@ -1386,7 +1379,7 @@ ttread(tp, uio, flag)
p->p_flag & P_PPWAIT || p->p_pgrp->pg_jobc == 0)
return (EIO);
pgsignal(p->p_pgrp, SIGTTIN, 1);
error = ttysleep(tp, &lbolt, TTIPRI | PCATCH, ttybg, 0);
error = ttysleep(tp, &lbolt, TTIPRI | PCATCH, "ttybg2", 0);
if (error)
return (error);
goto loop;
@ -1511,7 +1504,8 @@ ttread(tp, uio, flag)
return (0); /* EOF */
}
error = ttysleep(tp, &tp->t_rawq, TTIPRI | PCATCH,
carrier ? ttyin : ttopen, (int)slp);
carrier ?
"ttyin" : "ttyhup", (int)slp);
splx(s);
if (error == EWOULDBLOCK)
error = 0;
@ -1576,8 +1570,8 @@ ttread(tp, uio, flag)
if (CCEQ(cc[VDSUSP], c) && ISSET(lflag, ISIG)) {
pgsignal(tp->t_pgrp, SIGTSTP, 1);
if (first) {
error = ttysleep(tp,
&lbolt, TTIPRI | PCATCH, ttybg, 0);
error = ttysleep(tp, &lbolt, TTIPRI | PCATCH,
"ttybg3", 0);
if (error)
break;
goto loop;
@ -1703,8 +1697,8 @@ ttwrite(tp, uio, flag)
goto out;
} else {
/* Sleep awaiting carrier. */
error = ttysleep(tp,
&tp->t_rawq, TTIPRI | PCATCH,ttopen, 0);
error = ttysleep(tp, &tp->t_rawq, TTIPRI | PCATCH,
"ttydcd", 0);
splx(s);
if (error)
goto out;
@ -1722,7 +1716,7 @@ ttwrite(tp, uio, flag)
(p->p_sigmask & sigmask(SIGTTOU)) == 0 &&
p->p_pgrp->pg_jobc) {
pgsignal(p->p_pgrp, SIGTTOU, 1);
error = ttysleep(tp, &lbolt, TTIPRI | PCATCH, ttybg, 0);
error = ttysleep(tp, &lbolt, TTIPRI | PCATCH, "ttybg4", 0);
if (error)
goto out;
goto loop;
@ -1785,7 +1779,8 @@ ttwrite(tp, uio, flag)
goto out;
}
error = ttysleep(tp, &lbolt,
TTOPRI | PCATCH, ttybuf, 0);
TTOPRI|PCATCH,
"ttybf1", 0);
if (error)
goto out;
goto loop;
@ -1819,8 +1814,8 @@ ttwrite(tp, uio, flag)
error = EWOULDBLOCK;
goto out;
}
error = ttysleep(tp,
&lbolt, TTOPRI | PCATCH, ttybuf, 0);
error = ttysleep(tp, &lbolt, TTOPRI | PCATCH,
"ttybf2", 0);
if (error)
goto out;
goto loop;

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tty_pty.c 8.2 (Berkeley) 9/23/93
* $Id: tty_pty.c,v 1.11 1995/05/30 08:06:14 rgrimes Exp $
* $Id: tty_pty.c,v 1.12 1995/07/21 16:30:52 bde Exp $
*/
/*
@ -137,7 +137,7 @@ ptsopen(dev, flag, devtype, p)
if (flag&FNONBLOCK)
break;
error = ttysleep(tp, (caddr_t)&tp->t_rawq, TTIPRI | PCATCH,
ttopen, 0);
"ptsopn", 0);
if (error)
return (error);
}
@ -183,16 +183,16 @@ ptsread(dev, uio, flag)
p->p_flag & P_PPWAIT)
return (EIO);
pgsignal(p->p_pgrp, SIGTTIN, 1);
error = ttysleep(tp, (caddr_t)&lbolt,
TTIPRI | PCATCH, ttybg, 0);
error = ttysleep(tp, &lbolt, TTIPRI | PCATCH, "ptsbg",
0);
if (error)
return (error);
}
if (tp->t_canq.c_cc == 0) {
if (flag & IO_NDELAY)
return (EWOULDBLOCK);
error = ttysleep(tp, (caddr_t)&tp->t_canq,
TTIPRI | PCATCH, ttyin, 0);
error = ttysleep(tp, &tp->t_canq, TTIPRI | PCATCH,
"ptsin", 0);
if (error)
return (error);
goto again;
@ -361,8 +361,7 @@ ptcread(dev, uio, flag)
return (0); /* EOF */
if (flag & IO_NDELAY)
return (EWOULDBLOCK);
error = tsleep((caddr_t)&tp->t_outq.c_cf, TTIPRI | PCATCH,
ttyin, 0);
error = tsleep(&tp->t_outq.c_cf, TTIPRI | PCATCH, "ptcin", 0);
if (error)
return (error);
}
@ -542,7 +541,7 @@ ptcwrite(dev, uio, flag)
return (EWOULDBLOCK);
return (0);
}
error = tsleep((caddr_t)&tp->t_rawq.c_cl, TTOPRI | PCATCH, ttyout, 0);
error = tsleep(&tp->t_rawq.c_cl, TTOPRI | PCATCH, "ptcout", 0);
if (error) {
/* adjust for data copied in but not written */
uio->uio_resid += cc;

View File

@ -69,7 +69,7 @@
* Paul Mackerras (paulus@cs.anu.edu.au).
*/
/* $Id: if_ppp.c,v 1.14 1995/06/11 19:31:41 rgrimes Exp $ */
/* $Id: if_ppp.c,v 1.15 1995/07/08 16:34:55 joerg Exp $ */
/* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
#include "ppp.h"
@ -391,7 +391,7 @@ pppread(tp, uio, flag)
splx(s);
return (EWOULDBLOCK);
}
error = ttysleep(tp, (caddr_t)&tp->t_rawq, TTIPRI|PCATCH, ttyin, 0);
error = ttysleep(tp, (caddr_t)&tp->t_rawq, TTIPRI|PCATCH, "pppin", 0);
if (error)
return error;
}

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.h 8.6 (Berkeley) 1/21/94
* $Id: tty.h,v 1.19 1995/07/16 10:22:37 joerg Exp $
* $Id: tty.h,v 1.20 1995/07/21 17:47:08 bde Exp $
*/
#ifndef _SYS_TTY_H_
@ -203,9 +203,6 @@ struct speedtab {
extern struct tty *constty; /* Temporary virtual console. */
extern struct ttychars ttydefaults;
/* Symbolic sleep message strings. */
extern char ttyin[], ttyout[], ttopen[], ttclos[], ttybg[], ttybuf[];
int b_to_q __P((char *cp, int cc, struct clist *q));
void catq __P((struct clist *from, struct clist *to));
void clist_alloc_cblocks __P((struct clist *q, int ccmax, int ccres));