1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Put the pre FreeBSD-2.x tty compat code under BURN_BRIDGES.

This commit is contained in:
Poul-Henning Kamp 2004-06-21 22:57:16 +00:00
parent 139233cbd6
commit ec66f15d14
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130892
16 changed files with 73 additions and 2 deletions

View File

@ -119,10 +119,12 @@ svr4_sys_ioctl(td, uap)
#endif
switch (cmd & 0xff00) {
#ifndef BURN_BRIDGES
case SVR4_tIOC:
DPRINTF(("ttold\n"));
fun = svr4_ttold_ioctl;
break;
#endif
case SVR4_TIOC:
DPRINTF(("term\n"));

View File

@ -29,6 +29,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef BURN_BRIDGES
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/systm.h>
@ -376,3 +378,5 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data)
return 0; /* ENOSYS really */
}
}
#endif /* BURN_BRIDGES */

View File

@ -1539,9 +1539,11 @@ sioioctl(dev, cmd, data, flag, td)
int mynor;
int s;
struct tty *tp;
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
int oldcmd;
struct termios term;
#endif
#endif
mynor = minor(dev);
@ -1580,6 +1582,7 @@ sioioctl(dev, cmd, data, flag, td)
}
}
tp = com->tp;
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
term = tp->t_termios;
oldcmd = cmd;
@ -1588,6 +1591,7 @@ sioioctl(dev, cmd, data, flag, td)
return (error);
if (cmd != oldcmd)
data = (caddr_t)&term;
#endif
#endif
if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) {
int cc;

View File

@ -1072,9 +1072,11 @@ digiioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t
struct digi_softc *sc;
struct digi_p *port;
struct tty *tp;
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
int oldcmd;
struct termios term;
#endif
#endif
mynor = minor(dev);
@ -1226,6 +1228,7 @@ digiioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t
}
tp = port->tp;
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
term = tp->t_termios;
oldcmd = cmd;
@ -1234,6 +1237,7 @@ digiioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t
return (error);
if (cmd != oldcmd)
data = (caddr_t) & term;
#endif
#endif
if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) {
int cc;

View File

@ -1241,9 +1241,11 @@ rpioctl(dev, cmd, data, flag, td)
int error = 0;
int arg, flags, result, ChanStatus;
struct termios *t;
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
u_long oldcmd;
struct termios term;
#endif
#endif
umynor = (((minor(dev) >> 16) -1) * 32); /* SG */
@ -1289,6 +1291,7 @@ rpioctl(dev, cmd, data, flag, td)
tp = rp->rp_tty;
cp = &rp->rp_channel;
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
term = tp->t_termios;
oldcmd = cmd;
@ -1298,6 +1301,7 @@ rpioctl(dev, cmd, data, flag, td)
if(cmd != oldcmd) {
data = (caddr_t)&term;
}
#endif
#endif
if((cmd == TIOCSETA) || (cmd == TIOCSETAW) || (cmd == TIOCSETAF)) {
int cc;

View File

@ -47,9 +47,11 @@ static const char si_copyright1[] = "@(#) Copyright (C) Specialix International
#include <sys/param.h>
#include <sys/systm.h>
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
#include <sys/ioctl_compat.h>
#endif
#endif
#include <sys/tty.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
@ -915,9 +917,11 @@ siioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
int mynor = minor(dev);
int oldspl;
int blocked = 0;
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
u_long oldcmd;
struct termios term;
#endif
#endif
if (IS_SI_IOCTL(cmd))
@ -964,6 +968,7 @@ siioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
/*
* Do the old-style ioctl compat routines...
*/
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
term = tp->t_termios;
oldcmd = cmd;
@ -972,6 +977,7 @@ siioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
return (error);
if (cmd != oldcmd)
data = (caddr_t)&term;
#endif
#endif
/*
* Do the initial / lock state business
@ -1008,8 +1014,10 @@ siioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
case TIOCSETAW:
case TIOCSETAF:
case TIOCDRAIN:
#ifndef BURN_BRIDGES
#ifdef COMPAT_43
case TIOCSETP:
#endif
#endif
blocked++; /* block writes for ttywait() and siparam() */
si_write_enable(pp, 0);

View File

@ -2065,9 +2065,11 @@ sioioctl(dev, cmd, data, flag, td)
int mynor;
int s;
struct tty *tp;
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
u_long oldcmd;
struct termios term;
#endif
#endif
mynor = minor(dev);
@ -2075,6 +2077,7 @@ sioioctl(dev, cmd, data, flag, td)
if (com == NULL || com->gone)
return (ENODEV);
tp = com->tp;
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
term = tp->t_termios;
oldcmd = cmd;
@ -2083,6 +2086,7 @@ sioioctl(dev, cmd, data, flag, td)
return (error);
if (cmd != oldcmd)
data = (caddr_t)&term;
#endif
#endif
if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) {
int cc;

View File

@ -35,9 +35,11 @@
#include <sys/param.h>
#include <sys/systm.h>
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
#include <sys/ioctl_compat.h>
#endif
#endif
#include <sys/tty.h>
#include <sys/proc.h>
#include <sys/conf.h>
@ -703,10 +705,12 @@ sxioctl(
int mynor = minor(dev);
int oldspl;
int blocked = 0;
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
u_long oldcmd;
struct termios term;
#endif
#endif
pp = MINOR2PP(mynor);
@ -752,6 +756,7 @@ sxioctl(
/*
* Do the old-style ioctl compat routines...
*/
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
term = tp->t_termios;
oldcmd = cmd;
@ -760,6 +765,7 @@ sxioctl(
return(error);
if (cmd != oldcmd)
data = (caddr_t)&term;
#endif
#endif
/*
* Do the initial / lock state business
@ -796,8 +802,10 @@ sxioctl(
case TIOCSETAW:
case TIOCSETAF:
case TIOCDRAIN:
#ifndef BURN_BRIDGES
#ifdef COMPAT_43
case TIOCSETP:
#endif
#endif
blocked++; /* block writes for ttywait() and sxparam() */
sx_write_enable(pp, 0);

View File

@ -57,6 +57,7 @@ static void stios2stio(struct ibcs2_termios *, struct ibcs2_termio *);
static void stio2stios(struct ibcs2_termio *, struct ibcs2_termios *);
#ifndef BURN_BRIDGES
int
ibcs2_gtty(struct thread *td, struct ibcs2_gtty_args *args)
{
@ -80,6 +81,7 @@ ibcs2_stty(struct thread *td, struct ibcs2_stty_args *args)
return ioctl(td, &ioctl_arg);
}
#endif /* BURN BRIDGES */
/*

View File

@ -48,8 +48,13 @@ struct sysent ibcs2_sysent[] = {
{ AS(ibcs2_fstat_args), (sy_call_t *)ibcs2_fstat }, /* 28 = ibcs2_fstat */
{ SYF_MPSAFE | 0, (sy_call_t *)ibcs2_pause }, /* 29 = ibcs2_pause */
{ AS(ibcs2_utime_args), (sy_call_t *)ibcs2_utime }, /* 30 = ibcs2_utime */
#ifndef BURN_BRIDGES
{ AS(ibcs2_stty_args), (sy_call_t *)ibcs2_stty }, /* 31 = ibcs2_stty */
{ AS(ibcs2_gtty_args), (sy_call_t *)ibcs2_gtty }, /* 32 = ibcs2_gtty */
#else
{ AS(ibcs2_stty_args), (sy_call_t *)nosys }, /* 31 = ibcs2_stty */
{ AS(ibcs2_gtty_args), (sy_call_t *)nosys }, /* 32 = ibcs2_gtty */
#endif
{ AS(ibcs2_access_args), (sy_call_t *)ibcs2_access }, /* 33 = ibcs2_access */
{ SYF_MPSAFE | AS(ibcs2_nice_args), (sy_call_t *)ibcs2_nice }, /* 34 = ibcs2_nice */
{ AS(ibcs2_statfs_args), (sy_call_t *)ibcs2_statfs }, /* 35 = ibcs2_statfs */

View File

@ -83,9 +83,11 @@ __FBSDID("$FreeBSD$");
#include <sys/mutex.h>
#include <sys/namei.h>
#include <sys/sx.h>
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
#include <sys/ioctl_compat.h>
#endif
#endif
#include <sys/proc.h>
#define TTYDEFCHARS
#include <sys/tty.h>
@ -769,6 +771,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)
case TIOCLBIC:
case TIOCLBIS:
@ -778,6 +781,7 @@ 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);
@ -1131,7 +1135,11 @@ ttioctl(struct tty *tp, u_long cmd, void *data, int flag)
break;
default:
#if defined(COMPAT_43)
#ifndef BURN_BRIDGES
return (ttcompat(tp, cmd, data, flag));
#else
return (ENOIOCTL);
#endif
#else
return (ENOIOCTL);
#endif

View File

@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
#include "opt_compat.h"
#ifndef BURN_BRIDGES
/*
* mapping routines for old line discipline (yuck)
*/
@ -471,3 +472,5 @@ ttcompatsetlflags(struct tty *tp, struct termios *t)
t->c_cflag = cflag;
}
#endif /* COMPAT_43 */
#endif /* BURN_BRIDGES */

View File

@ -43,9 +43,11 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/sx.h>
#ifndef BURN_BRIDGES
#if defined(COMPAT_43)
#include <sys/ioctl_compat.h>
#endif
#endif
#include <sys/proc.h>
#include <sys/tty.h>
#include <sys/conf.h>
@ -659,9 +661,11 @@ ptyioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td
return (EAGAIN);
switch (cmd) {
#ifndef BURN_BRIDGES
#ifdef COMPAT_43
case TIOCSETP:
case TIOCSETN:
#endif
#endif
case TIOCSETD:
case TIOCSETA:
@ -734,16 +738,16 @@ ptyioctl(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
case TIOCSETP:
case TIOCSETN:
#endif
#if defined(COMPAT_43)
case TIOCSETC:
case TIOCSLTC:
case TIOCLBIS:
case TIOCLBIC:
case TIOCLSET:
#endif
#endif
pt->pt_send |= TIOCPKT_IOCTL;
ptcwakeup(tp, FREAD);

View File

@ -38,6 +38,7 @@
#ifndef _SYS_IOCTL_COMPAT_H_
#define _SYS_IOCTL_COMPAT_H_
#ifndef BURN_BRIDGES
#include <sys/ttychars.h>
#include <sys/ttydev.h>
@ -161,4 +162,5 @@ struct sgttyb {
#define NETLDISC 1
#define NTTYDISC 2
#endif /* BURN_BRIDGES */
#endif /* !_SYS_IOCTL_COMPAT_H_ */

View File

@ -33,6 +33,8 @@
#ifndef _SYS_TTYCHARS_H_
#define _SYS_TTYCHARS_H_
#ifndef BURN_BRIDGES
/*
* 4.3 COMPATIBILITY FILE
*
@ -58,4 +60,7 @@ struct ttychars {
#ifdef USE_OLD_TTY
#include <sys/ttydefaults.h> /* to pick up character defaults */
#endif
#endif /* BURN_BRIDGES */
#endif /* !_SYS_TTYCHARS_H_ */

View File

@ -35,6 +35,8 @@
#ifndef _SYS_TTYDEV_H_
#define _SYS_TTYDEV_H_
#ifndef BURN_BRIDGES
#ifdef USE_OLD_TTY
#define B0 0
#define B50 1
@ -59,4 +61,6 @@
#define B921600 20
#endif /* USE_OLD_TTY */
#endif /* BURN_BRIDGES */
#endif /* !_SYS_TTYDEV_H_ */