summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1995-02-28 00:21:11 +0000
committerpst <pst@FreeBSD.org>1995-02-28 00:21:11 +0000
commit9b98fb36dc05ba21e4898c983c58bc0eb8f669b4 (patch)
tree91c6a33544eb4628383ab7c05b8571d00b6f35d3
parent2b514bef5110bbe670f032770ac8769b1f371b4c (diff)
downloadFreeBSD-src-9b98fb36dc05ba21e4898c983c58bc0eb8f669b4.zip
FreeBSD-src-9b98fb36dc05ba21e4898c983c58bc0eb8f669b4.tar.gz
Incorporate bde's code-review comments.
(a) bring back ttselect, now that we have xxxdevtotty() it isn't dangerous. (b) remove all of the wrappers that have been replaced by ttselect (c) fix formatting in syscons.c and definition in syscons.h (d) add cxdevtotty NOT DONE: (e) make pcvt work... it was already broken...when someone fixes pcvt to link properly, just rename get_pccons to xxxdevtotty and we're done
-rw-r--r--sys/dev/cy/cy.c12
-rw-r--r--sys/dev/cy/cy_isa.c12
-rw-r--r--sys/dev/sio/sio.c11
-rw-r--r--sys/dev/syscons/syscons.c13
-rw-r--r--sys/dev/syscons/syscons.h4
-rw-r--r--sys/gnu/isdn/iitty.c23
-rw-r--r--sys/i386/i386/conf.c26
-rw-r--r--sys/i386/isa/cx.c19
-rw-r--r--sys/i386/isa/cy.c12
-rw-r--r--sys/i386/isa/sio.c11
-rw-r--r--sys/i386/isa/syscons.c13
-rw-r--r--sys/i386/isa/syscons.h4
-rw-r--r--sys/isa/sio.c11
-rw-r--r--sys/isa/syscons.c13
-rw-r--r--sys/isa/syscons.h4
-rw-r--r--sys/kern/tty.c15
-rw-r--r--sys/kern/tty_pty.c12
-rw-r--r--sys/sys/tty.h3
18 files changed, 70 insertions, 148 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index ff67eb4..f9defd0 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.2 1995/02/15 18:41:41 bde Exp $
+ * $Id: cy.c,v 1.3 1995/02/25 20:09:12 pst Exp $
*/
/*
@@ -1512,16 +1512,6 @@ cydevtotty(dev_t dev)
}
int
-cyselect(dev_t dev, int rw, struct proc *p)
-{
- u_char unit = UNIT(dev);
- if (unit >= /* NCY * ? */ PORTS_PER_CYCLOM)
- return (ENXIO);
-
- return (ttyselect(info[unit]->tty, rw, p));
-}
-
-int
cyspeed(int speed, int *prescaler_io)
{
int actual;
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index ff67eb4..f9defd0 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.2 1995/02/15 18:41:41 bde Exp $
+ * $Id: cy.c,v 1.3 1995/02/25 20:09:12 pst Exp $
*/
/*
@@ -1512,16 +1512,6 @@ cydevtotty(dev_t dev)
}
int
-cyselect(dev_t dev, int rw, struct proc *p)
-{
- u_char unit = UNIT(dev);
- if (unit >= /* NCY * ? */ PORTS_PER_CYCLOM)
- return (ENXIO);
-
- return (ttyselect(info[unit]->tty, rw, p));
-}
-
-int
cyspeed(int speed, int *prescaler_io)
{
int actual;
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 1930bb9..e5115e8 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.67 1995/02/25 20:09:14 pst Exp $
+ * $Id: sio.c,v 1.68 1995/02/26 02:30:18 bde Exp $
*/
#include "sio.h"
@@ -1840,15 +1840,6 @@ siodevtotty(dev)
return (&sio_tty[unit]);
}
-int
-sioselect(dev, rw, p)
- dev_t dev;
- int rw;
- struct proc *p;
-{
- return (ttyselect(siodevtotty(dev), rw, p));
-}
-
static void
commctl(com, bits, how)
struct com_s *com;
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index 379776b..71906d6 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.104 1995/02/22 13:40:19 sos Exp $
+ * $Id: syscons.c,v 1.105 1995/02/25 20:09:16 pst Exp $
*/
#include "sc.h"
@@ -299,17 +299,6 @@ struct tty
return VIRTUAL_TTY(unit);
}
-int
-scselect(dev_t dev, int rw, struct proc *p)
-{
- struct tty *tp = scdevtotty(dev);
-
- if (tp == NULL)
- return(ENXIO);
-
- return (ttyselect(tp, rw, p));
-}
-
static scr_stat
*get_scr_stat(dev_t dev)
{
diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h
index 60cf84e..7b94bf5 100644
--- a/sys/dev/syscons/syscons.h
+++ b/sys/dev/syscons/syscons.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.h,v 1.1 1995/02/22 13:40:21 sos Exp $
+ * $Id: syscons.h,v 1.2 1995/02/25 20:09:21 pst Exp $
*/
/*
@@ -175,7 +175,7 @@ void scintr(int unit);
int pcmmap(dev_t dev, int offset, int nprot);
static void scinit(void);
static u_int scgetc(int noblock);
-static struct tty *get_tty_ptr(dev_t dev);
+struct tty *scdevtotty(dev_t dev);
static scr_stat *get_scr_stat(dev_t dev);
static scr_stat *alloc_scp();
static void init_scp(scr_stat *scp);
diff --git a/sys/gnu/isdn/iitty.c b/sys/gnu/isdn/iitty.c
index 0ca62f5..a58793b 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.2 1995/02/15 06:28:28 jkh Exp $";
+static char _ittyid[] = "@(#)$Id: iitty.c,v 1.3 1995/02/25 20:08:52 pst Exp $";
/*******************************************************************************
- * II - Version 0.1 $Revision: 1.2 $ $State: Exp $
+ * II - Version 0.1 $Revision: 1.3 $ $State: Exp $
*
* Copyright 1994 Dietmar Friede
*******************************************************************************
@@ -10,6 +10,15 @@ static char _ittyid[] = "@(#)$Id: iitty.c,v 1.2 1995/02/15 06:28:28 jkh Exp
*
*******************************************************************************
* $Log: iitty.c,v $
+ * Revision 1.3 1995/02/25 20:08:52 pst
+ * (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
+ *
* Revision 1.2 1995/02/15 06:28:28 jkh
* Fix up include paths, nuke some warnings.
*
@@ -334,14 +343,4 @@ itydevtotty(dev_t dev)
return (&ity_tty[unit]);
}
-int
-ityselect(dev_t dev, int rw, struct proc *p)
-{
- register int unit = UNIT(dev);
- if (unit >= next_if)
- return (ENXIO);
-
- return (ttyselect(&ity_tty[unit], rw, p));
-}
-
#endif
diff --git a/sys/i386/i386/conf.c b/sys/i386/i386/conf.c
index 35f03b0..b657ffc 100644
--- a/sys/i386/i386/conf.c
+++ b/sys/i386/i386/conf.c
@@ -42,7 +42,7 @@
* SUCH DAMAGE.
*
* from: @(#)conf.c 5.8 (Berkeley) 5/12/91
- * $Id: conf.c,v 1.68 1995/02/25 20:09:03 pst Exp $
+ * $Id: conf.c,v 1.69 1995/02/27 19:46:27 ugen Exp $
*/
#include <sys/param.h>
@@ -354,7 +354,6 @@ int nblkdev = sizeof (bdevsw) / sizeof (bdevsw[0]);
d_open_t scopen;
d_close_t scclose;
d_rdwr_t scread, scwrite;
-d_select_t scselect;
d_ioctl_t scioctl;
d_mmap_t scmmap;
d_ttycv_t scdevtotty;
@@ -363,7 +362,6 @@ d_ttycv_t scdevtotty;
#define scclose nxclose
#define scread nxread
#define scwrite nxwrite
-#define scselect nxselect
#define scioctl nxioctl
#define scmmap nxmmap
#define scdevtotty nxdevtotty
@@ -391,7 +389,6 @@ d_close_t ptsclose;
d_rdwr_t ptsread;
d_rdwr_t ptswrite;
d_stop_t ptsstop;
-d_select_t ptsselect;
d_open_t ptcopen;
d_close_t ptcclose;
d_rdwr_t ptcread;
@@ -404,7 +401,6 @@ d_ioctl_t ptyioctl;
#define ptsclose nxclose
#define ptsread nxread
#define ptswrite nxwrite
-#define ptsselect nxselect
#define ptcopen nxopen
#define ptcclose nxclose
#define ptcread nxread
@@ -599,7 +595,6 @@ d_open_t sioopen;
d_close_t sioclose;
d_rdwr_t sioread, siowrite;
d_ioctl_t sioioctl;
-d_select_t sioselect;
d_stop_t siostop;
d_ttycv_t siodevtotty;
#define sioreset nxreset
@@ -611,7 +606,6 @@ d_ttycv_t siodevtotty;
#define sioioctl nxioctl
#define siostop nxstop
#define sioreset nxreset
-#define sioselect nxselect
#define siodevtotty nxdevtotty
#endif
@@ -714,6 +708,7 @@ d_rdwr_t cxread, cxwrite;
d_ioctl_t cxioctl;
d_select_t cxselect;
d_stop_t cxstop;
+d_ttycv_t cxdevtotty;
#else
#define cxopen nxopen
#define cxclose nxclose
@@ -722,6 +717,7 @@ d_stop_t cxstop;
#define cxioctl nxioctl
#define cxstop nxstop
#define cxselect nxselect
+#define cxdevtotty nxdevtotty
#endif
#include "gp.h"
@@ -806,7 +802,6 @@ d_read_t cyread;
d_write_t cywrite;
d_ioctl_t cyioctl;
d_stop_t cystop;
-d_select_t cyselect;
d_ttycv_t cydevtotty;
#define cyreset nxreset
#define cymmap nxmmap
@@ -819,7 +814,6 @@ d_ttycv_t cydevtotty;
#define cyioctl nxioctl
#define cystop nxstop
#define cyreset nxreset
-#define cyselect nxselect
#define cymmap nxmmap
#define cystrategy nxstrategy
#define cydevtotty nxdevtotty
@@ -832,7 +826,6 @@ d_close_t ityclose;
d_read_t ityread;
d_write_t itywrite;
d_ioctl_t ityioctl;
-d_select_t ityselect;
d_ttycv_t itydevtotty;
#define ityreset nxreset
#else
@@ -842,7 +835,6 @@ d_ttycv_t itydevtotty;
#define itywrite nxwrite
#define ityioctl nxioctl
#define ityreset nxreset
-#define ityselect nxselect
#define itydevtotty nxdevtotty
#endif
@@ -932,7 +924,7 @@ struct cdevsw cdevsw[] =
noselect, nommap, swstrategy },
{ ptsopen, ptsclose, ptsread, ptswrite, /*5*/
ptyioctl, ptsstop, nullreset, ptydevtotty,/* ttyp */
- ptsselect, nommap, NULL },
+ ttselect, nommap, NULL },
{ ptcopen, ptcclose, ptcread, ptcwrite, /*6*/
ptyioctl, nullstop, nullreset, ptydevtotty,/* ptyp */
ptcselect, nommap, NULL },
@@ -953,7 +945,7 @@ struct cdevsw cdevsw[] =
spigot_select, spigot_mmap, NULL },
{ scopen, scclose, scread, scwrite, /*12*/
scioctl, nullstop, nullreset, scdevtotty,/* sc */
- scselect, scmmap, NULL },
+ ttselect, scmmap, NULL },
{ sdopen, sdclose, rawread, rawwrite, /*13*/
sdioctl, nostop, nullreset, nodevtotty,/* sd */
seltrue, nommap, sdstrategy },
@@ -1010,7 +1002,7 @@ struct cdevsw cdevsw[] =
mseselect, nommap, NULL },
{ sioopen, sioclose, sioread, siowrite, /*28*/
sioioctl, siostop, sioreset, siodevtotty,/* sio */
- sioselect, nommap, NULL },
+ ttselect, nommap, NULL },
{ mcdopen, mcdclose, rawread, nowrite, /*29*/
mcdioctl, nostop, nullreset, nodevtotty,/* mitsumi cd */
seltrue, nommap, mcdstrategy },
@@ -1051,7 +1043,7 @@ struct cdevsw cdevsw[] =
sockioctl, nostop, nullreset, nodevtotty,/* socksys */
seltrue, nommap, NULL },
{ cxopen, cxclose, cxread, cxwrite, /*42*/
- cxioctl, cxstop, nullreset, nodevtotty,/* cronyx */
+ cxioctl, cxstop, nullreset, cxdevtotty,/* cronyx */
cxselect, nommap, NULL },
{ vnopen, vnclose, rawread, rawwrite, /*43*/
vnioctl, nostop, nullreset, nodevtotty,/* vn */
@@ -1070,7 +1062,7 @@ struct cdevsw cdevsw[] =
seltrue, nommap, NULL },
{ cyopen, cyclose, cyread, cywrite, /*48*/
cyioctl, cystop, cyreset, cydevtotty,/*cyclades*/
- cyselect, cymmap, cystrategy },
+ ttselect, cymmap, cystrategy },
{ sscopen, sscclose, sscread, sscwrite, /*49*/
sscioctl, nostop, nullreset, nodevtotty,/* scsi super */
sscselect, sscmmap, sscstrategy },
@@ -1094,7 +1086,7 @@ struct cdevsw cdevsw[] =
seltrue, nommap, NULL },
{ ityopen, ityclose, ityread, itywrite, /*56*/
ityioctl, nostop, ityreset, itydevtotty,/* ity */
- ityselect, nommap, NULL },
+ ttselect, nommap, NULL },
{ itelopen, itelclose, itelread, itelwrite, /*57*/
itelioctl, nostop, nullreset, nodevtotty,/* itel */
seltrue, nommap, NULL },
diff --git a/sys/i386/isa/cx.c b/sys/i386/isa/cx.c
index f7a53fe..2ee5df8 100644
--- a/sys/i386/isa/cx.c
+++ b/sys/i386/isa/cx.c
@@ -671,6 +671,19 @@ int cxparam (struct tty *tp, struct termios *t)
splx (s);
return (0);
}
+
+struct tty *cxdevtotty (dev_t dev)
+{
+ int unit = UNIT(dev);
+
+ if (unit == UNIT_CTL)
+ return (NULL);
+
+ if (unit > NCX*NCHAN)
+ return (NULL);
+
+ return (cxchan[unit]->ttyp);
+}
int cxselect (dev_t dev, int flag, struct proc *p)
{
@@ -678,7 +691,11 @@ int cxselect (dev_t dev, int flag, struct proc *p)
if (unit == UNIT_CTL)
return (0);
- return (ttyselect (cxchan[unit]->ttyp, flag, p));
+
+ if (unit > NCX*NCHAN)
+ return (ENXIO);
+
+ return (ttyselect(cxchan[unit]->ttyp, flag, p));
}
/*
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c
index ff67eb4..f9defd0 100644
--- a/sys/i386/isa/cy.c
+++ b/sys/i386/isa/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.2 1995/02/15 18:41:41 bde Exp $
+ * $Id: cy.c,v 1.3 1995/02/25 20:09:12 pst Exp $
*/
/*
@@ -1512,16 +1512,6 @@ cydevtotty(dev_t dev)
}
int
-cyselect(dev_t dev, int rw, struct proc *p)
-{
- u_char unit = UNIT(dev);
- if (unit >= /* NCY * ? */ PORTS_PER_CYCLOM)
- return (ENXIO);
-
- return (ttyselect(info[unit]->tty, rw, p));
-}
-
-int
cyspeed(int speed, int *prescaler_io)
{
int actual;
diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c
index 1930bb9..e5115e8 100644
--- a/sys/i386/isa/sio.c
+++ b/sys/i386/isa/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.67 1995/02/25 20:09:14 pst Exp $
+ * $Id: sio.c,v 1.68 1995/02/26 02:30:18 bde Exp $
*/
#include "sio.h"
@@ -1840,15 +1840,6 @@ siodevtotty(dev)
return (&sio_tty[unit]);
}
-int
-sioselect(dev, rw, p)
- dev_t dev;
- int rw;
- struct proc *p;
-{
- return (ttyselect(siodevtotty(dev), rw, p));
-}
-
static void
commctl(com, bits, how)
struct com_s *com;
diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c
index 379776b..71906d6 100644
--- a/sys/i386/isa/syscons.c
+++ b/sys/i386/isa/syscons.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.104 1995/02/22 13:40:19 sos Exp $
+ * $Id: syscons.c,v 1.105 1995/02/25 20:09:16 pst Exp $
*/
#include "sc.h"
@@ -299,17 +299,6 @@ struct tty
return VIRTUAL_TTY(unit);
}
-int
-scselect(dev_t dev, int rw, struct proc *p)
-{
- struct tty *tp = scdevtotty(dev);
-
- if (tp == NULL)
- return(ENXIO);
-
- return (ttyselect(tp, rw, p));
-}
-
static scr_stat
*get_scr_stat(dev_t dev)
{
diff --git a/sys/i386/isa/syscons.h b/sys/i386/isa/syscons.h
index 60cf84e..7b94bf5 100644
--- a/sys/i386/isa/syscons.h
+++ b/sys/i386/isa/syscons.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.h,v 1.1 1995/02/22 13:40:21 sos Exp $
+ * $Id: syscons.h,v 1.2 1995/02/25 20:09:21 pst Exp $
*/
/*
@@ -175,7 +175,7 @@ void scintr(int unit);
int pcmmap(dev_t dev, int offset, int nprot);
static void scinit(void);
static u_int scgetc(int noblock);
-static struct tty *get_tty_ptr(dev_t dev);
+struct tty *scdevtotty(dev_t dev);
static scr_stat *get_scr_stat(dev_t dev);
static scr_stat *alloc_scp();
static void init_scp(scr_stat *scp);
diff --git a/sys/isa/sio.c b/sys/isa/sio.c
index 1930bb9..e5115e8 100644
--- a/sys/isa/sio.c
+++ b/sys/isa/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.67 1995/02/25 20:09:14 pst Exp $
+ * $Id: sio.c,v 1.68 1995/02/26 02:30:18 bde Exp $
*/
#include "sio.h"
@@ -1840,15 +1840,6 @@ siodevtotty(dev)
return (&sio_tty[unit]);
}
-int
-sioselect(dev, rw, p)
- dev_t dev;
- int rw;
- struct proc *p;
-{
- return (ttyselect(siodevtotty(dev), rw, p));
-}
-
static void
commctl(com, bits, how)
struct com_s *com;
diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c
index 379776b..71906d6 100644
--- a/sys/isa/syscons.c
+++ b/sys/isa/syscons.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.104 1995/02/22 13:40:19 sos Exp $
+ * $Id: syscons.c,v 1.105 1995/02/25 20:09:16 pst Exp $
*/
#include "sc.h"
@@ -299,17 +299,6 @@ struct tty
return VIRTUAL_TTY(unit);
}
-int
-scselect(dev_t dev, int rw, struct proc *p)
-{
- struct tty *tp = scdevtotty(dev);
-
- if (tp == NULL)
- return(ENXIO);
-
- return (ttyselect(tp, rw, p));
-}
-
static scr_stat
*get_scr_stat(dev_t dev)
{
diff --git a/sys/isa/syscons.h b/sys/isa/syscons.h
index 60cf84e..7b94bf5 100644
--- a/sys/isa/syscons.h
+++ b/sys/isa/syscons.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.h,v 1.1 1995/02/22 13:40:21 sos Exp $
+ * $Id: syscons.h,v 1.2 1995/02/25 20:09:21 pst Exp $
*/
/*
@@ -175,7 +175,7 @@ void scintr(int unit);
int pcmmap(dev_t dev, int offset, int nprot);
static void scinit(void);
static u_int scgetc(int noblock);
-static struct tty *get_tty_ptr(dev_t dev);
+struct tty *scdevtotty(dev_t dev);
static scr_stat *get_scr_stat(dev_t dev);
static scr_stat *alloc_scp();
static void init_scp(scr_stat *scp);
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index e516ec2..2020d7d 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.32 1995/02/25 20:09:29 pst Exp $
+ * $Id: tty.c,v 1.33 1995/02/27 19:47:31 ugen Exp $
*/
#include "snp.h"
@@ -988,6 +988,19 @@ win: splx(s);
}
/*
+ * This is a wrapper for compatibility with the select vector used by
+ * cdevsw. It relies on a proper xxxdevtotty routine.
+ */
+int
+ttselect(dev, rw, p)
+ dev_t dev;
+ int rw;
+ struct proc *p;
+{
+ return ttyselect((*cdevsw[major(dev)].d_devtotty)(dev), rw, p);
+}
+
+/*
* This is now exported to the cy driver as well; if you hack this code,
* then be sure to keep /sys/i386/isa/cy.c properly advised! -jkh
*/
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 14ef309..861982e 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.6 1994/10/29 23:59:48 ache Exp $
+ * $Id: tty_pty.c,v 1.7 1995/02/25 20:09:30 pst Exp $
*/
/*
@@ -562,16 +562,6 @@ ptydevtotty(dev)
return &pt_tty[minor(dev)];
}
-int
-ptsselect(dev, rw, p)
- dev_t dev;
- int rw;
- struct proc * p;
-{
- return ttyselect(ptydevtotty(dev), rw, p);
-}
-
-
/*ARGSUSED*/
int
ptyioctl(dev, cmd, data, flag, p)
diff --git a/sys/sys/tty.h b/sys/sys/tty.h
index cb7a667..6683a73 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.10 1995/02/14 21:23:48 ugen Exp $
+ * $Id: tty.h,v 1.11 1995/02/25 20:09:44 pst Exp $
*/
#ifndef _SYS_TTY_H_
@@ -209,6 +209,7 @@ int ttread __P((struct tty *tp, struct uio *uio, int flag));
int ttnread __P((struct tty *));
void ttrstrt __P((void *tp));
int ttyselect __P((struct tty *tp, int rw, struct proc *p));
+int ttselect __P((dev_t dev, int rw, struct proc *p));
void ttsetwater __P((struct tty *tp));
int ttspeedtab __P((int speed, struct speedtab *table));
int ttstart __P((struct tty *tp));
OpenPOWER on IntegriCloud