summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1995-02-25 20:09:44 +0000
committerpst <pst@FreeBSD.org>1995-02-25 20:09:44 +0000
commit1dcb420b646ff6fd0ab578e340fd7f26b32ed79d (patch)
tree1f0482b969de4dd457ac5b450c026dcaab6317e2 /sys/kern/tty.c
parent04958419e842202587df95082c8717fe0b164213 (diff)
downloadFreeBSD-src-1dcb420b646ff6fd0ab578e340fd7f26b32ed79d.zip
FreeBSD-src-1dcb420b646ff6fd0ab578e340fd7f26b32ed79d.tar.gz
(a) remove the pointer to each driver's tty structure array from cdevsw
(b) add a function callback vector to tty drivers that will return a pointer to a valid tty structure based upon a dev_t (c) make syscons structures the same size whether or not APM is enabled so utilities don't crash if NAPM changes (and make the damn kernel compile!) (d) rewrite /dev/snp ioctl interface so that it is device driver and i386 independant
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 33c75a0..03a0551 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.28 1995/02/15 22:25:51 ache Exp $
+ * $Id: tty.c,v 1.31 1995/02/24 02:36:01 ache Exp $
*/
#include "snp.h"
@@ -233,7 +233,7 @@ ttyclose(tp)
/*-
* TODO:
* o Fix races for sending the start char in ttyflush().
- * o Handle inter-byte timeout for "MIN > 0, TIME > 0" in ttselect().
+ * o Handle inter-byte timeout for "MIN > 0, TIME > 0" in ttyselect().
* With luck, there will be MIN chars before select() returns().
* o Handle CLOCAL consistently for ptys. Perhaps disallow setting it.
* o Don't allow input in TS_ZOMBIE case. It would be visible through
@@ -956,15 +956,15 @@ ttioctl(tp, cmd, data, flag)
}
int
-ttselect(device, rw, p)
- dev_t device;
+ttyselect(tp, rw, p)
+ struct tty *tp;
int rw;
struct proc *p;
{
- register struct tty *tp;
int nread, s;
- tp = &cdevsw[major(device)].d_ttys[minor(device)];
+ if (tp == NULL)
+ return (ENXIO);
s = spltty();
switch (rw) {
@@ -2144,9 +2144,8 @@ ttysleep(tp, chan, pri, wmesg, timo)
}
/*
- * XXX this is usable but not useful or used. ttselect() requires an array
- * of tty structs. Most tty drivers have ifdefs for using ttymalloc() but
- * assume a different interface.
+ * XXX this is usable not useful or used. Most tty drivers have
+ * ifdefs for using ttymalloc() but assume a different interface.
*/
/*
* Allocate a tty struct. Clists in the struct will be allocated by
OpenPOWER on IntegriCloud