summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ed/if_ed.c17
-rw-r--r--sys/dev/ep/if_ep.c5
-rw-r--r--sys/dev/fdc/fdc.c34
-rw-r--r--sys/dev/ie/if_ie.c3
-rw-r--r--sys/dev/mcd/mcd.c2
-rw-r--r--sys/dev/mse/mse.c10
-rw-r--r--sys/dev/sio/sio.c81
-rw-r--r--sys/dev/syscons/syscons.c41
8 files changed, 90 insertions, 103 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c
index 84047e2..26e3ebd 100644
--- a/sys/dev/ed/if_ed.c
+++ b/sys/dev/ed/if_ed.c
@@ -63,7 +63,7 @@
/* For backwards compatibility */
#ifndef IFF_ALTPHYS
-#define IFF_ALTPHYS IFF_LLC0
+#define IFF_ALTPHYS IFF_LINK0
#endif
/*
@@ -113,7 +113,7 @@ void edintr(int);
int ed_ioctl(struct ifnet *, int, caddr_t);
int ed_probe(struct isa_device *);
void ed_start(struct ifnet *);
-void ed_reset(int, int);
+void ed_reset(int);
void ed_watchdog(int);
static void ed_get_packet(struct ed_softc *, char *, int /*u_short*/);
@@ -1090,9 +1090,8 @@ ed_attach(isa_dev)
* Reset interface.
*/
void
-ed_reset(unit, uban)
+ed_reset(unit)
int unit;
- int uban; /* XXX */
{
int s;
@@ -1147,7 +1146,7 @@ ed_watchdog(unit)
log(LOG_ERR, "ed%d: device timeout\n", unit);
++sc->arpcom.ac_if.if_oerrors;
- ed_reset(unit, 0);
+ ed_reset(unit);
}
/*
@@ -1501,7 +1500,7 @@ outloop:
len = ed_pio_write_mbufs(sc, m, buffer);
}
- sc->txb_len[sc->txb_new] = MAX(len, ETHER_MIN_LEN);
+ sc->txb_len[sc->txb_new] = max(len, ETHER_MIN_LEN);
sc->txb_inuse++;
@@ -1652,7 +1651,7 @@ ed_rint(unit)
"ed%d: NIC memory corrupt - invalid packet length %d\n",
unit, len);
++sc->arpcom.ac_if.if_ierrors;
- ed_reset(unit, 0);
+ ed_reset(unit);
return;
}
@@ -1817,7 +1816,7 @@ edintr(unit)
/*
* Stop/reset/re-init NIC
*/
- ed_reset(unit, 0);
+ ed_reset(unit);
} else {
/*
@@ -2388,7 +2387,7 @@ ed_pio_write_mbufs(sc,m,dst)
if (!maxwait) {
log(LOG_WARNING, "ed%d: remote transmit DMA failed to complete\n",
sc->arpcom.ac_if.if_unit);
- ed_reset(sc->arpcom.ac_if.if_unit, 0);
+ ed_reset(sc->arpcom.ac_if.if_unit);
}
return(len);
diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c
index e8d3112..b47f829 100644
--- a/sys/dev/ep/if_ep.c
+++ b/sys/dev/ep/if_ep.c
@@ -99,7 +99,7 @@ static int epioctl __P((struct ifnet * ifp, int, caddr_t));
void epinit __P((int));
void epintr __P((int));
-void epmbuffill __P((caddr_t, int));
+void epmbuffill __P((caddr_t));
void epmbufempty __P((struct ep_softc *));
void epread __P((struct ep_softc *));
void epreset __P((int));
@@ -953,9 +953,8 @@ is_eeprom_busy(is)
}
void
-epmbuffill(sp, dummy_arg)
+epmbuffill(sp)
caddr_t sp;
- int dummy_arg;
{
struct ep_softc *sc = (struct ep_softc *)sp;
int s, i;
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index d05c361..259d451 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -199,7 +199,7 @@ int fd_debug = 1;
static void fdstart(fdcu_t);
void fdintr(fdcu_t);
-static void fd_turnoff(caddr_t, int);
+static void fd_turnoff(caddr_t);
/****************************************************************************/
/* autoconfiguration stuff */
@@ -347,7 +347,7 @@ fdattach(dev)
break;
}
- fd_turnoff((caddr_t)fdu, 0);
+ fd_turnoff((caddr_t)fdu);
hdr = 1;
}
printf("\n");
@@ -417,7 +417,7 @@ void fdstrategy(struct buf *bp)
dp = &(fdc->head);
s = splbio();
disksort(dp, bp);
- untimeout(fd_turnoff, (caddr_t)fdu); /* a good idea */
+ untimeout((timeout_func_t)fd_turnoff, (caddr_t)fdu); /* a good idea */
fdstart(fdcu);
splx(s);
return;
@@ -463,7 +463,7 @@ set_motor(fdcu, fdu, reset)
}
static void
-fd_turnoff(caddr_t arg1, int arg2)
+fd_turnoff(caddr_t arg1)
{
fdu_t fdu = (fdu_t)arg1;
int s;
@@ -476,7 +476,7 @@ fd_turnoff(caddr_t arg1, int arg2)
}
void
-fd_motor_on(caddr_t arg1, int arg2)
+fd_motor_on(caddr_t arg1)
{
fdu_t fdu = (fdu_t)arg1;
int s;
@@ -502,7 +502,7 @@ fd_turnon(fdu)
{
fd_turnon1(fdu);
fd->flags |= FD_MOTOR_WAIT;
- timeout(fd_motor_on, (caddr_t)fdu, hz); /* in 1 sec its ok */
+ timeout((timeout_func_t)fd_motor_on, (caddr_t)fdu, hz); /* in 1 sec its ok */
}
}
@@ -685,7 +685,7 @@ fdstart(fdcu)
}
static void
-fd_timeout(caddr_t arg1, int arg2)
+fd_timeout(caddr_t arg1)
{
fdcu_t fdcu = (fdcu_t)arg1;
fdu_t fdu = fdc_data[fdcu].fdu;
@@ -809,8 +809,8 @@ fdstate(fdcu, fdc)
TRACE1("fd%d",fdu);
TRACE1("[%s]",fdstates[fdc->state]);
TRACE1("(0x%x)",fd->flags);
- untimeout(fd_turnoff, (caddr_t)fdu);
- timeout(fd_turnoff, (caddr_t)fdu, 4 * hz);
+ untimeout((timeout_func_t)fd_turnoff, (caddr_t)fdu);
+ timeout((timeout_func_t)fd_turnoff, (caddr_t)fdu, 4 * hz);
switch (fdc->state)
{
case DEVIDLE:
@@ -855,12 +855,12 @@ fdstate(fdcu, fdc)
out_fdc(fdcu,bp->b_cylin * fd->ft->steptrac);
fd->track = -2;
fdc->state = SEEKWAIT;
- timeout(fd_timeout, (caddr_t)fdcu, 2 * hz);
+ timeout((timeout_func_t)fd_timeout, (caddr_t)fdcu, 2 * hz);
return(0); /* will return later */
case SEEKWAIT:
- untimeout(fd_timeout, (caddr_t)fdcu);
+ untimeout((timeout_func_t)fd_timeout, (caddr_t)fdcu);
/* allow heads to settle */
- timeout(fd_pseudointr, (caddr_t)fdcu, hz / 50);
+ timeout((timeout_func_t)fd_pseudointr, (caddr_t)fdcu, hz / 50);
fdc->state = SEEKCOMPLETE;
return(0); /* will return later */
break;
@@ -925,10 +925,10 @@ fdstate(fdcu, fdc)
out_fdc(fdcu,fd->ft->datalen); /* data length */
}
fdc->state = IOCOMPLETE;
- timeout(fd_timeout, (caddr_t)fdcu, 2 * hz);
+ timeout((timeout_func_t)fd_timeout, (caddr_t)fdcu, 2 * hz);
return(0); /* will return later */
case IOCOMPLETE: /* IO DONE, post-analyze */
- untimeout(fd_timeout, (caddr_t)fdcu);
+ untimeout((timeout_func_t)fd_timeout, (caddr_t)fdcu);
for(i=0;i<7;i++)
{
fdc->status[i] = in_fdc(fdcu);
@@ -964,7 +964,7 @@ fdstate(fdcu, fdc)
/* ALL DONE */
fd->skip = 0;
bp->b_resid = 0;
- dp->b_actf = bp->av_forw;
+ dp->b_actf = bp->b_actf;
biodone(bp);
fdc->fd = (fd_p) 0;
fdc->fdu = -1;
@@ -991,7 +991,7 @@ fdstate(fdcu, fdc)
return(0); /* will return later */
case RECALWAIT:
/* allow heads to settle */
- timeout(fd_pseudointr, (caddr_t)fdcu, hz / 30);
+ timeout((timeout_func_t)fd_pseudointr, (caddr_t)fdcu, hz / 30);
fdc->state = RECALCOMPLETE;
return(0); /* will return later */
case RECALCOMPLETE:
@@ -1079,7 +1079,7 @@ retrier(fdcu)
bp->b_flags |= B_ERROR;
bp->b_error = EIO;
bp->b_resid = bp->b_bcount - fdc->fd->skip;
- dp->b_actf = bp->av_forw;
+ dp->b_actf = bp->b_actf;
fdc->fd->skip = 0;
biodone(bp);
fdc->state = FINDWORK;
diff --git a/sys/dev/ie/if_ie.c b/sys/dev/ie/if_ie.c
index 95095bd..cb6b96a 100644
--- a/sys/dev/ie/if_ie.c
+++ b/sys/dev/ie/if_ie.c
@@ -1320,9 +1320,8 @@ iereset(unit, dummy)
* This is called if we time out.
*/
static void
-chan_attn_timeout(rock, arg2)
+chan_attn_timeout(rock)
caddr_t rock;
- int arg2;
{
*(int *)rock = 1;
}
diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c
index 7309f42..683b0e1 100644
--- a/sys/dev/mcd/mcd.c
+++ b/sys/dev/mcd/mcd.c
@@ -387,7 +387,7 @@ static void mcd_start(int unit)
if ((bp = qp->b_actf) != 0) {
/* block found to process, dequeue */
/*MCD_TRACE("mcd_start: found block bp=0x%x\n",bp,0,0,0);*/
- qp->b_actf = bp->av_forw;
+ qp->b_actf = bp->b_actf;
splx(s);
} else {
/* nothing to do */
diff --git a/sys/dev/mse/mse.c b/sys/dev/mse/mse.c
index eebe163..5f80b21 100644
--- a/sys/dev/mse/mse.c
+++ b/sys/dev/mse/mse.c
@@ -71,7 +71,7 @@ struct isa_driver msedriver = {
struct mse_softc {
int sc_flags;
int sc_mousetype;
- pid_t sc_selp;
+ struct selinfo sc_selp;
u_int sc_port;
void (*sc_enablemouse)();
void (*sc_disablemouse)();
@@ -316,7 +316,7 @@ mseselect(dev, rw, p)
* Since this is an exclusive open device, any previous proc.
* pointer is trash now, so we can just assign it.
*/
- sc->sc_selp = p->p_pid;
+ selrecord(p, &sc->sc_selp);
splx(s);
return (0);
}
@@ -350,11 +350,7 @@ mseintr(unit)
sc->sc_flags &= ~MSESC_WANT;
wakeup((caddr_t)sc);
}
- if (sc->sc_selp) {
- p = sc->sc_selp;
- sc->sc_selp = (pid_t)0;
- selwakeup(p, 0);
- }
+ selwakeup(&sc->sc_selp);
}
}
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index ad09f7a3..9bdb8c4 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -36,6 +36,7 @@
#include "sio.h"
#if NSIO > 0
+#define DONT_MALLOC_TTYS
/*
* Serial driver, based on 386BSD-0.1 com driver.
* Mostly rewritten to use pseudo-DMA.
@@ -61,9 +62,11 @@
#define FAKE_DCD(unit) ((unit) == comconsole)
#define LOTS_OF_EVENTS 64 /* helps separate urgent events from input */
+#define RBSZ 1024
#define RB_I_HIGH_WATER (RBSZ - 2 * RS_IBUFSIZE)
#define RB_I_LOW_WATER ((RBSZ - 2 * RS_IBUFSIZE) * 7 / 8)
#define RS_IBUFSIZE 256
+#define RS_OBUFSIZE 256
#define TTY_BI TTY_FE /* XXX */
#define TTY_OE TTY_PE /* XXX */
@@ -221,39 +224,39 @@ struct com_s {
#define CE_INPUT_OFFSET RS_IBUFSIZE
u_char ibuf1[2 * RS_IBUFSIZE];
u_char ibuf2[2 * RS_IBUFSIZE];
+ u_char obuf[RS_OBUFSIZE];
};
/*
* The public functions in the com module ought to be declared in a com-driver
* system header.
*/
-#define Dev_t int /* promoted dev_t */
/* Interrupt handling entry points. */
void siointr __P((int unit));
void siopoll __P((void));
/* Device switch entry points. */
-int sioopen __P((Dev_t dev, int oflags, int devtype,
+int sioopen __P((dev_t dev, int oflags, int devtype,
struct proc *p));
-int sioclose __P((Dev_t dev, int fflag, int devtype,
+int sioclose __P((dev_t dev, int fflag, int devtype,
struct proc *p));
-int sioread __P((Dev_t dev, struct uio *uio, int ioflag));
-int siowrite __P((Dev_t dev, struct uio *uio, int ioflag));
-int sioioctl __P((Dev_t dev, int cmd, caddr_t data,
+int sioread __P((dev_t dev, struct uio *uio, int ioflag));
+int siowrite __P((dev_t dev, struct uio *uio, int ioflag));
+int sioioctl __P((dev_t dev, int cmd, caddr_t data,
int fflag, struct proc *p));
void siostop __P((struct tty *tp, int rw));
#define sioreset noreset
-int sioselect __P((Dev_t dev, int rw, struct proc *p));
+int sioselect __P((dev_t dev, int rw, struct proc *p));
#define siommap nommap
#define siostrategy nostrategy
/* Console device entry points. */
-int siocngetc __P((Dev_t dev));
+int siocngetc __P((dev_t dev));
struct consdev;
void siocninit __P((struct consdev *cp));
void siocnprobe __P((struct consdev *cp));
-void siocnputc __P((Dev_t dev, int c));
+void siocnputc __P((dev_t dev, int c));
static int sioattach __P((struct isa_device *dev));
static void comflush __P((struct com_s *com));
@@ -288,15 +291,9 @@ static int comconsole = -1;
static speed_t comdefaultrate = TTYDEF_SPEED;
static u_int com_events; /* input chars + weighted output completions */
static int commajor;
-#ifdef DONT_MALLOC_TTYS
-#define TB_OUT(tp) (&(tp)->t_out)
-#define TB_RAW(tp) (&(tp)->t_raw)
+#define TB_OUT(tp) (&(tp)->t_outq)
+#define TB_RAW(tp) (&(tp)->t_rawq)
struct tty sio_tty[NSIO];
-#else
-#define TB_OUT(tp) ((tp)->t_out)
-#define TB_RAW(tp) ((tp)->t_raw)
-struct tty *sio_tty[NSIO];
-#endif
extern struct tty *constty;
extern int tk_nin; /* XXX */
extern int tk_rawcc; /* XXX */
@@ -787,7 +784,7 @@ bidir_open_top:
}
out:
if (error == 0)
- error = (*linesw[tp->t_line].l_open)(dev, tp, 0);
+ error = (*linesw[tp->t_line].l_open)(dev, tp);
splx(s);
#ifdef COM_BIDIR
@@ -1129,7 +1126,7 @@ sioioctl(dev, cmd, data, flag, p)
com = com_addr(UNIT(dev));
tp = com->tp;
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag);
+ error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
if (error >= 0)
return (error);
error = ttioctl(tp, cmd, data, flag);
@@ -1222,6 +1219,7 @@ sioioctl(dev, cmd, data, flag, p)
*(int *)data = com->bidir;
break;
#endif /* COM_BIDIR */
+#if 0
case TIOCMSDTRWAIT:
/* must be root since the wait applies to following logins */
error = suser(p->p_ucred, &p->p_acflag);
@@ -1240,6 +1238,7 @@ sioioctl(dev, cmd, data, flag, p)
case TIOCMGDTRWAIT:
*(int *)data = com->dtr_wait;
break;
+#endif
#ifdef TIOCTIMESTAMP
case TIOCTIMESTAMP:
com->do_timestamp = TRUE;
@@ -1259,16 +1258,14 @@ static void
comflush(com)
struct com_s *com;
{
- struct ringb *rbp;
+ struct clist *rbp;
disable_intr();
if (com->state & CS_ODONE)
com_events -= LOTS_OF_EVENTS;
com->state &= ~(CS_ODONE | CS_BUSY);
enable_intr();
- rbp = TB_OUT(com->tp);
- rbp->rb_hd += com->ocount;
- rbp->rb_hd = RB_ROLLOVER(rbp, rbp->rb_hd);
+ while( getc( TB_OUT(com->tp)) != -1);
com->ocount = 0;
com->tp->t_state &= ~TS_BUSY;
}
@@ -1343,8 +1340,8 @@ repeat:
* CS_RTS_IFLOW is on.
*/
if ((com->state & CS_RTS_IFLOW)
- && !(com->mcr_image & MCR_RTS)
- && !(tp->t_state & TS_RTS_IFLOW))
+ && !(com->mcr_image & MCR_RTS) /*
+ && !(tp->t_state & TS_RTS_IFLOW) */)
outb(com->modem_ctl_port,
com->mcr_image |= MCR_RTS);
enable_intr();
@@ -1404,16 +1401,17 @@ repeat:
if (incc <= 0 || !(tp->t_state & TS_ISOPEN))
continue;
if (com->state & CS_RTS_IFLOW
- && RB_LEN(TB_RAW(tp)) + incc >= RB_I_HIGH_WATER
- && !(tp->t_state & TS_RTS_IFLOW)
+ && TB_RAW(tp)->c_cc + incc >= RB_I_HIGH_WATER /*
+ && !(tp->t_state & TS_RTS_IFLOW) */
/*
* XXX - need RTS flow control for all line disciplines.
* Only have it in standard one now.
*/
&& linesw[tp->t_line].l_rint == ttyinput) {
- tp->t_state |= TS_RTS_IFLOW;
+/* tp->t_state |= TS_RTS_IFLOW; */
ttstart(tp);
}
+#if 0
/*
* Avoid the grotesquely inefficient lineswitch routine
* (ttyinput) in "raw" mode. It usually takes about 450
@@ -1442,6 +1440,7 @@ repeat:
ttstart(tp);
}
} else {
+#endif
do {
u_char line_status;
int recv_data;
@@ -1461,7 +1460,9 @@ repeat:
}
(*linesw[tp->t_line].l_rint)(recv_data, tp);
} while (--incc > 0);
+#if 0
}
+#endif
if (com_events == 0)
break;
}
@@ -1624,10 +1625,12 @@ comstart(tp)
com->state &= ~CS_TTGO;
else
com->state |= CS_TTGO;
+#if 0
if (tp->t_state & TS_RTS_IFLOW) {
if (com->mcr_image & MCR_RTS && com->state & CS_RTS_IFLOW)
outb(com->modem_ctl_port, com->mcr_image &= ~MCR_RTS);
} else {
+#endif
/*
* XXX don't raise MCR_RTS if CTS_RTS_IFLOW is off. Set it
* appropriately in comparam() if RTS-flow is being changed.
@@ -1635,31 +1638,29 @@ comstart(tp)
*/
if (!(com->mcr_image & MCR_RTS) && com->iptr < com->ihighwater)
outb(com->modem_ctl_port, com->mcr_image |= MCR_RTS);
+#if 0
}
+#endif
enable_intr();
if (tp->t_state & (TS_TIMEOUT | TS_TTSTOP))
goto out;
- if (RB_LEN(TB_OUT(tp)) <= tp->t_lowat) {
+ if (TB_OUT(tp)->c_cc <= tp->t_lowat) {
if (tp->t_state & TS_ASLEEP) {
tp->t_state &= ~TS_ASLEEP;
wakeup((caddr_t)TB_OUT(tp));
}
- if (tp->t_wsel) {
- selwakeup(tp->t_wsel, tp->t_state & TS_WCOLL);
- tp->t_wsel = 0;
- tp->t_state &= ~TS_WCOLL;
- }
+ selwakeup(&tp->t_wsel);
}
if (com->ocount != 0) {
disable_intr();
siointr1(com);
enable_intr();
- } else if (RB_LEN(TB_OUT(tp)) != 0) {
+ } else if (TB_OUT(tp)->c_cc != 0) {
tp->t_state |= TS_BUSY;
- com->ocount = RB_CONTIGGET(TB_OUT(tp));
disable_intr();
- com->obufend = (com->optr = (u_char *)TB_OUT(tp)->rb_hd)
- + com->ocount;
+ com->ocount = q_to_b(TB_OUT(tp), com->obuf, sizeof com->obuf);
+ com->optr = com->obuf;
+ com->obufend = com->obuf + com->ocount;
com->state |= CS_BUSY;
siointr1(com); /* fake interrupt to start output */
enable_intr();
@@ -1728,11 +1729,11 @@ comwakeup(chan, ticks)
{
int unit;
- timeout(comwakeup, (caddr_t) NULL, hz / 100);
+ timeout((timeout_func_t)comwakeup, (caddr_t) NULL, hz / 100);
if (com_events != 0) {
#ifndef OLD_INTERRUPT_HANDLING
- int s = splsofttty();
+ int s = spltty();
#endif
siopoll();
#ifndef OLD_INTERRUPT_HANDLING
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index 8757295..39292f9 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -44,6 +44,7 @@
#endif
#include "param.h"
+#include <sys/systm.h>
#include "conf.h"
#include "ioctl.h"
#include "proc.h"
@@ -51,7 +52,6 @@
#include "tty.h"
#include "uio.h"
#include "callout.h"
-#include "systm.h"
#include "kernel.h"
#include "syslog.h"
#include "errno.h"
@@ -277,14 +277,20 @@ int ttrstrt();
#endif
#if defined(__FreeBSD__)
+#if 0
#define VIRTUAL_TTY(x) (pccons[x] = ttymalloc(pccons[x]))
#define CONSOLE_TTY (pccons[NCONS] = ttymalloc(pccons[NCONS]))
+struct tty *pccons[NCONS+1];
+#else
+#define VIRTUAL_TTY(x) &pccons[x]
+#define CONSOLE_TTY &pccons[NCONS]
+struct tty pccons[NCONS+1];
+#endif
+#define timeout_t timeout_func_t
#define frametype struct trapframe
#define eflags tf_eflags
-#define timeout_t timeout_func_t
#define MONO_BUF (KERNBASE+0xB0000)
#define CGA_BUF (KERNBASE+0xB8000)
-struct tty *pccons[NCONS+1];
#endif
#if defined(__386BSD__) && !defined(__FreeBSD__)
@@ -456,11 +462,7 @@ int pcopen(dev_t dev, int flag, int mode, struct proc *p)
return(EBUSY);
tp->t_state |= TS_CARR_ON;
tp->t_cflag |= CLOCAL;
-#if defined(__FreeBSD__)
- return((*linesw[tp->t_line].l_open)(dev, tp, 0));
-#else
return((*linesw[tp->t_line].l_open)(dev, tp));
-#endif
}
@@ -744,12 +746,12 @@ int pcioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
return 0;
case KDENABIO: /* allow io operations */
- fp = (frametype *)p->p_regs;
+ fp = (frametype *)p->p_md.md_regs;
fp->eflags |= PSL_IOPL;
return 0;
case KDDISABIO: /* disallow io operations (default) */
- fp = (frametype *)p->p_regs;
+ fp = (frametype *)p->p_md.md_regs;
fp->eflags &= ~PSL_IOPL;
return 0;
@@ -960,7 +962,7 @@ int pcioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
if (saved_console < 0) {
saved_console = get_scr_num();
switch_scr(minor(dev));
- fp = (frametype *)p->p_regs;
+ fp = (frametype *)p->p_md.md_regs;
fp->eflags |= PSL_IOPL;
scp->status |= UNKNOWN_MODE;
scp->status |= KBD_RAW_MODE;
@@ -969,7 +971,7 @@ int pcioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
return EAGAIN;
case CONSOLE_X_MODE_OFF:/* just to be compatible */
- fp = (frametype *)p->p_regs;
+ fp = (frametype *)p->p_md.md_regs;
fp->eflags &= ~PSL_IOPL;
if (crtc_vga) {
load_font(0, 16, font_8x16);
@@ -1002,7 +1004,7 @@ int pcioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
break;
}
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag);
+ error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
if (error >= 0)
return(error);
error = ttioctl(tp, cmd, data, flag);
@@ -1028,7 +1030,7 @@ void pcxint(dev_t dev)
void pcstart(struct tty *tp)
{
-#if defined(NetBSD)
+#if defined(NetBSD) || defined(__FreeBSD__)
struct clist *rbp;
int i, s, len;
u_char buf[PCBURST];
@@ -1046,10 +1048,6 @@ void pcstart(struct tty *tp)
if (buf[i]) ansi_put(scp, buf[i]);
s = spltty();
tp->t_state &= ~TS_BUSY;
- if (rbp->c_cc) {
- tp->t_state |= TS_TIMEOUT;
- timeout((timeout_t)ttrstrt, (caddr_t)tp, 1);
- }
if (rbp->c_cc <= tp->t_lowat) {
if (tp->t_state & TS_ASLEEP) {
tp->t_state &= ~TS_ASLEEP;
@@ -1060,7 +1058,7 @@ void pcstart(struct tty *tp)
}
splx(s);
-#else /* __FreeBSD__ & __386BSD__ */
+#else /* __386BSD__ */
int c, s, len, i;
scr_stat *scp = get_scr_stat(tp->t_dev);
@@ -1076,12 +1074,7 @@ void pcstart(struct tty *tp)
tp->t_state &= ~TS_ASLEEP;
wakeup((caddr_t)tp->t_out);
}
- if (tp->t_wsel) {
- selwakeup(tp->t_wsel,
- tp->t_state & TS_WCOLL);
- tp->t_wsel = 0;
- tp->t_state &= ~TS_WCOLL;
- }
+ selwakeup(&tp->t_wsel);
}
if (RB_LEN(tp->t_out) == 0)
break;
OpenPOWER on IntegriCloud