summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-07-21 20:57:15 +0000
committerbde <bde@FreeBSD.org>1995-07-21 20:57:15 +0000
commitfb20709ee5835b6c531ad29810bb232d88e3c761 (patch)
treedb33219710f2340ec77d1ff981215fd6baee9b6f /sys
parentdaf18dea5d745b2eb3faa60b23438209a50706f3 (diff)
downloadFreeBSD-src-fb20709ee5835b6c531ad29810bb232d88e3c761.zip
FreeBSD-src-fb20709ee5835b6c531ad29810bb232d88e3c761.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/gnu/isdn/iitty.c22
-rw-r--r--sys/kern/tty.c35
-rw-r--r--sys/kern/tty_pty.c17
-rw-r--r--sys/net/if_ppp.c4
-rw-r--r--sys/sys/tty.h5
5 files changed, 45 insertions, 38 deletions
diff --git a/sys/gnu/isdn/iitty.c b/sys/gnu/isdn/iitty.c
index cbc3a16..63f19ad 100644
--- a/sys/gnu/isdn/iitty.c
+++ b/sys/gnu/isdn/iitty.c
@@ -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();
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index f073e10..07624d3 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -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 @@ loop:
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 @@ sleep:
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 @@ slowcase:
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 @@ loop:
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 @@ loop:
(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 @@ loop:
goto out;
}
error = ttysleep(tp, &lbolt,
- TTOPRI | PCATCH, ttybuf, 0);
+ TTOPRI|PCATCH,
+ "ttybf1", 0);
if (error)
goto out;
goto loop;
@@ -1819,8 +1814,8 @@ loop:
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;
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index e67fc65..0a582fe 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -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 @@ again:
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 @@ block:
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;
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c
index 3b6ca66..236d5ad 100644
--- a/sys/net/if_ppp.c
+++ b/sys/net/if_ppp.c
@@ -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;
}
diff --git a/sys/sys/tty.h b/sys/sys/tty.h
index 25b81cd..2884be1f 100644
--- a/sys/sys/tty.h
+++ b/sys/sys/tty.h
@@ -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));
OpenPOWER on IntegriCloud