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.
This commit is contained in:
Poul-Henning Kamp 2006-01-10 09:19:10 +00:00
parent c02b454deb
commit d3e64681d6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154170
17 changed files with 24 additions and 38 deletions

View File

@ -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

View File

@ -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

View File

@ -256,6 +256,9 @@ options TURNSTILE_PROFILING
#
options COMPAT_43
# Old tty interface.
options COMPAT_43TTY
# Enable FreeBSD4 compatibility syscalls
options COMPAT_FREEBSD4

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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:
@ -838,7 +835,6 @@ ttioctl(struct tty *tp, u_long cmd, void *data, int flag)
case TIOCSETN:
case TIOCSETP:
case TIOCSLTC:
#endif
#endif
sx_slock(&proctree_lock);
PROC_LOCK(p);
@ -1255,12 +1251,8 @@ 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

View File

@ -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 */

View File

@ -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,11 +551,9 @@ 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:
@ -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:
@ -651,7 +646,6 @@ ptsioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td
case TIOCLBIS:
case TIOCLBIC:
case TIOCLSET:
#endif
#endif
pt->pt_send |= TIOCPKT_IOCTL;
ptcwakeup(tp, FREAD);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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_ */

View File

@ -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_ */

View File

@ -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_ */