diff options
author | Christian Weisgerber <naddy@cvs.openbsd.org> | 2013-12-13 19:55:13 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@cvs.openbsd.org> | 2013-12-13 19:55:13 +0000 |
commit | ea43d15c920ad1131888b858587480950261c946 (patch) | |
tree | 6cc505b79ca00cce022e2fe6b032001ffb789586 /sys | |
parent | 1c0c9a1ff123331a59c32cad90de236ae0e6846f (diff) |
Remove the 4.3BSD tty(4) compatibility shims. RIP. ok millert@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/compat/common/tty_43.c | 485 | ||||
-rw-r--r-- | sys/conf/files | 3 | ||||
-rw-r--r-- | sys/ddb/db_structinfo.c | 3 | ||||
-rw-r--r-- | sys/kern/tty.c | 19 | ||||
-rw-r--r-- | sys/kern/tty_conf.c | 7 | ||||
-rw-r--r-- | sys/kern/tty_pty.c | 15 | ||||
-rw-r--r-- | sys/sys/ioctl.h | 11 | ||||
-rw-r--r-- | sys/sys/ioctl_compat.h | 127 | ||||
-rw-r--r-- | sys/sys/tty.h | 7 | ||||
-rw-r--r-- | sys/sys/ttychars.h | 62 | ||||
-rw-r--r-- | sys/sys/ttydev.h | 61 |
11 files changed, 12 insertions, 788 deletions
diff --git a/sys/compat/common/tty_43.c b/sys/compat/common/tty_43.c deleted file mode 100644 index 26606f1ceae..00000000000 --- a/sys/compat/common/tty_43.c +++ /dev/null @@ -1,485 +0,0 @@ -/* $OpenBSD: tty_43.c,v 1.11 2013/04/09 02:56:50 tedu Exp $ */ -/* $NetBSD: tty_43.c,v 1.5 1996/05/20 14:29:17 mark Exp $ */ - -/*- - * Copyright (c) 1982, 1986, 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)tty_compat.c 8.1 (Berkeley) 6/10/93 - */ - -/* - * mapping routines for old line discipline (yuck) - */ -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/ioctl.h> -#include <sys/proc.h> -#include <sys/tty.h> -#include <sys/termios.h> -#include <sys/file.h> -#include <sys/conf.h> -#include <sys/kernel.h> -#include <sys/syslog.h> -#include <sys/ioctl_compat.h> - -/* - * XXX libcompat files should be included with config attributes - */ -#ifdef COMPAT_OLDTTY - -int ttydebug = 0; - -static const struct speedtab compatspeeds[] = { -#define MAX_SPEED 17 - { 115200, 17 }, - { 57600, 16 }, - { 38400, 15 }, - { 19200, 14 }, - { 9600, 13 }, - { 4800, 12 }, - { 2400, 11 }, - { 1800, 10 }, - { 1200, 9 }, - { 600, 8 }, - { 300, 7 }, - { 200, 6 }, - { 150, 5 }, - { 134, 4 }, - { 110, 3 }, - { 75, 2 }, - { 50, 1 }, - { 0, 0 }, - { -1, -1 }, -}; -static const int compatspcodes[] = { - 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, - 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200 -}; - -int ttcompatgetflags(struct tty *); -void ttcompatsetflags(struct tty *, struct termios *); -void ttcompatsetlflags(struct tty *, struct termios *); - -/*ARGSUSED*/ -int -ttcompat(struct tty *tp, u_long com, caddr_t data, int flag, struct proc *p) -{ - - switch (com) { - case TIOCGETP: { - struct sgttyb *sg = (struct sgttyb *)data; - u_char *cc = tp->t_cc; - int speed; - - speed = ttspeedtab(tp->t_ospeed, compatspeeds); - sg->sg_ospeed = (speed == -1) ? MAX_SPEED : speed; - if (tp->t_ispeed == 0) - sg->sg_ispeed = sg->sg_ospeed; - else { - speed = ttspeedtab(tp->t_ispeed, compatspeeds); - sg->sg_ispeed = (speed == -1) ? MAX_SPEED : speed; - } - sg->sg_erase = cc[VERASE]; - sg->sg_kill = cc[VKILL]; - sg->sg_flags = ttcompatgetflags(tp); - break; - } - - case TIOCSETP: - case TIOCSETN: { - struct sgttyb *sg = (struct sgttyb *)data; - struct termios term; - int speed; - - term = tp->t_termios; - if ((speed = sg->sg_ispeed) > MAX_SPEED || speed < 0) - term.c_ispeed = speed; - else - term.c_ispeed = compatspcodes[speed]; - if ((speed = sg->sg_ospeed) > MAX_SPEED || speed < 0) - term.c_ospeed = speed; - else - term.c_ospeed = compatspcodes[speed]; - term.c_cc[VERASE] = sg->sg_erase; - term.c_cc[VKILL] = sg->sg_kill; - tp->t_flags = (ttcompatgetflags(tp) & 0xffff0000) | - (sg->sg_flags & 0xffff); - ttcompatsetflags(tp, &term); - return (ttioctl(tp, com == TIOCSETP ? TIOCSETAF : TIOCSETA, - (caddr_t)&term, flag, p)); - } - - case TIOCGETC: { - struct tchars *tc = (struct tchars *)data; - u_char *cc = tp->t_cc; - - tc->t_intrc = cc[VINTR]; - tc->t_quitc = cc[VQUIT]; - tc->t_startc = cc[VSTART]; - tc->t_stopc = cc[VSTOP]; - tc->t_eofc = cc[VEOF]; - tc->t_brkc = cc[VEOL]; - break; - } - case TIOCSETC: { - struct tchars *tc = (struct tchars *)data; - u_char *cc = tp->t_cc; - - cc[VINTR] = tc->t_intrc; - cc[VQUIT] = tc->t_quitc; - cc[VSTART] = tc->t_startc; - cc[VSTOP] = tc->t_stopc; - cc[VEOF] = tc->t_eofc; - cc[VEOL] = tc->t_brkc; - if (tc->t_brkc == (char)-1) - cc[VEOL2] = _POSIX_VDISABLE; - break; - } - case TIOCSLTC: { - struct ltchars *ltc = (struct ltchars *)data; - u_char *cc = tp->t_cc; - - cc[VSUSP] = ltc->t_suspc; - cc[VDSUSP] = ltc->t_dsuspc; - cc[VREPRINT] = ltc->t_rprntc; - cc[VDISCARD] = ltc->t_flushc; - cc[VWERASE] = ltc->t_werasc; - cc[VLNEXT] = ltc->t_lnextc; - break; - } - case TIOCGLTC: { - struct ltchars *ltc = (struct ltchars *)data; - u_char *cc = tp->t_cc; - - ltc->t_suspc = cc[VSUSP]; - ltc->t_dsuspc = cc[VDSUSP]; - ltc->t_rprntc = cc[VREPRINT]; - ltc->t_flushc = cc[VDISCARD]; - ltc->t_werasc = cc[VWERASE]; - ltc->t_lnextc = cc[VLNEXT]; - break; - } - case TIOCLBIS: - case TIOCLBIC: - case TIOCLSET: { - struct termios term; - int flags; - - term = tp->t_termios; - flags = ttcompatgetflags(tp); - switch (com) { - case TIOCLSET: - tp->t_flags = (flags & 0xffff) | (*(int *)data << 16); - break; - case TIOCLBIS: - tp->t_flags = flags | (*(int *)data << 16); - break; - case TIOCLBIC: - tp->t_flags = flags & ~(*(int *)data << 16); - break; - } - ttcompatsetlflags(tp, &term); - return (ttioctl(tp, TIOCSETA, (caddr_t)&term, flag, p)); - } - case TIOCLGET: - *(int *)data = ttcompatgetflags(tp) >> 16; - if (ttydebug) - printf("CLGET: returning %x\n", *(int *)data); - break; - - case OTIOCGETD: - *(int *)data = tp->t_line ? tp->t_line : 2; - break; - - case OTIOCSETD: { - int ldisczero = 0; - - return (ttioctl(tp, TIOCSETD, - *(int *)data == 2 ? (caddr_t)&ldisczero : data, flag, p)); - } - case OTIOCCONS: - *(int *)data = 1; - return (ttioctl(tp, TIOCCONS, data, flag, p)); - - case TIOCHPCL: - SET(tp->t_cflag, HUPCL); - break; - - case TIOCGSID: - if (tp->t_session == NULL) - return (ENOTTY); - - if (tp->t_session->s_leader == NULL) - return (ENOTTY); - - *(int *)data = tp->t_session->s_leader->ps_pid; - break; - - default: - return (-1); - } - return (0); -} - -int -ttcompatgetflags(struct tty *tp) -{ - tcflag_t iflag = tp->t_iflag; - tcflag_t lflag = tp->t_lflag; - tcflag_t oflag = tp->t_oflag; - tcflag_t cflag = tp->t_cflag; - int flags = 0; - - if (ISSET(iflag, IXOFF)) - SET(flags, TANDEM); - if (ISSET(iflag, ICRNL) || ISSET(oflag, ONLCR)) - SET(flags, CRMOD); - if (ISSET(cflag, PARENB)) { - if (ISSET(iflag, INPCK)) { - if (ISSET(cflag, PARODD)) - SET(flags, ODDP); - else - SET(flags, EVENP); - } else - SET(flags, ANYP); - } - - if (!ISSET(lflag, ICANON)) { - /* fudge */ - if (ISSET(iflag, IXON) || ISSET(lflag, ISIG|IEXTEN) || - ISSET(cflag, PARENB)) - SET(flags, CBREAK); - else - SET(flags, RAW); - } - - if (ISSET(flags, RAW)) - SET(flags, ISSET(tp->t_flags, LITOUT|PASS8)); - else if (ISSET(cflag, CSIZE) == CS8) { - if (!ISSET(oflag, OPOST)) - SET(flags, LITOUT); - if (!ISSET(iflag, ISTRIP)) - SET(flags, PASS8); - } - - if (ISSET(cflag, MDMBUF)) - SET(flags, MDMBUF); - if (!ISSET(cflag, HUPCL)) - SET(flags, NOHANG); - if (ISSET(cflag, XCASE) && ISSET(iflag, IUCLC) && ISSET(oflag, OLCUC)) - SET(flags, LCASE); - if (ISSET(oflag, OXTABS)) - SET(flags, XTABS); - if (ISSET(lflag, ECHOE)) - SET(flags, CRTERA|CRTBS); - if (ISSET(lflag, ECHOKE)) - SET(flags, CRTKIL|CRTBS); - if (ISSET(lflag, ECHOPRT)) - SET(flags, PRTERA); - if (ISSET(lflag, ECHOCTL)) - SET(flags, CTLECH); - if (!ISSET(iflag, IXANY)) - SET(flags, DECCTQ); - SET(flags, ISSET(lflag, ECHO|TOSTOP|FLUSHO|PENDIN|NOFLSH)); - if (ttydebug) - printf("getflags: %x\n", flags); - return (flags); -} - -void -ttcompatsetflags(struct tty *tp, struct termios *t) -{ - int flags = tp->t_flags; - tcflag_t iflag = t->c_iflag; - tcflag_t oflag = t->c_oflag; - tcflag_t lflag = t->c_lflag; - tcflag_t cflag = t->c_cflag; - - if (ISSET(flags, TANDEM)) - SET(iflag, IXOFF); - else - CLR(iflag, IXOFF); - if (ISSET(flags, ECHO)) - SET(lflag, ECHO); - else - CLR(lflag, ECHO); - if (ISSET(flags, CRMOD)) { - SET(iflag, ICRNL); - SET(oflag, ONLCR); - } else { - CLR(iflag, ICRNL); - CLR(oflag, ONLCR); - } - if (ISSET(flags, XTABS)) - SET(oflag, OXTABS); - else - CLR(oflag, OXTABS); - if (ISSET(flags, LCASE)) { - SET(iflag, IUCLC); - SET(oflag, OLCUC); - SET(cflag, XCASE); - } - else { - CLR(iflag, IUCLC); - CLR(oflag, OLCUC); - CLR(cflag, XCASE); - } - - if (ISSET(flags, RAW)) { - iflag &= IXOFF|IXANY; - CLR(lflag, ISIG|ICANON|IEXTEN); - CLR(cflag, PARENB); - } else { - SET(iflag, BRKINT|IXON|IMAXBEL); - SET(lflag, ISIG|IEXTEN); - if (ISSET(flags, CBREAK)) - CLR(lflag, ICANON); - else - SET(lflag, ICANON); - switch (ISSET(flags, ANYP)) { - case 0: - CLR(cflag, PARENB); - break; - case ANYP: - SET(cflag, PARENB); - CLR(iflag, INPCK); - break; - case EVENP: - SET(cflag, PARENB); - SET(iflag, INPCK); - CLR(cflag, PARODD); - break; - case ODDP: - SET(cflag, PARENB); - SET(iflag, INPCK); - SET(cflag, PARODD); - break; - } - } - - if (ISSET(flags, RAW|LITOUT|PASS8)) { - CLR(cflag, CSIZE|XCASE); - SET(cflag, CS8); - if (!ISSET(flags, RAW|PASS8)) - SET(iflag, ISTRIP); - else - CLR(iflag, ISTRIP); - if (!ISSET(flags, RAW|LITOUT)) - SET(oflag, OPOST); - else - CLR(oflag, OPOST); - } else { - CLR(cflag, CSIZE); - SET(cflag, CS7); - if (ISSET(iflag, IUCLC) && ISSET(oflag, OLCUC)) - SET(cflag, XCASE); - SET(iflag, ISTRIP); - SET(oflag, OPOST); - } - - t->c_iflag = iflag; - t->c_oflag = oflag; - t->c_lflag = lflag; - t->c_cflag = cflag; -} - -void -ttcompatsetlflags(struct tty *tp, struct termios *t) -{ - int flags = tp->t_flags; - tcflag_t iflag = t->c_iflag; - tcflag_t oflag = t->c_oflag; - tcflag_t lflag = t->c_lflag; - tcflag_t cflag = t->c_cflag; - - /* Nothing we can do with CRTBS. */ - if (ISSET(flags, PRTERA)) - SET(lflag, ECHOPRT); - else - CLR(lflag, ECHOPRT); - if (ISSET(flags, CRTERA)) - SET(lflag, ECHOE); - else - CLR(lflag, ECHOE); - /* Nothing we can do with TILDE. */ - if (ISSET(flags, MDMBUF)) - SET(cflag, MDMBUF); - else - CLR(cflag, MDMBUF); - if (ISSET(flags, NOHANG)) - CLR(cflag, HUPCL); - else - SET(cflag, HUPCL); - if (ISSET(flags, CRTKIL)) - SET(lflag, ECHOKE); - else - CLR(lflag, ECHOKE); - if (ISSET(flags, CTLECH)) - SET(lflag, ECHOCTL); - else - CLR(lflag, ECHOCTL); - if (!ISSET(flags, DECCTQ)) - SET(iflag, IXANY); - else - CLR(iflag, IXANY); - if (ISSET(flags, LCASE)) { - SET(oflag, OLCUC); - SET(iflag, IUCLC); - SET(cflag, XCASE); - } - CLR(lflag, TOSTOP|FLUSHO|PENDIN|NOFLSH); - SET(lflag, ISSET(flags, TOSTOP|FLUSHO|PENDIN|NOFLSH)); - - if (ISSET(flags, RAW|LITOUT|PASS8)) { - CLR(cflag, CSIZE); - SET(cflag, CS8); - if (!ISSET(flags, RAW|PASS8)) - SET(iflag, ISTRIP); - else - CLR(iflag, ISTRIP); - if (!ISSET(flags, RAW|LITOUT)) - SET(oflag, OPOST); - else { - CLR(oflag, OPOST); - CLR(cflag, XCASE); - } - } else { - CLR(cflag, CSIZE); - SET(cflag, CS7); - SET(iflag, ISTRIP); - SET(oflag, OPOST); - if (ISSET(oflag, OLCUC) && ISSET(iflag, IUCLC)) - SET(cflag, XCASE); - } - - t->c_iflag = iflag; - t->c_oflag = oflag; - t->c_lflag = lflag; - t->c_cflag = cflag; -} -#endif /* COMPAT_OLDTTY */ diff --git a/sys/conf/files b/sys/conf/files index 7284beac2ab..5d0bd09dece 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1,4 +1,4 @@ -# $OpenBSD: files,v 1.562 2013/11/11 09:15:34 mpi Exp $ +# $OpenBSD: files,v 1.563 2013/12/13 19:55:12 naddy Exp $ # $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 @@ -999,7 +999,6 @@ file net/pfkeyv2_convert.c key | ipsec | tcp_signature # COMPAT_* support code (base and other shared code) file compat/common/compat_util.c !small_kernel file compat/common/compat_dir.c !small_kernel & compat_linux -file compat/common/tty_43.c compat_43 # libx86emu file dev/x86emu/x86emu.c x86emu diff --git a/sys/ddb/db_structinfo.c b/sys/ddb/db_structinfo.c index e0f9b06199c..13fc16dedb8 100644 --- a/sys/ddb/db_structinfo.c +++ b/sys/ddb/db_structinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_structinfo.c,v 1.6 2013/03/15 09:10:52 ratchov Exp $ */ +/* $OpenBSD: db_structinfo.c,v 1.7 2013/12/13 19:55:12 naddy Exp $ */ /* public domain */ /* * This file is intended to be compiled with debug information, @@ -80,7 +80,6 @@ #include <sys/tprintf.h> #include <sys/tree.h> #include <sys/tty.h> -#include <sys/ttydev.h> #include <sys/ucred.h> #include <sys/uio.h> #include <sys/un.h> diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 8248643322b..d46d29a1a7b 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.102 2013/10/11 12:44:12 millert Exp $ */ +/* $OpenBSD: tty.c,v 1.103 2013/12/13 19:55:12 naddy Exp $ */ /* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */ /*- @@ -183,9 +183,6 @@ ttyopen(dev_t device, struct tty *tp, struct proc *p) SET(tp->t_state, TS_ISOPEN); bzero(&tp->t_winsize, sizeof(tp->t_winsize)); tp->t_column = 0; -#ifdef COMPAT_OLDTTY - tp->t_flags = 0; -#endif } CLR(tp->t_state, TS_WOPEN); splx(s); @@ -740,16 +737,6 @@ ttioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p) case TIOCSTAT: case TIOCSTI: case TIOCSWINSZ: -#ifdef COMPAT_OLDTTY - case TIOCLBIC: - case TIOCLBIS: - case TIOCLSET: - case TIOCSETC: - case OTIOCSETD: - case TIOCSETN: - case TIOCSETP: - case TIOCSLTC: -#endif while (isbackground(pr, tp) && (pr->ps_flags & PS_PPWAIT) == 0 && (p->p_sigacts->ps_sigignore & sigmask(SIGTTOU)) == 0 && @@ -1041,11 +1028,7 @@ ttioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p) break; } default: -#ifdef COMPAT_OLDTTY - return (ttcompat(tp, cmd, data, flag, p)); -#else return (-1); -#endif } return (0); } diff --git a/sys/kern/tty_conf.c b/sys/kern/tty_conf.c index 2b88bb4521c..f63ef7e6d2d 100644 --- a/sys/kern/tty_conf.c +++ b/sys/kern/tty_conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_conf.c,v 1.16 2010/06/29 19:09:12 tedu Exp $ */ +/* $OpenBSD: tty_conf.c,v 1.17 2013/12/13 19:55:12 naddy Exp $ */ /* $NetBSD: tty_conf.c,v 1.18 1996/05/19 17:17:55 jonathan Exp $ */ /*- @@ -103,8 +103,9 @@ struct linesw linesw[] = { ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl, ttyerrinput, ttyerrstart, nullmodem }, /* 1- defunct */ - { ttyopen, ttylclose, ttread, ttwrite, nullioctl, - ttyinput, ttstart, ttymodem }, /* 2- old NTTYDISC */ + /* 2- old NTTYDISC (defunct) */ + { ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl, + ttyerrinput, ttyerrstart, nullmodem }, /* 3- TABLDISC (defunct) */ { ttynodisc, ttyerrclose, ttyerrio, ttyerrio, nullioctl, diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 1346ef36971..2b4ba3c9155 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_pty.c,v 1.62 2013/10/11 12:44:13 millert Exp $ */ +/* $OpenBSD: tty_pty.c,v 1.63 2013/12/13 19:55:12 naddy Exp $ */ /* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */ /* @@ -833,10 +833,6 @@ ptyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) ttyflush(tp, FREAD|FWRITE); return (0); -#ifdef COMPAT_OLDTTY - case TIOCSETP: - case TIOCSETN: -#endif case TIOCSETD: case TIOCSETA: case TIOCSETAW: @@ -886,15 +882,6 @@ ptyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) case TIOCSETA: case TIOCSETAW: case TIOCSETAF: -#ifdef COMPAT_OLDTTY - case TIOCSETP: - case TIOCSETN: - case TIOCSETC: - case TIOCSLTC: - case TIOCLBIS: - case TIOCLBIC: - case TIOCLSET: -#endif pti->pt_send |= TIOCPKT_IOCTL; ptcwakeup(tp, FREAD); default: diff --git a/sys/sys/ioctl.h b/sys/sys/ioctl.h index 757e9d59562..a9db3153a95 100644 --- a/sys/sys/ioctl.h +++ b/sys/sys/ioctl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ioctl.h,v 1.13 2011/07/04 22:53:53 tedu Exp $ */ +/* $OpenBSD: ioctl.h,v 1.14 2013/12/13 19:55:12 naddy Exp $ */ /* $NetBSD: ioctl.h,v 1.20 1996/01/30 18:21:47 thorpej Exp $ */ /*- @@ -71,13 +71,6 @@ __END_DECLS #endif /* !_KERNEL */ #endif /* !_SYS_IOCTL_H_ */ -/* - * Keep outside _SYS_IOCTL_H_ - * Compatibility with old terminal driver - * - * Source level -> #define USE_OLD_TTY - * Kernel level -> options COMPAT_43 or ... - */ -#if defined(USE_OLD_TTY) || defined(COMPAT_43) || defined(COMPAT_LINUX) +#if defined(COMPAT_LINUX) #include <sys/ioctl_compat.h> #endif diff --git a/sys/sys/ioctl_compat.h b/sys/sys/ioctl_compat.h index 7eccaacd993..7534b9ca9eb 100644 --- a/sys/sys/ioctl_compat.h +++ b/sys/sys/ioctl_compat.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ioctl_compat.h,v 1.4 2003/06/02 23:28:21 millert Exp $ */ +/* $OpenBSD: ioctl_compat.h,v 1.5 2013/12/13 19:55:12 naddy Exp $ */ /* $NetBSD: ioctl_compat.h,v 1.10 1995/03/31 03:10:15 christos Exp $ */ /* @@ -40,131 +40,6 @@ #ifndef _SYS_IOCTL_COMPAT_H_ #define _SYS_IOCTL_COMPAT_H_ -#include <sys/ttychars.h> -#include <sys/ttydev.h> - -struct tchars { - char t_intrc; /* interrupt */ - char t_quitc; /* quit */ - char t_startc; /* start output */ - char t_stopc; /* stop output */ - char t_eofc; /* end-of-file */ - char t_brkc; /* input delimiter (like nl) */ -}; - -struct ltchars { - char t_suspc; /* stop process signal */ - char t_dsuspc; /* delayed stop process signal */ - char t_rprntc; /* reprint line */ - char t_flushc; /* flush output (toggles) */ - char t_werasc; /* word erase */ - char t_lnextc; /* literal next character */ -}; - -/* - * Structure for TIOCGETP and TIOCSETP ioctls. - */ -#ifndef _SGTTYB_ -#define _SGTTYB_ -struct sgttyb { - char sg_ispeed; /* input speed */ - char sg_ospeed; /* output speed */ - char sg_erase; /* erase character */ - char sg_kill; /* kill character */ - short sg_flags; /* mode flags */ -}; -#endif - -#ifdef USE_OLD_TTY -# undef TIOCGETD -# define TIOCGETD _IOR('t', 0, int) /* get line discipline */ -# undef TIOCSETD -# define TIOCSETD _IOW('t', 1, int) /* set line discipline */ -#else -# define OTIOCGETD _IOR('t', 0, int) /* get line discipline */ -# define OTIOCSETD _IOW('t', 1, int) /* set line discipline */ -#endif -#define TIOCHPCL _IO('t', 2) /* hang up on last close */ -#define TIOCGETP _IOR('t', 8,struct sgttyb)/* get parameters -- gtty */ -#define TIOCSETP _IOW('t', 9,struct sgttyb)/* set parameters -- stty */ -#define TIOCSETN _IOW('t',10,struct sgttyb)/* as above, but no flushtty*/ -#define TIOCSETC _IOW('t',17,struct tchars)/* set special characters */ -#define TIOCGETC _IOR('t',18,struct tchars)/* get special characters */ -#define TANDEM 0x00000001 /* send stopc on out q full */ -#define CBREAK 0x00000002 /* half-cooked mode */ -#define LCASE 0x00000004 /* simulate lower case */ -#define ECHO 0x00000008 /* echo input */ -#define CRMOD 0x00000010 /* map \r to \r\n on output */ -#define RAW 0x00000020 /* no i/o processing */ -#define ODDP 0x00000040 /* get/send odd parity */ -#define EVENP 0x00000080 /* get/send even parity */ -#define ANYP 0x000000c0 /* get any parity/send none */ -#define NLDELAY 0x00000300 /* \n delay */ -#define NL0 0x00000000 -#define NL1 0x00000100 /* tty 37 */ -#define NL2 0x00000200 /* vt05 */ -#define NL3 0x00000300 -#define TBDELAY 0x00000c00 /* horizontal tab delay */ -#define TAB0 0x00000000 -#define TAB1 0x00000400 /* tty 37 */ -#define TAB2 0x00000800 -#define XTABS 0x00000c00 /* expand tabs on output */ -#define CRDELAY 0x00003000 /* \r delay */ -#define CR0 0x00000000 -#define CR1 0x00001000 /* tn 300 */ -#define CR2 0x00002000 /* tty 37 */ -#define CR3 0x00003000 /* concept 100 */ -#define VTDELAY 0x00004000 /* vertical tab delay */ -#define FF0 0x00000000 -#define FF1 0x00004000 /* tty 37 */ -#define BSDELAY 0x00008000 /* \b delay */ -#define BS0 0x00000000 -#define BS1 0x00008000 -#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY) -#define CRTBS 0x00010000 /* do backspacing for crt */ -#define PRTERA 0x00020000 /* \ ... / erase */ -#define CRTERA 0x00040000 /* " \b " to wipe out char */ -#define TILDE 0x00080000 /* hazeltine tilde kludge */ -#define MDMBUF 0x00100000 /*start/stop output on carrier*/ -#define LITOUT 0x00200000 /* literal output */ -#define TOSTOP 0x00400000 /*SIGSTOP on background output*/ -#define FLUSHO 0x00800000 /* flush output to terminal */ -#define NOHANG 0x01000000 /* (no-op) was no SIGHUP on carrier drop */ -#define L001000 0x02000000 -#define CRTKIL 0x04000000 /* kill line with " \b " */ -#define PASS8 0x08000000 -#define CTLECH 0x10000000 /* echo control chars as ^X */ -#define PENDIN 0x20000000 /* tp->t_rawq needs reread */ -#define DECCTQ 0x40000000 /* only ^Q starts after ^S */ -#define NOFLSH 0x80000000 /* no output flush on signal */ -#define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */ -#define TIOCLBIC _IOW('t', 126, int) /* bic local mode bits */ -#define TIOCLSET _IOW('t', 125, int) /* set entire local mode word */ -#define TIOCLGET _IOR('t', 124, int) /* get local modes */ -#define LCRTBS (CRTBS>>16) -#define LPRTERA (PRTERA>>16) -#define LCRTERA (CRTERA>>16) -#define LTILDE (TILDE>>16) -#define LMDMBUF (MDMBUF>>16) -#define LLITOUT (LITOUT>>16) -#define LTOSTOP (TOSTOP>>16) -#define LFLUSHO (FLUSHO>>16) -#define LNOHANG (NOHANG>>16) -#define LCRTKIL (CRTKIL>>16) -#define LPASS8 (PASS8>>16) -#define LCTLECH (CTLECH>>16) -#define LPENDIN (PENDIN>>16) -#define LDECCTQ (DECCTQ>>16) -#define LNOFLSH (NOFLSH>>16) -#define TIOCSLTC _IOW('t',117,struct ltchars)/* set local special chars*/ -#define TIOCGLTC _IOR('t',116,struct ltchars)/* get local special chars*/ -#define OTIOCCONS _IO('t', 98) /* for hp300 -- sans int arg */ -#define OTTYDISC 0 -#define NETLDISC 1 -#define NTTYDISC 2 - -#define TIOCGSID _IOR('t', 99, int) /* For svr4 -- get session id */ - /* * Passthrough ioctl commands. These are passed through to devices * as they are, it is expected that the device (an LKM, for example), diff --git a/sys/sys/tty.h b/sys/sys/tty.h index c8d5e378737..6655ab0065c 100644 --- a/sys/sys/tty.h +++ b/sys/sys/tty.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.h,v 1.32 2013/01/17 21:24:58 deraadt Exp $ */ +/* $OpenBSD: tty.h,v 1.33 2013/12/13 19:55:12 naddy Exp $ */ /* $NetBSD: tty.h,v 1.30.4.1 1996/06/02 09:08:13 mrg Exp $ */ /*- @@ -308,9 +308,4 @@ int cttypoll(dev_t, int, struct proc *); void clalloc(struct clist *, int, int); void clfree(struct clist *); -#if defined(COMPAT_43) -# define COMPAT_OLDTTY -int ttcompat(struct tty *, u_long, caddr_t, int, struct proc *); -#endif - #endif diff --git a/sys/sys/ttychars.h b/sys/sys/ttychars.h deleted file mode 100644 index 297e4033078..00000000000 --- a/sys/sys/ttychars.h +++ /dev/null @@ -1,62 +0,0 @@ -/* $OpenBSD: ttychars.h,v 1.3 2003/06/02 23:28:22 millert Exp $ */ -/* $NetBSD: ttychars.h,v 1.6 1994/06/29 06:45:54 cgd Exp $ */ - -/*- - * Copyright (c) 1982, 1986, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)ttychars.h 8.2 (Berkeley) 1/4/94 - */ - -/* - * 4.3 COMPATIBILITY FILE - * - * User visible structures and constants related to terminal handling. - */ -#ifndef _SYS_TTYCHARS_H_ -#define _SYS_TTYCHARS_H_ - -struct ttychars { - char tc_erase; /* erase last character */ - char tc_kill; /* erase entire line */ - char tc_intrc; /* interrupt */ - char tc_quitc; /* quit */ - char tc_startc; /* start output */ - char tc_stopc; /* stop output */ - char tc_eofc; /* end-of-file */ - char tc_brkc; /* input delimiter (like nl) */ - char tc_suspc; /* stop process signal */ - char tc_dsuspc; /* delayed stop process signal */ - char tc_rprntc; /* reprint line */ - char tc_flushc; /* flush output (toggles) */ - char tc_werasc; /* word erase */ - char tc_lnextc; /* literal next character */ -}; -#ifdef USE_OLD_TTY -#include <sys/ttydefaults.h> /* to pick up character defaults */ -#endif -#endif /* !_SYS_TTYCHARS_H_ */ diff --git a/sys/sys/ttydev.h b/sys/sys/ttydev.h deleted file mode 100644 index 9d33505db20..00000000000 --- a/sys/sys/ttydev.h +++ /dev/null @@ -1,61 +0,0 @@ -/* $OpenBSD: ttydev.h,v 1.4 2003/06/02 23:28:22 millert Exp $ */ -/* $NetBSD: ttydev.h,v 1.7 1994/06/29 06:45:58 cgd Exp $ */ - -/*- - * Copyright (c) 1982, 1986, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)ttydev.h 8.2 (Berkeley) 1/4/94 - */ - -/* COMPATIBILITY HEADER FILE */ - -#ifndef _SYS_TTYDEV_H_ -#define _SYS_TTYDEV_H_ - -#ifdef USE_OLD_TTY -#define B0 0 -#define B50 1 -#define B75 2 -#define B110 3 -#define B134 4 -#define B150 5 -#define B200 6 -#define B300 7 -#define B600 8 -#define B1200 9 -#define B1800 10 -#define B2400 11 -#define B4800 12 -#define B9600 13 -#define EXTA 14 -#define EXTB 15 -#define B57600 16 -#define B115200 17 -#endif /* USE_OLD_TTY */ - -#endif /* !_SYS_TTYDEV_H_ */ |