diff options
author | gibbs <gibbs@FreeBSD.org> | 1997-09-21 21:41:49 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1997-09-21 21:41:49 +0000 |
commit | e1b0aaaa7646122022e6179a0b6406809f2126b8 (patch) | |
tree | 453c2e0b2fbd7526c2bfa12a66b852f740856480 /sys/isa | |
parent | dc043d9d0aa92d02293099dc6adcabe0e6c972cb (diff) | |
download | FreeBSD-src-e1b0aaaa7646122022e6179a0b6406809f2126b8.zip FreeBSD-src-e1b0aaaa7646122022e6179a0b6406809f2126b8.tar.gz |
aha1542.c aic6360.c cy.c fd.c ft.c
if_ie.c if_wl.c if_zp.c isa.c isa_device.h
labpc.c mcd.c ncr5380.c scd.c seagate.c si.c
sio.c tw.c ultra14f.c wcd.c wd.c:
Update for changes in the callout interface.
apic_vector.s icu_vector.s ipl.s ipl_funcs.c:
Add CAM software/hardware interrupt support.
Diffstat (limited to 'sys/isa')
-rw-r--r-- | sys/isa/fd.c | 30 | ||||
-rw-r--r-- | sys/isa/sio.c | 13 |
2 files changed, 25 insertions, 18 deletions
diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 85305f4..a2aac72 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.101 1997/09/16 07:45:45 joerg Exp $ + * $Id: fd.c,v 1.102 1997/09/17 20:16:14 tegge Exp $ * */ @@ -170,6 +170,8 @@ static struct fd_data { #ifdef notyet int dkunit; /* disk stats unit number */ #endif + struct callout_handle toffhandle; + struct callout_handle tohandle; #ifdef DEVFS void *bdevs[1 + NUMDENS + MAXPARTITIONS]; void *cdevs[1 + NUMDENS + MAXPARTITIONS]; @@ -534,7 +536,7 @@ fdattach(struct isa_device *dev) fdc->state = DEVIDLE; /* reset controller, turn motor off, clear fdout mirror reg */ outb(fdc->baseport + FDOUT, ((fdc->fdout = 0))); - TAILQ_INIT(&fdc->head); + bufq_init(&fdc->head); /* check for each floppy drive */ for (fdup = isa_biotab_fdc; fdup->id_driver != 0; fdup++) { @@ -673,6 +675,8 @@ fdattach(struct isa_device *dev) fd->fdc = fdc; fd->fdsu = fdsu; fd->options = 0; + callout_handle_init(&fd->toffhandle); + callout_handle_init(&fd->tohandle); printf("fd%d: ", fdu); switch (fdt) { @@ -843,7 +847,7 @@ fd_turnoff(void *arg1) * and nothing is queued on it. */ if (fd->fdc->state != DEVIDLE && fd->fdc->fdu == fdu) { - timeout(fd_turnoff, arg1, 4 * hz); + fd->toffhandle = timeout(fd_turnoff, arg1, 4 * hz); return; } @@ -1154,8 +1158,8 @@ fdstrategy(struct buf *bp) } bp->b_pblkno = bp->b_blkno; s = splbio(); - tqdisksort(&fdc->head, bp); - untimeout(fd_turnoff, (caddr_t)fdu); /* a good idea */ + bufqdisksort(&fdc->head, bp); + untimeout(fd_turnoff, (caddr_t)fdu, fd->toffhandle); /* a good idea */ fdstart(fdcu); splx(s); return; @@ -1195,7 +1199,7 @@ fd_timeout(void *arg1) struct buf *bp; int s; - bp = TAILQ_FIRST(&fdc_data[fdcu].head); + bp = bufq_first(&fdc_data[fdcu].head); /* * Due to IBM's brain-dead design, the FDC has a faked ready @@ -1282,7 +1286,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc) struct fd_formb *finfo = NULL; size_t fdblk; - bp = TAILQ_FIRST(&fdc->head); + bp = bufq_first(&fdc->head); if(!bp) { /***********************************************\ * nothing left for this controller to do * @@ -1321,7 +1325,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc) TRACE1("fd%d", fdu); TRACE1("[%s]", fdstates[fdc->state]); TRACE1("(0x%x)", fd->flags); - untimeout(fd_turnoff, (caddr_t)fdu); + untimeout(fd_turnoff, (caddr_t)fdu, fd->toffhandle); timeout(fd_turnoff, (caddr_t)fdu, 4 * hz); switch (fdc->state) { @@ -1526,10 +1530,10 @@ fdstate(fdcu_t fdcu, fdc_p fdc) } } fdc->state = IOCOMPLETE; - timeout(fd_timeout, (caddr_t)fdcu, hz); + fd->tohandle = timeout(fd_timeout, (caddr_t)fdcu, hz); return(0); /* will return later */ case IOCOMPLETE: /* IO DONE, post-analyze */ - untimeout(fd_timeout, (caddr_t)fdcu); + untimeout(fd_timeout, (caddr_t)fdcu, fd->tohandle); if (fd_read_status(fdc, fd->fdsu)) { @@ -1579,7 +1583,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc) { /* ALL DONE */ fd->skip = 0; - TAILQ_REMOVE(&fdc->head, bp, b_act); + bufq_remove(&fdc->head, bp); biodone(bp); fdc->fd = (fd_p) 0; fdc->fdu = -1; @@ -1689,7 +1693,7 @@ retrier(fdcu) fdc_p fdc = fdc_data + fdcu; register struct buf *bp; - bp = TAILQ_FIRST(&fdc->head); + bp = bufq_first(&fdc->head); if(fd_data[FDUNIT(minor(bp->b_dev))].options & FDOPT_NORETRY) goto fail; @@ -1733,7 +1737,7 @@ retrier(fdcu) bp->b_flags |= B_ERROR; bp->b_error = EIO; bp->b_resid += bp->b_bcount - fdc->fd->skip; - TAILQ_REMOVE(&fdc->head, bp, b_act); + bufq_remove(&fdc->head, bp); fdc->fd->skip = 0; biodone(bp); fdc->state = FINDWORK; diff --git a/sys/isa/sio.c b/sys/isa/sio.c index 37d8ecd..21beb8c 100644 --- a/sys/isa/sio.c +++ b/sys/isa/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.181 1997/09/14 03:19:23 peter Exp $ + * $Id: sio.c,v 1.182 1997/09/19 15:25:49 jmg Exp $ */ #include "opt_comconsole.h" @@ -373,6 +373,8 @@ static u_int com_events; /* input chars + weighted output completions */ static Port_t siocniobase; static int sio_timeout; static int sio_timeouts_until_log; +static struct callout_handle sio_timeout_handle + = CALLOUT_HANDLE_INITIALIZER(&sio_timeout_handle); #if 0 /* XXX */ static struct tty *sio_tty[NSIOTOT]; #else @@ -2410,7 +2412,7 @@ siosettimeout() * Otherwise set it to max(1/200, 1/hz). * Enable timeouts iff some device is open. */ - untimeout(comwakeup, (void *)NULL); + untimeout(comwakeup, (void *)NULL, sio_timeout_handle); sio_timeout = hz; someopen = FALSE; for (unit = 0; unit < NSIOTOT; ++unit) { @@ -2426,12 +2428,13 @@ siosettimeout() } if (someopen) { sio_timeouts_until_log = hz / sio_timeout; - timeout(comwakeup, (void *)NULL, sio_timeout); + sio_timeout_handle = timeout(comwakeup, (void *)NULL, + sio_timeout); } else { /* Flush error messages, if any. */ sio_timeouts_until_log = 1; comwakeup((void *)NULL); - untimeout(comwakeup, (void *)NULL); + untimeout(comwakeup, (void *)NULL, sio_timeout_handle); } } @@ -2442,7 +2445,7 @@ comwakeup(chan) struct com_s *com; int unit; - timeout(comwakeup, (void *)NULL, sio_timeout); + sio_timeout_handle = timeout(comwakeup, (void *)NULL, sio_timeout); /* * Recover from lost output interrupts. |