From 57be8af6424fe98a84058dd0712eaa9b9e111185 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 10 Jan 2006 09:19:10 +0000 Subject: 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. --- sys/alpha/conf/GENERIC | 1 + sys/amd64/conf/GENERIC | 1 + sys/conf/NOTES | 3 +++ sys/conf/files | 2 +- sys/conf/options | 1 + sys/i386/conf/GENERIC | 1 + sys/ia64/conf/GENERIC | 1 + sys/kern/tty.c | 14 +++----------- sys/kern/tty_compat.c | 5 ----- sys/kern/tty_pty.c | 12 +++--------- sys/pc98/conf/GENERIC | 1 + sys/powerpc/conf/GENERIC | 1 + sys/sparc64/conf/GENERIC | 1 + sys/sys/ioctl.h | 4 ++-- sys/sys/ioctl_compat.h | 6 ++++-- sys/sys/ttychars.h | 4 ---- sys/sys/ttydev.h | 4 ---- 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 #include #include -#ifndef BURN_BRIDGES -#if defined(COMPAT_43) +#if defined(COMPAT_43TTY) #include #endif -#endif #include #define TTYDEFCHARS #include @@ -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 #include @@ -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 #include #include -#ifndef BURN_BRIDGES -#if defined(COMPAT_43) +#if defined(COMPAT_43TTY) #include #endif -#endif #include #include #include @@ -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 #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 #include +#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 /* 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_ */ -- cgit v1.1