summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2006-01-10 09:19:10 +0000
committerphk <phk@FreeBSD.org>2006-01-10 09:19:10 +0000
commit57be8af6424fe98a84058dd0712eaa9b9e111185 (patch)
treeba38ab39bf9faead06889887180608022ca1f910 /sys
parent102c8af8288f3384264c77b191aaff70b5806f29 (diff)
downloadFreeBSD-src-57be8af6424fe98a84058dd0712eaa9b9e111185.zip
FreeBSD-src-57be8af6424fe98a84058dd0712eaa9b9e111185.tar.gz
Move the old BSD4.3 tty compatibility from (!BURN_BRIDGES && COMPAT_43)
to COMPAT_43TTY. Add COMPAT_43TTY to NOTES and */conf/GENERIC Compile tty_compat.c only under the new option. Spit out #warning "Old BSD tty API used, please upgrade." if ioctl_compat.h gets #included from userland.
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/conf/GENERIC1
-rw-r--r--sys/amd64/conf/GENERIC1
-rw-r--r--sys/conf/NOTES3
-rw-r--r--sys/conf/files2
-rw-r--r--sys/conf/options1
-rw-r--r--sys/i386/conf/GENERIC1
-rw-r--r--sys/ia64/conf/GENERIC1
-rw-r--r--sys/kern/tty.c14
-rw-r--r--sys/kern/tty_compat.c5
-rw-r--r--sys/kern/tty_pty.c12
-rw-r--r--sys/pc98/conf/GENERIC1
-rw-r--r--sys/powerpc/conf/GENERIC1
-rw-r--r--sys/sparc64/conf/GENERIC1
-rw-r--r--sys/sys/ioctl.h4
-rw-r--r--sys/sys/ioctl_compat.h6
-rw-r--r--sys/sys/ttychars.h4
-rw-r--r--sys/sys/ttydev.h4
17 files changed, 24 insertions, 38 deletions
diff --git a/sys/alpha/conf/GENERIC b/sys/alpha/conf/GENERIC
index 35a1e88..83f66dd 100644
--- a/sys/alpha/conf/GENERIC
+++ b/sys/alpha/conf/GENERIC
@@ -61,6 +61,7 @@ options PROCFS # Process filesystem (requires PSEUDOFS)
options PSEUDOFS # Pseudo-filesystem framework
options GEOM_GPT # GUID Partition Tables.
options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!]
+options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!]
options COMPAT_FREEBSD4 # Compatible with FreeBSD4
options COMPAT_FREEBSD5 # Compatible with FreeBSD5
options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI
diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC
index af3c8a5..eec2e6c 100644
--- a/sys/amd64/conf/GENERIC
+++ b/sys/amd64/conf/GENERIC
@@ -46,6 +46,7 @@ options PROCFS # Process filesystem (requires PSEUDOFS)
options PSEUDOFS # Pseudo-filesystem framework
options GEOM_GPT # GUID Partition Tables.
options COMPAT_43 # Needed by COMPAT_LINUX32
+options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!]
options COMPAT_IA32 # Compatible with i386 binaries
options COMPAT_FREEBSD4 # Compatible with FreeBSD4
options COMPAT_FREEBSD5 # Compatible with FreeBSD5
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index a6e9483..a7fcd47 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -256,6 +256,9 @@ options TURNSTILE_PROFILING
#
options COMPAT_43
+# Old tty interface.
+options COMPAT_43TTY
+
# Enable FreeBSD4 compatibility syscalls
options COMPAT_FREEBSD4
diff --git a/sys/conf/files b/sys/conf/files
index 8b53f61..246c25d 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1330,7 +1330,7 @@ kern/sysv_msg.c optional sysvmsg
kern/sysv_sem.c optional sysvsem
kern/sysv_shm.c optional sysvshm
kern/tty.c standard
-kern/tty_compat.c standard
+kern/tty_compat.c optional compat_43tty
kern/tty_conf.c standard
kern/tty_cons.c standard
kern/tty_pty.c optional pty
diff --git a/sys/conf/options b/sys/conf/options
index 3ed3901..41b67d1 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -62,6 +62,7 @@ NO_ADAPTIVE_MUTEXES opt_adaptive_mutexes.h
ALQ
CODA_COMPAT_5 opt_coda.h
COMPAT_43 opt_compat.h
+COMPAT_43TTY opt_compat.h
COMPAT_FREEBSD4 opt_compat.h
COMPAT_FREEBSD5 opt_compat.h
COMPILING_LINT opt_global.h
diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC
index 2e5f546..6116c2f 100644
--- a/sys/i386/conf/GENERIC
+++ b/sys/i386/conf/GENERIC
@@ -47,6 +47,7 @@ options PROCFS # Process filesystem (requires PSEUDOFS)
options PSEUDOFS # Pseudo-filesystem framework
options GEOM_GPT # GUID Partition Tables.
options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!]
+options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!]
options COMPAT_FREEBSD4 # Compatible with FreeBSD4
options COMPAT_FREEBSD5 # Compatible with FreeBSD5
options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI
diff --git a/sys/ia64/conf/GENERIC b/sys/ia64/conf/GENERIC
index 0c77673..2067a81 100644
--- a/sys/ia64/conf/GENERIC
+++ b/sys/ia64/conf/GENERIC
@@ -27,6 +27,7 @@ makeoptions DEBUG=-g # Build kernel with debug information.
options CD9660 # ISO 9660 Filesystem
options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!]
+options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!]
options COMPAT_FREEBSD5 # Compatible with FreeBSD5
options DDB # Support DDB
options FFS # Berkeley Fast Filesystem
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 363c31c..f5b7d91 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -83,11 +83,9 @@ __FBSDID("$FreeBSD$");
#include <sys/mutex.h>
#include <sys/namei.h>
#include <sys/sx.h>
-#ifndef BURN_BRIDGES
-#if defined(COMPAT_43)
+#if defined(COMPAT_43TTY)
#include <sys/ioctl_compat.h>
#endif
-#endif
#include <sys/proc.h>
#define TTYDEFCHARS
#include <sys/tty.h>
@@ -828,8 +826,7 @@ ttioctl(struct tty *tp, u_long cmd, void *data, int flag)
case TIOCSTI:
case TIOCSTOP:
case TIOCSWINSZ:
-#ifndef BURN_BRIDGES
-#if defined(COMPAT_43)
+#if defined(COMPAT_43TTY)
case TIOCLBIC:
case TIOCLBIS:
case TIOCLSET:
@@ -839,7 +836,6 @@ ttioctl(struct tty *tp, u_long cmd, void *data, int flag)
case TIOCSETP:
case TIOCSLTC:
#endif
-#endif
sx_slock(&proctree_lock);
PROC_LOCK(p);
while (isbackground(p, tp) && !(p->p_flag & P_PPWAIT) &&
@@ -1255,15 +1251,11 @@ ttioctl(struct tty *tp, u_long cmd, void *data, int flag)
case TIOCCBRK:
return (tt_break(tp, 0));
default:
-#if defined(COMPAT_43)
-#ifndef BURN_BRIDGES
+#if defined(COMPAT_43TTY)
return (ttcompat(tp, cmd, data, flag));
#else
return (ENOIOCTL);
#endif
-#else
- return (ENOIOCTL);
-#endif
}
return (0);
}
diff --git a/sys/kern/tty_compat.c b/sys/kern/tty_compat.c
index 0ec1926..4e2c16f 100644
--- a/sys/kern/tty_compat.c
+++ b/sys/kern/tty_compat.c
@@ -34,11 +34,9 @@ __FBSDID("$FreeBSD$");
#include "opt_compat.h"
-#ifndef BURN_BRIDGES
/*
* mapping routines for old line discipline (yuck)
*/
-#if defined(COMPAT_43)
#include <sys/param.h>
#include <sys/systm.h>
@@ -471,6 +469,3 @@ ttcompatsetlflags(struct tty *tp, struct termios *t)
t->c_lflag = lflag;
t->c_cflag = cflag;
}
-#endif /* COMPAT_43 */
-
-#endif /* BURN_BRIDGES */
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index e4487ef..2fdab73 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -43,11 +43,9 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/sx.h>
-#ifndef BURN_BRIDGES
-#if defined(COMPAT_43)
+#if defined(COMPAT_43TTY)
#include <sys/ioctl_compat.h>
#endif
-#endif
#include <sys/proc.h>
#include <sys/tty.h>
#include <sys/conf.h>
@@ -553,12 +551,10 @@ ptcioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td
return (EAGAIN);
switch (cmd) {
-#ifndef BURN_BRIDGES
-#ifdef COMPAT_43
+#ifdef COMPAT_43TTY
case TIOCSETP:
case TIOCSETN:
#endif
-#endif
case TIOCSETD:
case TIOCSETA:
case TIOCSETAW:
@@ -642,8 +638,7 @@ ptsioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td
case TIOCSETA:
case TIOCSETAW:
case TIOCSETAF:
-#ifndef BURN_BRIDGES
-#ifdef COMPAT_43
+#ifdef COMPAT_43TTY
case TIOCSETP:
case TIOCSETN:
case TIOCSETC:
@@ -652,7 +647,6 @@ ptsioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td
case TIOCLBIC:
case TIOCLSET:
#endif
-#endif
pt->pt_send |= TIOCPKT_IOCTL;
ptcwakeup(tp, FREAD);
break;
diff --git a/sys/pc98/conf/GENERIC b/sys/pc98/conf/GENERIC
index ce46dea..9539b79 100644
--- a/sys/pc98/conf/GENERIC
+++ b/sys/pc98/conf/GENERIC
@@ -47,6 +47,7 @@ options PROCFS # Process filesystem (requires PSEUDOFS)
options PSEUDOFS # Pseudo-filesystem framework
options GEOM_GPT # GUID Partition Tables.
options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!]
+options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!]
options COMPAT_FREEBSD4 # Compatible with FreeBSD4
options COMPAT_FREEBSD5 # Compatible with FreeBSD5
options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI
diff --git a/sys/powerpc/conf/GENERIC b/sys/powerpc/conf/GENERIC
index b0c4213..57d7f88 100644
--- a/sys/powerpc/conf/GENERIC
+++ b/sys/powerpc/conf/GENERIC
@@ -49,6 +49,7 @@ options PROCFS #Process filesystem (requires PSEUDOFS)
options PSEUDOFS #Pseudo-filesystem framework
options GEOM_GPT #GUID Partition Tables.
options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!]
+options COMPAT_43TTY #BSD 4.3 TTY compat [KEEP THIS!]
options COMPAT_FREEBSD4 #Keep this for a while
options COMPAT_FREEBSD5 #Keep this for a while
options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI
diff --git a/sys/sparc64/conf/GENERIC b/sys/sparc64/conf/GENERIC
index ac566ce..dad94b5 100644
--- a/sys/sparc64/conf/GENERIC
+++ b/sys/sparc64/conf/GENERIC
@@ -50,6 +50,7 @@ options PROCFS # Process filesystem (requires PSEUDOFS)
options PSEUDOFS # Pseudo-filesystem framework
options GEOM_GPT # GUID Partition Tables.
options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!]
+options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!]
options COMPAT_FREEBSD5 # Compatible with FreeBSD5
options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI
options KTRACE # ktrace(1) support
diff --git a/sys/sys/ioctl.h b/sys/sys/ioctl.h
index fd54f6d..7abb328 100644
--- a/sys/sys/ioctl.h
+++ b/sys/sys/ioctl.h
@@ -75,8 +75,8 @@ struct ttysize {
* Compatibility with old terminal driver
*
* Source level -> #define USE_OLD_TTY
- * Kernel level -> options COMPAT_43
+ * Kernel level -> options COMPAT_43TTY
*/
-#if defined(USE_OLD_TTY) || defined(COMPAT_43)
+#if defined(USE_OLD_TTY) || defined(COMPAT_43TTY)
#include <sys/ioctl_compat.h>
#endif
diff --git a/sys/sys/ioctl_compat.h b/sys/sys/ioctl_compat.h
index bdd2957..0541536 100644
--- a/sys/sys/ioctl_compat.h
+++ b/sys/sys/ioctl_compat.h
@@ -38,10 +38,13 @@
#ifndef _SYS_IOCTL_COMPAT_H_
#define _SYS_IOCTL_COMPAT_H_
-#ifndef BURN_BRIDGES
#include <sys/ttychars.h>
#include <sys/ttydev.h>
+#ifdef USE_OLD_TTY
+#warning "Old BSD tty API used, please upgrade"
+#endif
+
struct tchars {
char t_intrc; /* interrupt */
char t_quitc; /* quit */
@@ -162,5 +165,4 @@ struct sgttyb {
#define NETLDISC 1
#define NTTYDISC 2
-#endif /* BURN_BRIDGES */
#endif /* !_SYS_IOCTL_COMPAT_H_ */
diff --git a/sys/sys/ttychars.h b/sys/sys/ttychars.h
index 67d69e5..56a55d4 100644
--- a/sys/sys/ttychars.h
+++ b/sys/sys/ttychars.h
@@ -33,8 +33,6 @@
#ifndef _SYS_TTYCHARS_H_
#define _SYS_TTYCHARS_H_
-#ifndef BURN_BRIDGES
-
/*
* 4.3 COMPATIBILITY FILE
*
@@ -61,6 +59,4 @@ struct ttychars {
#include <sys/ttydefaults.h> /* to pick up character defaults */
#endif
-#endif /* BURN_BRIDGES */
-
#endif /* !_SYS_TTYCHARS_H_ */
diff --git a/sys/sys/ttydev.h b/sys/sys/ttydev.h
index f6e3791..d6d6b4c 100644
--- a/sys/sys/ttydev.h
+++ b/sys/sys/ttydev.h
@@ -35,8 +35,6 @@
#ifndef _SYS_TTYDEV_H_
#define _SYS_TTYDEV_H_
-#ifndef BURN_BRIDGES
-
#ifdef USE_OLD_TTY
#define B0 0
#define B50 1
@@ -61,6 +59,4 @@
#define B921600 20
#endif /* USE_OLD_TTY */
-#endif /* BURN_BRIDGES */
-
#endif /* !_SYS_TTYDEV_H_ */
OpenPOWER on IntegriCloud