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.
This commit is contained in:
Justin T. Gibbs 1997-09-21 21:41:49 +00:00
parent 47558d4d77
commit 02a199102d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=29677
43 changed files with 464 additions and 299 deletions

View File

@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
* $Id: apic_vector.s,v 1.37 1997/09/07 19:23:45 smp Exp smp $
* $Id: apic_vector.s,v 1.21 1997/09/07 22:02:36 fsmp Exp $
*/
@ -498,6 +498,8 @@ MCOUNT_LABEL(eintr)
* Addresses of interrupt handlers.
* XresumeNN: Resumption addresses for HWIs.
*/
.globl _ihandlers
_ihandlers:
ihandlers:
/*
* used by:
@ -514,15 +516,16 @@ ihandlers:
* ipl.s: doreti_unpend
* apic_ipl.s: splz_unpend
*/
.long swi_tty, swi_net
.long 0, 0, 0, 0
.long swi_tty, swi_net, dummycamisr, dummycamisr
.long 0, 0
.long _softclock, swi_ast
imasks: /* masks for interrupt handlers */
.space NHWI*4 /* padding; HWI masks are elsewhere */
.long SWI_TTY_MASK, SWI_NET_MASK
.long 0, 0, 0, 0
.long SWI_CAMNET_MASK, SWI_CAMBIO_MASK
.long 0, 0
.long SWI_CLOCK_MASK, SWI_AST_MASK
/*

View File

@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
* $Id: icu_vector.s,v 1.3 1997/07/24 03:24:57 fsmp Exp $
* $Id: icu_vector.s,v 1.4 1997/09/08 06:40:58 peter Exp $
*/
/*
@ -194,20 +194,22 @@ MCOUNT_LABEL(bintr)
MCOUNT_LABEL(eintr)
.data
.globl _ihandlers
_ihandlers:
ihandlers: /* addresses of interrupt handlers */
/* actually resumption addresses for HWI's */
.long Xresume0, Xresume1, Xresume2, Xresume3
.long Xresume4, Xresume5, Xresume6, Xresume7
.long Xresume8, Xresume9, Xresume10, Xresume11
.long Xresume12, Xresume13, Xresume14, Xresume15
.long swi_tty, swi_net
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long swi_tty, swi_net, dummycamisr, dummycamisr
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long _softclock, swi_ast
imasks: /* masks for interrupt handlers */
.space NHWI*4 /* padding; HWI masks are elsewhere */
.long SWI_TTY_MASK, SWI_NET_MASK
.long SWI_TTY_MASK, SWI_NET_MASK, SWI_CAMNET_MASK, SWI_CAMBIO_MASK
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long SWI_CLOCK_MASK, SWI_AST_MASK

View File

@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
* $Id: icu_vector.s,v 1.3 1997/07/24 03:24:57 fsmp Exp $
* $Id: icu_vector.s,v 1.4 1997/09/08 06:40:58 peter Exp $
*/
/*
@ -194,20 +194,22 @@ MCOUNT_LABEL(bintr)
MCOUNT_LABEL(eintr)
.data
.globl _ihandlers
_ihandlers:
ihandlers: /* addresses of interrupt handlers */
/* actually resumption addresses for HWI's */
.long Xresume0, Xresume1, Xresume2, Xresume3
.long Xresume4, Xresume5, Xresume6, Xresume7
.long Xresume8, Xresume9, Xresume10, Xresume11
.long Xresume12, Xresume13, Xresume14, Xresume15
.long swi_tty, swi_net
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long swi_tty, swi_net, dummycamisr, dummycamisr
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long _softclock, swi_ast
imasks: /* masks for interrupt handlers */
.space NHWI*4 /* padding; HWI masks are elsewhere */
.long SWI_TTY_MASK, SWI_NET_MASK
.long SWI_TTY_MASK, SWI_NET_MASK, SWI_CAMNET_MASK, SWI_CAMBIO_MASK
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long SWI_CLOCK_MASK, SWI_AST_MASK

View File

@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
* $Id: icu_vector.s,v 1.3 1997/07/24 03:24:57 fsmp Exp $
* $Id: icu_vector.s,v 1.4 1997/09/08 06:40:58 peter Exp $
*/
/*
@ -194,20 +194,22 @@ MCOUNT_LABEL(bintr)
MCOUNT_LABEL(eintr)
.data
.globl _ihandlers
_ihandlers:
ihandlers: /* addresses of interrupt handlers */
/* actually resumption addresses for HWI's */
.long Xresume0, Xresume1, Xresume2, Xresume3
.long Xresume4, Xresume5, Xresume6, Xresume7
.long Xresume8, Xresume9, Xresume10, Xresume11
.long Xresume12, Xresume13, Xresume14, Xresume15
.long swi_tty, swi_net
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long swi_tty, swi_net, dummycamisr, dummycamisr
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long _softclock, swi_ast
imasks: /* masks for interrupt handlers */
.space NHWI*4 /* padding; HWI masks are elsewhere */
.long SWI_TTY_MASK, SWI_NET_MASK
.long SWI_TTY_MASK, SWI_NET_MASK, SWI_CAMNET_MASK, SWI_CAMBIO_MASK
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long SWI_CLOCK_MASK, SWI_AST_MASK

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
* $Id: isa.c,v 1.103 1997/08/28 03:36:40 msmith Exp $
* $Id: isa.c,v 1.104 1997/09/19 15:20:23 jmg Exp $
*/
/*
@ -319,6 +319,11 @@ haveseen_isadev(dvp, checkbits)
if (status)
return status;
}
for (tmpdvp = isa_devtab_cam; tmpdvp->id_driver; tmpdvp++) {
status |= haveseen(dvp, tmpdvp, checkbits);
if (status)
return status;
}
for (tmpdvp = isa_devtab_null; tmpdvp->id_driver; tmpdvp++) {
status |= haveseen(dvp, tmpdvp, checkbits);
if (status)
@ -358,6 +363,9 @@ isa_configure() {
for (dvp = isa_devtab_net; dvp->id_driver; dvp++)
if (dvp->id_driver->sensitive_hw)
config_isadev(dvp, &net_imask);
for (dvp = isa_devtab_cam; dvp->id_driver; dvp++)
if (dvp->id_driver->sensitive_hw)
config_isadev(dvp, &cam_imask);
for (dvp = isa_devtab_null; dvp->id_driver; dvp++)
if (dvp->id_driver->sensitive_hw)
config_isadev(dvp, (u_int *)NULL);
@ -372,6 +380,9 @@ isa_configure() {
for (dvp = isa_devtab_net; dvp->id_driver; dvp++)
if (!dvp->id_driver->sensitive_hw)
config_isadev(dvp, &net_imask);
for (dvp = isa_devtab_cam; dvp->id_driver; dvp++)
if (!dvp->id_driver->sensitive_hw)
config_isadev(dvp, &cam_imask);
for (dvp = isa_devtab_null; dvp->id_driver; dvp++)
if (!dvp->id_driver->sensitive_hw)
config_isadev(dvp, (u_int *)NULL);
@ -416,6 +427,8 @@ isa_configure() {
register_imask(dvp, bio_imask);
for (dvp = isa_devtab_net; dvp->id_driver; dvp++)
register_imask(dvp, net_imask);
for (dvp = isa_devtab_cam; dvp->id_driver; dvp++)
register_imask(dvp, cam_imask);
for (dvp = isa_devtab_null; dvp->id_driver; dvp++)
register_imask(dvp, SWI_CLOCK_MASK);
spl0();

View File

@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: cy.c,v 1.53 1997/09/03 01:50:24 bde Exp $
* $Id: cy.c,v 1.54 1997/09/14 03:19:08 peter Exp $
*/
#include "cy.h"
@ -137,6 +137,7 @@
#define siowrite cywrite
#define sio_timeout cy_timeout
#define sio_timeouts_until_log cy_timeouts_until_log
#define sio_timeout_handle cy_timeout_handle
#define sio_tty cy_tty
#define CY_MAX_PORTS (CD1400_NO_OF_CHANNELS * CY_MAX_CD1400s)
@ -390,6 +391,8 @@ static speed_t comdefaultrate = TTYDEF_SPEED;
static u_int com_events; /* input chars + weighted output completions */
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[NSIO];
#else
@ -2305,7 +2308,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 < NSIO; ++unit) {
@ -2323,12 +2326,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);
}
}
@ -2339,7 +2343,7 @@ comwakeup(chan)
struct com_s *com;
int unit;
timeout(comwakeup, (void *)NULL, sio_timeout);
sio_timeout_handle = timeout(comwakeup, (void *)NULL, sio_timeout);
#if 0
/*

View File

@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: cy.c,v 1.53 1997/09/03 01:50:24 bde Exp $
* $Id: cy.c,v 1.54 1997/09/14 03:19:08 peter Exp $
*/
#include "cy.h"
@ -137,6 +137,7 @@
#define siowrite cywrite
#define sio_timeout cy_timeout
#define sio_timeouts_until_log cy_timeouts_until_log
#define sio_timeout_handle cy_timeout_handle
#define sio_tty cy_tty
#define CY_MAX_PORTS (CD1400_NO_OF_CHANNELS * CY_MAX_CD1400s)
@ -390,6 +391,8 @@ static speed_t comdefaultrate = TTYDEF_SPEED;
static u_int com_events; /* input chars + weighted output completions */
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[NSIO];
#else
@ -2305,7 +2308,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 < NSIO; ++unit) {
@ -2323,12 +2326,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);
}
}
@ -2339,7 +2343,7 @@ comwakeup(chan)
struct com_s *com;
int unit;
timeout(comwakeup, (void *)NULL, sio_timeout);
sio_timeout_handle = timeout(comwakeup, (void *)NULL, sio_timeout);
#if 0
/*

View File

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

View File

@ -47,7 +47,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: if_ie.c,v 1.44 1997/07/20 14:09:59 bde Exp $
* $Id: if_ie.c,v 1.45 1997/09/02 01:18:14 bde Exp $
*/
/*
@ -1915,6 +1915,7 @@ command_and_wait(int unit, int cmd, volatile void *pcmd, int mask)
{
volatile struct ie_cmd_common *cc = pcmd;
volatile int timedout = 0;
struct callout_handle ch;
ie_softc[unit].scb->ie_command = (u_short) cmd;
@ -1925,7 +1926,8 @@ command_and_wait(int unit, int cmd, volatile void *pcmd, int mask)
* According to the packet driver, the minimum timeout
* should be .369 seconds, which we round up to .37.
*/
timeout(chan_attn_timeout, (caddr_t)&timedout, 37 * hz / 100);
ch = timeout(chan_attn_timeout, (caddr_t)&timedout,
37 * hz / 100);
/* ignore cast-qual */
/*
@ -1940,7 +1942,7 @@ command_and_wait(int unit, int cmd, volatile void *pcmd, int mask)
break;
}
untimeout(chan_attn_timeout, (caddr_t)&timedout);
untimeout(chan_attn_timeout, (caddr_t)&timedout, ch);
/* ignore cast-qual */
return (timedout);

View File

@ -40,7 +40,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: mcd.c,v 1.92 1997/06/01 16:03:13 peter Exp $
* $Id: mcd.c,v 1.93 1997/07/20 14:10:06 bde Exp $
*/
static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
@ -242,7 +242,7 @@ int mcd_attach(struct isa_device *dev)
cd->iobase = dev->id_iobase;
cd->flags |= MCDINIT;
mcd_soft_reset(unit);
TAILQ_INIT(&cd->head);
bufq_init(&cd->head);
#ifdef NOTYET
/* wire controller for interrupts and dma */
@ -440,7 +440,7 @@ MCD_TRACE("strategy: drive not valid\n");
/* queue it */
s = splbio();
tqdisksort(&cd->head, bp);
bufqdisksort(&cd->head, bp);
splx(s);
/* now check whether we can perform processing */
@ -467,11 +467,11 @@ static void mcd_start(int unit)
return;
}
bp = TAILQ_FIRST(&cd->head);
bp = bufq_first(&cd->head);
if (bp != 0) {
/* block found to process, dequeue */
/*MCD_TRACE("mcd_start: found block bp=0x%x\n",bp,0,0,0);*/
TAILQ_REMOVE(&cd->head, bp, b_act);
bufq_remove(&cd->head, bp);
splx(s);
} else {
/* nothing to do */
@ -975,6 +975,7 @@ mcdintr(unit)
* MCD_S_WAITREAD: wait for read ready, read data
*/
static struct mcd_mbx *mbxsave;
static struct callout_handle tohandle = CALLOUT_HANDLE_INITIALIZER(&tohandle);
static void
mcd_timeout(void *arg)
@ -1008,11 +1009,11 @@ mcd_doread(int state, struct mcd_mbx *mbxin)
/* get status */
outb(com_port, MCD_CMDGETSTAT);
mbx->count = RDELAY_WAITSTAT;
timeout(mcd_timeout,
(caddr_t)MCD_S_WAITSTAT,hz/100); /* XXX */
tohandle = timeout(mcd_timeout,
(caddr_t)MCD_S_WAITSTAT,hz/100); /* XXX */
return;
case MCD_S_WAITSTAT:
untimeout(mcd_timeout,(caddr_t)MCD_S_WAITSTAT);
untimeout(mcd_timeout,(caddr_t)MCD_S_WAITSTAT, tohandle);
if (mbx->count-- >= 0) {
if (inb(port+MCD_FLAGS) & MFL_STATUS_NOT_AVAIL) {
timeout(mcd_timeout,
@ -1052,8 +1053,8 @@ mcd_doread(int state, struct mcd_mbx *mbxin)
mcd_put(com_port, MCD_CMDSETMODE);
mcd_put(com_port, rm);
timeout(mcd_timeout,
(caddr_t)MCD_S_WAITMODE,hz/100); /* XXX */
tohandle = timeout(mcd_timeout,
(caddr_t)MCD_S_WAITMODE,hz/100); /* XXX */
return;
} else {
printf("mcd%d: timeout getstatus\n",unit);
@ -1061,13 +1062,14 @@ mcd_doread(int state, struct mcd_mbx *mbxin)
}
case MCD_S_WAITMODE:
untimeout(mcd_timeout,(caddr_t)MCD_S_WAITMODE);
untimeout(mcd_timeout,(caddr_t)MCD_S_WAITMODE, tohandle);
if (mbx->count-- < 0) {
printf("mcd%d: timeout set mode\n",unit);
goto readerr;
}
if (inb(port+MCD_FLAGS) & MFL_STATUS_NOT_AVAIL) {
timeout(mcd_timeout,(caddr_t)MCD_S_WAITMODE,hz/100);
tohandle = timeout(mcd_timeout,
(caddr_t)MCD_S_WAITMODE,hz/100);
return;
}
cd->status = inb(port+mcd_status) & 0xFF;
@ -1115,11 +1117,11 @@ mcd_doread(int state, struct mcd_mbx *mbxin)
}
mbx->count = RDELAY_WAITREAD;
timeout(mcd_timeout,
(caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
tohandle = timeout(mcd_timeout,
(caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
return;
case MCD_S_WAITREAD:
untimeout(mcd_timeout,(caddr_t)MCD_S_WAITREAD);
untimeout(mcd_timeout,(caddr_t)MCD_S_WAITREAD, tohandle);
if (mbx->count-- > 0) {
k = inb(port+MCD_FLAGS);
if (!(k & MFL_DATA_NOT_AVAIL)) { /* XXX */
@ -1163,8 +1165,8 @@ mcd_doread(int state, struct mcd_mbx *mbxin)
if (mcd_setflags(unit,cd) < 0)
goto changed;
}
timeout(mcd_timeout,
(caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
tohandle = timeout(mcd_timeout,
(caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
return;
} else {
printf("mcd%d: timeout read data\n",unit);

View File

@ -41,7 +41,7 @@
*/
/* $Id: scd.c,v 1.31 1997/05/10 12:13:13 joerg Exp $ */
/* $Id: scd.c,v 1.32 1997/07/20 14:10:10 bde Exp $ */
/* Please send any comments to micke@dynas.se */
@ -181,6 +181,9 @@ static int scd_probe(struct isa_device *dev);
static int scd_attach(struct isa_device *dev);
struct isa_driver scddriver = { scd_probe, scd_attach, "scd" };
/* For canceling our timeout */
static struct callout_handle tohandle = CALLOUT_HANDLE_INITIALIZER(&tohanle);
static d_open_t scdopen;
static d_close_t scdclose;
static d_ioctl_t scdioctl;
@ -207,7 +210,7 @@ int scd_attach(struct isa_device *dev)
cd->flags = SCDINIT;
cd->audio_status = CD_AS_AUDIO_INVALID;
TAILQ_INIT(&cd->head);
bufq_init(&cd->head);
#ifdef DEVFS
cd->ra_devfs_token =
@ -360,7 +363,7 @@ scdstrategy(struct buf *bp)
/* queue it */
s = splbio();
tqdisksort(&cd->head, bp);
bufqdisksort(&cd->head, bp);
splx(s);
/* now check whether we can perform processing */
@ -388,10 +391,10 @@ scd_start(int unit)
return;
}
bp = TAILQ_FIRST(&cd->head);
bp = bufq_first(&cd->head);
if (bp != 0) {
/* block found to process, dequeue */
TAILQ_REMOVE(&cd->head, bp, b_act);
bufq_remove(&cd->head, bp);
cd->flags |= SCDMBXBSY;
splx(s);
} else {
@ -806,7 +809,7 @@ scd_doread(int state, struct scd_mbx *mbxin)
goto trystat;
case SCD_S_WAITSTAT:
untimeout(scd_timeout,(caddr_t)SCD_S_WAITSTAT);
untimeout(scd_timeout,(caddr_t)SCD_S_WAITSTAT, tohandle);
if (mbx->count-- <= 0) {
printf("scd%d: timeout. drive busy.\n",unit);
goto harderr;
@ -814,8 +817,8 @@ scd_doread(int state, struct scd_mbx *mbxin)
trystat:
if (IS_BUSY(port)) {
timeout(scd_timeout,
(caddr_t)SCD_S_WAITSTAT,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITSTAT,hz/100); /* XXX */
return;
}
@ -853,19 +856,19 @@ scd_doread(int state, struct scd_mbx *mbxin)
goto writeparam;
mbx->count = 100;
timeout(scd_timeout,
(caddr_t)SCD_S_WAITFIFO,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITFIFO,hz/100); /* XXX */
return;
case SCD_S_WAITSPIN:
untimeout(scd_timeout,(caddr_t)SCD_S_WAITSPIN);
untimeout(scd_timeout,(caddr_t)SCD_S_WAITSPIN, tohandle);
if (mbx->count-- <= 0) {
printf("scd%d: timeout waiting for drive to spin up.\n", unit);
goto harderr;
}
if (!STATUS_BIT(port, SBIT_RESULT_READY)) {
timeout(scd_timeout,
(caddr_t)SCD_S_WAITSPIN,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITSPIN,hz/100); /* XXX */
return;
}
write_control(port, CBIT_RESULT_READY_CLEAR);
@ -885,14 +888,14 @@ scd_doread(int state, struct scd_mbx *mbxin)
goto loop;
case SCD_S_WAITFIFO:
untimeout(scd_timeout,(caddr_t)SCD_S_WAITFIFO);
untimeout(scd_timeout,(caddr_t)SCD_S_WAITFIFO, tohandle);
if (mbx->count-- <= 0) {
printf("scd%d: timeout. write param not ready.\n",unit);
goto harderr;
}
if (!FSTATUS_BIT(port, FBIT_WPARAM_READY)) {
timeout(scd_timeout,
(caddr_t)SCD_S_WAITFIFO,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITFIFO,hz/100); /* XXX */
return;
}
XDEBUG(1, ("scd%d: mbx->count (writeparamwait) = %d(%d)\n", unit, mbx->count, 100));
@ -904,8 +907,8 @@ scd_doread(int state, struct scd_mbx *mbxin)
XDEBUG(1, ("scd%d: spinning up drive ...\n", unit));
outb(port+OREG_COMMAND, CMD_SPIN_UP);
mbx->count = 300;
timeout(scd_timeout,
(caddr_t)SCD_S_WAITSPIN,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITSPIN,hz/100); /* XXX */
return;
}
@ -928,12 +931,12 @@ scd_doread(int state, struct scd_mbx *mbxin)
DELAY(100);
}
timeout(scd_timeout,
(caddr_t)SCD_S_WAITREAD,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITREAD,hz/100); /* XXX */
return;
case SCD_S_WAITREAD:
untimeout(scd_timeout,(caddr_t)SCD_S_WAITREAD);
untimeout(scd_timeout,(caddr_t)SCD_S_WAITREAD, tohandle);
if (mbx->count-- <= 0) {
if (STATUS_BIT(port, SBIT_RESULT_READY))
goto got_param;
@ -944,8 +947,8 @@ scd_doread(int state, struct scd_mbx *mbxin)
process_attention(unit);
if (!(cd->flags & SCDVALID))
goto changed;
timeout(scd_timeout,
(caddr_t)SCD_S_WAITREAD,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITREAD,hz/100); /* XXX */
return;
}
XDEBUG(2, ("scd%d: mbx->count (after RDY_BIT) = %d(%d)\n", unit, mbx->count, RDELAY_WAITREAD));
@ -965,7 +968,7 @@ scd_doread(int state, struct scd_mbx *mbxin)
goto waitfor_param;
case SCD_S_WAITPARAM:
untimeout(scd_timeout,(caddr_t)SCD_S_WAITPARAM);
untimeout(scd_timeout,(caddr_t)SCD_S_WAITPARAM, tohandle);
if (mbx->count-- <= 0) {
printf("scd%d: timeout waiting for params\n",unit);
goto readerr;
@ -973,8 +976,8 @@ scd_doread(int state, struct scd_mbx *mbxin)
waitfor_param:
if (!STATUS_BIT(port, SBIT_RESULT_READY)) {
timeout(scd_timeout,
(caddr_t)SCD_S_WAITPARAM,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITPARAM,hz/100); /* XXX */
return;
}
#if SCD_DEBUG

View File

@ -30,7 +30,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHORS BE LIABLE.
*
* $Id: si.c,v 1.59 1997/07/20 14:10:11 bde Exp $
* $Id: si.c,v 1.60 1997/09/14 03:19:18 peter Exp $
*/
#ifndef lint
@ -910,7 +910,7 @@ siclose(dev, flag, mode, p)
/* ok. we are now still on the right track.. nuke the hardware */
if (pp->sp_state & SS_LSTART) {
untimeout(si_lstart, (caddr_t)pp);
untimeout(si_lstart, (caddr_t)pp, pp->lstart_ch);
pp->sp_state &= ~SS_LSTART;
}
@ -2114,12 +2114,12 @@ si_start(tp)
}
if ((pp->sp_state & (SS_LSTART|SS_INLSTART)) == SS_LSTART) {
untimeout(si_lstart, (caddr_t)pp);
untimeout(si_lstart, (caddr_t)pp, pp->lstart_ch);
} else {
pp->sp_state |= SS_LSTART;
}
DPRINT((pp, DBG_START, "arming lstart, time=%d\n", time));
timeout(si_lstart, (caddr_t)pp, time);
pp->lstart_ch = timeout(si_lstart, (caddr_t)pp, time);
}
out:

View File

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

View File

@ -1,4 +1,4 @@
/* $Id: if_wl.c,v 1.7 1997/08/02 05:19:32 msmith Exp $ */
/* $Id: if_wl.c,v 1.8 1997/08/25 22:34:25 bde Exp $ */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -247,6 +247,7 @@ struct wl_softc{
short mode;
u_char chan24; /* 2.4 Gz: channel number/EEPROM Area # */
u_short freq24; /* 2.4 Gz: resulting frequency */
struct callout_handle watchdog_ch;
#ifdef WLCACHE
int w_sigitems; /* number of cached entries */
/* array of cache entries */
@ -447,6 +448,7 @@ wlattach(struct isa_device *id)
sc->flags = 0;
sc->mode = 0;
sc->hacr = HACR_RESET;
callout_handle_init(&sc->watchdog_ch);
CMD(unit); /* reset the board */
DELAY(DELAYCONST); /* >> 4 clocks at 6MHz */
@ -696,7 +698,7 @@ wlinit(void *xsc)
sc->flags |= DSF_RUNNING;
sc->tbusy = 0;
untimeout(wlwatchdog, sc);
untimeout(wlwatchdog, sc, sc->watchdog_ch);
wlstart(ifp);
} else {
@ -867,7 +869,7 @@ wlstart(struct ifnet *ifp)
if((scb_status & 0x0700) == SCB_CUS_IDLE &&
(cu_status & AC_SW_B) == 0){
sc->tbusy = 0;
untimeout(wlwatchdog, sc);
untimeout(wlwatchdog, sc, sc->watchdog_ch);
sc->wl_ac.ac_if.if_flags &= ~IFF_OACTIVE;
/*
* This is probably just a race. The xmt'r is just
@ -906,7 +908,7 @@ wlstart(struct ifnet *ifp)
* fails to interrupt we will restart
*/
/* try 10 ticks, not very long */
timeout(wlwatchdog, sc, 10);
sc->watchdog_ch = timeout(wlwatchdog, sc, 10);
sc->wl_ac.ac_if.if_flags |= IFF_OACTIVE;
sc->wl_if.if_opackets++;
wlxmt(unit, m);
@ -1605,7 +1607,7 @@ int unit;
}
}
sc->tbusy = 0;
untimeout(wlwatchdog, sc);
untimeout(wlwatchdog, sc, sc->watchdog_ch);
sc->wl_ac.ac_if.if_flags &= ~IFF_OACTIVE;
wlstart(&(sc->wl_if));
}

View File

@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
* $Id: apic_vector.s,v 1.37 1997/09/07 19:23:45 smp Exp smp $
* $Id: apic_vector.s,v 1.21 1997/09/07 22:02:36 fsmp Exp $
*/
@ -498,6 +498,8 @@ MCOUNT_LABEL(eintr)
* Addresses of interrupt handlers.
* XresumeNN: Resumption addresses for HWIs.
*/
.globl _ihandlers
_ihandlers:
ihandlers:
/*
* used by:
@ -514,15 +516,16 @@ ihandlers:
* ipl.s: doreti_unpend
* apic_ipl.s: splz_unpend
*/
.long swi_tty, swi_net
.long 0, 0, 0, 0
.long swi_tty, swi_net, dummycamisr, dummycamisr
.long 0, 0
.long _softclock, swi_ast
imasks: /* masks for interrupt handlers */
.space NHWI*4 /* padding; HWI masks are elsewhere */
.long SWI_TTY_MASK, SWI_NET_MASK
.long 0, 0, 0, 0
.long SWI_CAMNET_MASK, SWI_CAMBIO_MASK
.long 0, 0
.long SWI_CLOCK_MASK, SWI_AST_MASK
/*

View File

@ -12,7 +12,7 @@
* on the understanding that TFS is not responsible for the correct
* functioning of this software in any circumstances.
*
* $Id: aha1542.c,v 1.69 1997/03/24 11:23:37 bde Exp $
* $Id: aha1542.c,v 1.70 1997/07/20 14:09:49 bde Exp $
*/
/*
@ -766,7 +766,8 @@ ahaintr(unit)
}
#endif /*AHADEBUG */
if (ccb) {
untimeout(aha_timeout, (caddr_t)ccb);
untimeout(aha_timeout, (caddr_t)ccb,
ccb->xfer->timeout_ch);
aha_done(aha, ccb);
}
mbi->stat = AHA_MBI_FREE;
@ -1608,7 +1609,8 @@ aha_scsi_cmd(xs)
bcopy(xs->cmd, &ccb->scsi_cmd, ccb->scsi_cmd_length);
if (!(flags & SCSI_NOMASK)) {
s = splbio(); /* stop instant timeouts */
timeout(aha_timeout, (caddr_t)ccb, (xs->timeout * hz) / 1000);
xs->timeout_ch = timeout(aha_timeout, (caddr_t)ccb,
(xs->timeout * hz) / 1000);
aha_startmbx(ccb->mbx);
/*
* Usually return SUCCESSFULLY QUEUED
@ -1667,7 +1669,7 @@ aha_poll(aha, xs, ccb)
* because we are polling,
* take out the timeout entry aha_timeout made
*/
untimeout(aha_timeout, (caddr_t)ccb);
untimeout(aha_timeout, (caddr_t)ccb, ccb->xfer->timeout_ch);
count = 2000;
while (count) {
/*
@ -1862,7 +1864,8 @@ aha_timeout(void *arg1)
printf("\n");
aha_abortmbx(ccb->mbx);
/* 4 secs for the abort */
timeout(aha_timeout, (caddr_t)ccb, 4 * hz);
ccb->xfer->timeout_ch = timeout(aha_timeout,
(caddr_t)ccb, 4 * hz);
ccb->flags = CCB_ABORTED;
} splx(s);
}

View File

@ -31,7 +31,7 @@
*/
/*
* $Id: aic6360.c,v 1.29 1997/03/24 11:23:38 bde Exp $
* $Id: aic6360.c,v 1.30 1997/07/20 14:09:50 bde Exp $
*
* Acknowledgements: Many of the algorithms used in this driver are
* inspired by the work of Julian Elischer (julian@tfs.com) and
@ -933,13 +933,15 @@ aic_init(aic)
aic->state = AIC_CLEANING;
if (aic->nexus != NULL) {
aic->nexus->xs->error = XS_DRIVER_STUFFUP;
untimeout(aic_timeout, (caddr_t)aic->nexus);
untimeout(aic_timeout, (caddr_t)aic->nexus,
aic->nexus->xs->timeout_ch);
aic_done(aic->nexus);
}
aic->nexus = NULL;
while (acb = aic->nexus_list.tqh_first) {
acb->xs->error = XS_DRIVER_STUFFUP;
untimeout(aic_timeout, (caddr_t)acb);
untimeout(aic_timeout, (caddr_t)aic->nexus,
aic->nexus->xs->timeout_ch);
aic_done(acb);
}
}
@ -1038,7 +1040,8 @@ aic_scsi_cmd(xs)
s = splbio();
TAILQ_INSERT_TAIL(&aic->ready_list, acb, chain);
timeout(aic_timeout, (caddr_t)acb, (xs->timeout*hz)/1000);
xs->timeout_ch = timeout(aic_timeout, (caddr_t)acb,
(xs->timeout*hz)/1000);
if (aic->state == AIC_IDLE)
aic_sched(aic);
@ -1462,7 +1465,8 @@ aic_msgin(aic)
}
acb->xs->resid = acb->dleft = aic->dleft;
aic->flags |= AIC_BUSFREE_OK;
untimeout(aic_timeout, (caddr_t)acb);
untimeout(aic_timeout, (caddr_t)acb,
acb->xs->timeout_ch);
aic_done(acb);
break;
case MSG_MESSAGE_REJECT:
@ -2122,7 +2126,8 @@ aicintr(int unit)
*/
printf("aic: unexpected busfree\n");
acb->xs->error = XS_DRIVER_STUFFUP;
untimeout(aic_timeout, (caddr_t)acb);
untimeout(aic_timeout, (caddr_t)acb,
acb->xs->timeout_ch);
aic_done(acb);
}
LOGLINE(aic);
@ -2144,7 +2149,8 @@ aicintr(int unit)
outb(CLRSINT1, CLRSELTIMO);
aic->state = AIC_IDLE;
acb->xs->error = XS_TIMEOUT;
untimeout(aic_timeout, (caddr_t)acb);
untimeout(aic_timeout, (caddr_t)acb,
acb->xs->timeout_ch);
aic_done(acb);
LOGLINE(aic);
outb(DMACNTRL0, INTEN);
@ -2226,7 +2232,8 @@ aicintr(int unit)
Debugger("aic6360");
fatal_if_no_DDB();
acb->xs->error = XS_DRIVER_STUFFUP;
untimeout(aic_timeout, (caddr_t)acb);
untimeout(aic_timeout, (caddr_t)acb,
acb->xs->timeout_ch);
aic_done(acb);
aic_init(aic);
return;
@ -2244,7 +2251,8 @@ aicintr(int unit)
Debugger("aic6360");
fatal_if_no_DDB();
acb->xs->error = XS_DRIVER_STUFFUP;
untimeout(aic_timeout, (caddr_t)acb);
untimeout(aic_timeout, (caddr_t)acb,
acb->xs->timeout_ch);
aic_done(acb);
aic_init(aic);
return;

View File

@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
* $Id: apic_vector.s,v 1.37 1997/09/07 19:23:45 smp Exp smp $
* $Id: apic_vector.s,v 1.21 1997/09/07 22:02:36 fsmp Exp $
*/
@ -498,6 +498,8 @@ MCOUNT_LABEL(eintr)
* Addresses of interrupt handlers.
* XresumeNN: Resumption addresses for HWIs.
*/
.globl _ihandlers
_ihandlers:
ihandlers:
/*
* used by:
@ -514,15 +516,16 @@ ihandlers:
* ipl.s: doreti_unpend
* apic_ipl.s: splz_unpend
*/
.long swi_tty, swi_net
.long 0, 0, 0, 0
.long swi_tty, swi_net, dummycamisr, dummycamisr
.long 0, 0
.long _softclock, swi_ast
imasks: /* masks for interrupt handlers */
.space NHWI*4 /* padding; HWI masks are elsewhere */
.long SWI_TTY_MASK, SWI_NET_MASK
.long 0, 0, 0, 0
.long SWI_CAMNET_MASK, SWI_CAMBIO_MASK
.long 0, 0
.long SWI_CLOCK_MASK, SWI_AST_MASK
/*

View File

@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
* $Id: icu_vector.s,v 1.3 1997/07/24 03:24:57 fsmp Exp $
* $Id: icu_vector.s,v 1.4 1997/09/08 06:40:58 peter Exp $
*/
/*
@ -194,20 +194,22 @@ MCOUNT_LABEL(bintr)
MCOUNT_LABEL(eintr)
.data
.globl _ihandlers
_ihandlers:
ihandlers: /* addresses of interrupt handlers */
/* actually resumption addresses for HWI's */
.long Xresume0, Xresume1, Xresume2, Xresume3
.long Xresume4, Xresume5, Xresume6, Xresume7
.long Xresume8, Xresume9, Xresume10, Xresume11
.long Xresume12, Xresume13, Xresume14, Xresume15
.long swi_tty, swi_net
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long swi_tty, swi_net, dummycamisr, dummycamisr
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long _softclock, swi_ast
imasks: /* masks for interrupt handlers */
.space NHWI*4 /* padding; HWI masks are elsewhere */
.long SWI_TTY_MASK, SWI_NET_MASK
.long SWI_TTY_MASK, SWI_NET_MASK, SWI_CAMNET_MASK, SWI_CAMBIO_MASK
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long SWI_CLOCK_MASK, SWI_AST_MASK

View File

@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: cy.c,v 1.53 1997/09/03 01:50:24 bde Exp $
* $Id: cy.c,v 1.54 1997/09/14 03:19:08 peter Exp $
*/
#include "cy.h"
@ -137,6 +137,7 @@
#define siowrite cywrite
#define sio_timeout cy_timeout
#define sio_timeouts_until_log cy_timeouts_until_log
#define sio_timeout_handle cy_timeout_handle
#define sio_tty cy_tty
#define CY_MAX_PORTS (CD1400_NO_OF_CHANNELS * CY_MAX_CD1400s)
@ -390,6 +391,8 @@ static speed_t comdefaultrate = TTYDEF_SPEED;
static u_int com_events; /* input chars + weighted output completions */
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[NSIO];
#else
@ -2305,7 +2308,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 < NSIO; ++unit) {
@ -2323,12 +2326,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);
}
}
@ -2339,7 +2343,7 @@ comwakeup(chan)
struct com_s *com;
int unit;
timeout(comwakeup, (void *)NULL, sio_timeout);
sio_timeout_handle = timeout(comwakeup, (void *)NULL, sio_timeout);
#if 0
/*

View File

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

View File

@ -17,7 +17,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* ft.c - QIC-40/80 floppy tape driver
* $Id: ft.c,v 1.34 1997/07/20 14:09:55 bde Exp $
* $Id: ft.c,v 1.35 1997/09/07 04:21:20 bde Exp $
*
* 01/19/95 ++sg
* Cleaned up recalibrate/seek code at attach time for FreeBSD 2.x.
@ -269,7 +269,7 @@ static struct ft_data {
int lastpos; /* last known segment number */
int moving; /* TRUE if tape is moving */
int rid[7]; /* read_id return values */
struct callout_handle tohandle;
} *ft_data[NFT];
/***********************************************************************\
@ -414,6 +414,7 @@ ftattach(isadev, fdup, unithasfd)
if (ftu >= NFT) return 0;
ft = ft_data[ftu] = malloc(sizeof *ft, M_DEVBUF, M_NOWAIT);
bzero(ft, sizeof *ft);
callout_handle_init(&ft->tohandle);
/* Probe for tape */
ft->attaching = 1;
@ -585,7 +586,7 @@ async_cmd(ftu_t ftu) {
DPRT(("ft%d: async_cmd command bad st0=$%02x pcn=$%02x\n",
ftu, st0, pcn));
async_state = 0;
timeout(ft_timeout, (caddr_t)ftu, hz/10);
ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10);
break;
}
if (st0 & 0x20) { /* seek done */
@ -598,7 +599,7 @@ async_cmd(ftu_t ftu) {
#endif
if (async_arg1) goto complete;
async_state = 2;
timeout(ft_timeout, (caddr_t)ftu, hz/50);
ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/50);
break;
case 2:
goto complete;
@ -693,7 +694,7 @@ async_cmd(ftu_t ftu) {
DPRT(("ft%d: acmd_state exceeded retry count\n", ftu));
goto complete;
}
timeout(ft_timeout, (caddr_t)ftu, hz/4);
ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/4);
break;
}
break;
@ -719,7 +720,7 @@ async_cmd(ftu_t ftu) {
goto complete;
}
async_state = 1;
timeout(ft_timeout, (caddr_t)ftu, hz/4);
ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/4);
break;
}
break;
@ -792,7 +793,7 @@ async_cmd(ftu_t ftu) {
case 5:
ft->moving = 1;
async_state = 0;
timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
break;
}
break;
@ -885,7 +886,7 @@ async_cmd(ftu_t ftu) {
break;
case 8:
async_state = 9;
timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
break;
case 9:
goto complete;
@ -1064,7 +1065,7 @@ async_req(ftu_t ftu, int from)
case 6:
arq_state = 1;
timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
break;
case 7:
@ -1188,7 +1189,7 @@ async_read(ftu_t ftu, int from)
case 4:
ard_state = 1;
timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
break;
default:
@ -1314,7 +1315,7 @@ async_write(ftu_t ftu, int from)
case 4:
awr_state = 1;
timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, hz/10); /* XXX */
break;
default:
@ -1483,7 +1484,8 @@ ftintr_wait(ftu_t ftu, int cmd, int ticks)
}
/* got interrupt */
if (ft->attaching == 0 && ticks) untimeout(ft_timeout, (caddr_t)ftu);
if (ft->attaching == 0 && ticks)
untimeout(ft_timeout, (caddr_t)ftu, ft->tohandle);
ft->cmd_wait = FTCMD_NONE;
ft->sts_wait = FTSTS_NONE;
return(0);
@ -1768,7 +1770,7 @@ tape_inactive(ftu_t ftu)
ft->xcnt = 0;
ft->xptr = ft->segh->buff;
ft->active = 1;
timeout(ft_timeout, (caddr_t)ftu, 1);
ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, 1);
}
}
while (ft->active) ftsleep(wc_iosts_change, 0);
@ -2210,7 +2212,7 @@ ftreq_rw(ftu_t ftu, int cmd, QIC_Segment *sr, struct proc *p)
ft->xcnt = 0;
ft->xptr = sp->buff;
ft->active = 1;
timeout(ft_timeout, (caddr_t)ftu, 1);
ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, 1);
rdwait:
ftsleep(wc_buff_done, 0);
@ -2241,7 +2243,7 @@ ftreq_rw(ftu_t ftu, int cmd, QIC_Segment *sr, struct proc *p)
ft->xcnt = 0;
ft->xptr = ft->segh->buff;
ft->active = 1;
timeout(ft_timeout, (caddr_t)ftu, 1);
ft->tohandle = timeout(ft_timeout, (caddr_t)ftu, 1);
}
/* Sleep until a buffer becomes available. */

View File

@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
* $Id: icu_vector.s,v 1.3 1997/07/24 03:24:57 fsmp Exp $
* $Id: icu_vector.s,v 1.4 1997/09/08 06:40:58 peter Exp $
*/
/*
@ -194,20 +194,22 @@ MCOUNT_LABEL(bintr)
MCOUNT_LABEL(eintr)
.data
.globl _ihandlers
_ihandlers:
ihandlers: /* addresses of interrupt handlers */
/* actually resumption addresses for HWI's */
.long Xresume0, Xresume1, Xresume2, Xresume3
.long Xresume4, Xresume5, Xresume6, Xresume7
.long Xresume8, Xresume9, Xresume10, Xresume11
.long Xresume12, Xresume13, Xresume14, Xresume15
.long swi_tty, swi_net
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long swi_tty, swi_net, dummycamisr, dummycamisr
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long _softclock, swi_ast
imasks: /* masks for interrupt handlers */
.space NHWI*4 /* padding; HWI masks are elsewhere */
.long SWI_TTY_MASK, SWI_NET_MASK
.long SWI_TTY_MASK, SWI_NET_MASK, SWI_CAMNET_MASK, SWI_CAMBIO_MASK
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.long SWI_CLOCK_MASK, SWI_AST_MASK

View File

@ -47,7 +47,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: if_ie.c,v 1.44 1997/07/20 14:09:59 bde Exp $
* $Id: if_ie.c,v 1.45 1997/09/02 01:18:14 bde Exp $
*/
/*
@ -1915,6 +1915,7 @@ command_and_wait(int unit, int cmd, volatile void *pcmd, int mask)
{
volatile struct ie_cmd_common *cc = pcmd;
volatile int timedout = 0;
struct callout_handle ch;
ie_softc[unit].scb->ie_command = (u_short) cmd;
@ -1925,7 +1926,8 @@ command_and_wait(int unit, int cmd, volatile void *pcmd, int mask)
* According to the packet driver, the minimum timeout
* should be .369 seconds, which we round up to .37.
*/
timeout(chan_attn_timeout, (caddr_t)&timedout, 37 * hz / 100);
ch = timeout(chan_attn_timeout, (caddr_t)&timedout,
37 * hz / 100);
/* ignore cast-qual */
/*
@ -1940,7 +1942,7 @@ command_and_wait(int unit, int cmd, volatile void *pcmd, int mask)
break;
}
untimeout(chan_attn_timeout, (caddr_t)&timedout);
untimeout(chan_attn_timeout, (caddr_t)&timedout, ch);
/* ignore cast-qual */
return (timedout);

View File

@ -1,4 +1,4 @@
/* $Id: if_wl.c,v 1.7 1997/08/02 05:19:32 msmith Exp $ */
/* $Id: if_wl.c,v 1.8 1997/08/25 22:34:25 bde Exp $ */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -247,6 +247,7 @@ struct wl_softc{
short mode;
u_char chan24; /* 2.4 Gz: channel number/EEPROM Area # */
u_short freq24; /* 2.4 Gz: resulting frequency */
struct callout_handle watchdog_ch;
#ifdef WLCACHE
int w_sigitems; /* number of cached entries */
/* array of cache entries */
@ -447,6 +448,7 @@ wlattach(struct isa_device *id)
sc->flags = 0;
sc->mode = 0;
sc->hacr = HACR_RESET;
callout_handle_init(&sc->watchdog_ch);
CMD(unit); /* reset the board */
DELAY(DELAYCONST); /* >> 4 clocks at 6MHz */
@ -696,7 +698,7 @@ wlinit(void *xsc)
sc->flags |= DSF_RUNNING;
sc->tbusy = 0;
untimeout(wlwatchdog, sc);
untimeout(wlwatchdog, sc, sc->watchdog_ch);
wlstart(ifp);
} else {
@ -867,7 +869,7 @@ wlstart(struct ifnet *ifp)
if((scb_status & 0x0700) == SCB_CUS_IDLE &&
(cu_status & AC_SW_B) == 0){
sc->tbusy = 0;
untimeout(wlwatchdog, sc);
untimeout(wlwatchdog, sc, sc->watchdog_ch);
sc->wl_ac.ac_if.if_flags &= ~IFF_OACTIVE;
/*
* This is probably just a race. The xmt'r is just
@ -906,7 +908,7 @@ wlstart(struct ifnet *ifp)
* fails to interrupt we will restart
*/
/* try 10 ticks, not very long */
timeout(wlwatchdog, sc, 10);
sc->watchdog_ch = timeout(wlwatchdog, sc, 10);
sc->wl_ac.ac_if.if_flags |= IFF_OACTIVE;
sc->wl_if.if_opackets++;
wlxmt(unit, m);
@ -1605,7 +1607,7 @@ int unit;
}
}
sc->tbusy = 0;
untimeout(wlwatchdog, sc);
untimeout(wlwatchdog, sc, sc->watchdog_ch);
sc->wl_ac.ac_if.if_flags &= ~IFF_OACTIVE;
wlstart(&(sc->wl_if));
}

View File

@ -34,7 +34,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* From: if_ep.c,v 1.9 1994/01/25 10:46:29 deraadt Exp $
* $Id: if_zp.c,v 1.37 1997/04/21 13:38:32 nate Exp $
* $Id: if_zp.c,v 1.38 1997/07/20 14:10:02 bde Exp $
*/
/*-
* TODO:
@ -179,6 +179,8 @@ static struct zp_softc {
u_char last_alive; /* information for reconfiguration */
u_char last_up; /* information for reconfiguration */
int slot; /* PCMCIA slot */
struct callout_handle ch; /* Callout handle for timeouts */
int buffill_pending;
#if NAPM > 0
struct apmhook s_hook; /* reconfiguration support */
struct apmhook r_hook; /* reconfiguration support */
@ -506,6 +508,9 @@ zpattach(isa_dev)
sc->ep_io_addr = isa_dev->id_iobase;
printf("zp%d: ", isa_dev->id_unit);
sc->buffill_pending = 0;
callout_handle_init(&sc->ch);
sc->ep_connectors = 0;
i = inw(isa_dev->id_iobase + EP_W0_CONFIG_CTRL);
@ -663,6 +668,10 @@ zpinit(unit)
* somewhere else. */
sc->last_mb = 0;
sc->next_mb = 0;
if (sc->buffill_pending != 0) {
untimeout(zpmbuffill, sc, sc->ch);
sc->buffill_pending = 0;
}
zpmbuffill(sc);
zpstart(ifp);
splx(s);
@ -900,8 +909,9 @@ zpread(sc)
MGET(m, M_DONTWAIT, MT_DATA);
if (m == 0)
goto out;
} else {
timeout(zpmbuffill, sc, 0);
} else if (sc->buffill_pending == 0) {
sc->ch = timeout(zpmbuffill, sc, 0);
sc->buffill_pending = 1;
sc->next_mb = (sc->next_mb + 1) % MAX_MBS;
}
if (totlen >= MINCLSIZE)
@ -1139,6 +1149,7 @@ zpmbuffill(sp)
break;
i = (i + 1) % MAX_MBS;
} while (i != sc->next_mb);
sc->buffill_pending = 0;
sc->last_mb = i;
splx(s);
}
@ -1157,6 +1168,9 @@ zpmbufempty(sc)
}
}
sc->last_mb = sc->next_mb = 0;
untimeout(zpmbuffill, sc);
if (sc->buffill_pending != 0) {
untimeout(zpmbuffill, sc, sc->ch);
sc->buffill_pending = 0;
}
splx(s);
}

View File

@ -36,7 +36,7 @@
*
* @(#)ipl.s
*
* $Id: ipl.s,v 1.21 1997/09/07 21:47:45 smp Exp smp $
* $Id: ipl.s,v 1.13 1997/09/07 22:02:56 fsmp Exp $
*/
@ -55,9 +55,11 @@ _cpl: .long HWI_MASK | SWI_MASK
.globl _tty_imask
_tty_imask: .long 0
.globl _bio_imask
_bio_imask: .long 0
_bio_imask: .long SWI_CAMBIO_MASK
.globl _cam_imask
_cam_imask: .long SWI_CAMBIO_MASK | SWI_CAMNET_MASK
.globl _net_imask
_net_imask: .long 0
_net_imask: .long SWI_CAMNET_MASK
.globl _soft_imask
_soft_imask: .long SWI_MASK
.globl _softnet_imask
@ -341,6 +343,11 @@ dummynetisr:
MCOUNT
ret
ALIGN_TEXT
dummycamisr:
MCOUNT
ret
/*
* XXX there should be a registration function to put the handler for the
* attached driver directly in ihandlers. Then this function will go away.

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ipl_funcs.c,v 1.14 1997/09/05 20:22:10 smp Exp smp $
* $Id: ipl_funcs.c,v 1.8 1997/09/07 22:03:05 fsmp Exp $
*/
#include <sys/types.h>
@ -47,9 +47,13 @@ DO_SETBITS(setsoftast, &ipending, SWI_AST_PENDING)
DO_SETBITS(setsoftclock, &ipending, SWI_CLOCK_PENDING)
DO_SETBITS(setsoftnet, &ipending, SWI_NET_PENDING)
DO_SETBITS(setsofttty, &ipending, SWI_TTY_PENDING)
DO_SETBITS(setsoftcamnet,&ipending, SWI_CAMNET_PENDING)
DO_SETBITS(setsoftcambio,&ipending, SWI_CAMBIO_PENDING)
DO_SETBITS(schedsoftnet, &idelayed, SWI_NET_PENDING)
DO_SETBITS(schedsofttty, &idelayed, SWI_TTY_PENDING)
DO_SETBITS(schedsoftcamnet, &idelayed, SWI_CAMNET_PENDING)
DO_SETBITS(schedsoftcambio, &idelayed, SWI_CAMBIO_PENDING)
unsigned
softclockpending(void)
@ -72,6 +76,10 @@ GENSPL(splclock, cpl = HWI_MASK | SWI_MASK)
GENSPL(splhigh, cpl = HWI_MASK | SWI_MASK)
GENSPL(splimp, cpl |= net_imask)
GENSPL(splnet, cpl |= SWI_NET_MASK)
GENSPL(splcam, cpl |= cam_imask)
GENSPL(splsoftcam, cpl |= SWI_CAMBIO_MASK | SWI_CAMNET_MASK)
GENSPL(splsoftcambio, cpl |= SWI_CAMBIO_MASK)
GENSPL(splsoftcamnet, cpl |= SWI_CAMNET_MASK)
GENSPL(splsoftclock, cpl = SWI_CLOCK_MASK)
GENSPL(splsofttty, cpl |= SWI_TTY_MASK)
GENSPL(splstatclock, cpl |= stat_imask)
@ -127,9 +135,13 @@ DO_SETBITS(setsoftast, &ipending, SWI_AST_PENDING)
DO_SETBITS(setsoftclock, &ipending, SWI_CLOCK_PENDING)
DO_SETBITS(setsoftnet, &ipending, SWI_NET_PENDING)
DO_SETBITS(setsofttty, &ipending, SWI_TTY_PENDING)
DO_SETBITS(setsoftcamnet,&ipending, SWI_CAMNET_PENDING)
DO_SETBITS(setsoftcambio,&ipending, SWI_CAMBIO_PENDING)
DO_SETBITS(schedsoftnet, &idelayed, SWI_NET_PENDING)
DO_SETBITS(schedsofttty, &idelayed, SWI_TTY_PENDING)
DO_SETBITS(schedsoftcamnet, &idelayed, SWI_CAMNET_PENDING)
DO_SETBITS(schedsoftcambio, &idelayed, SWI_CAMBIO_PENDING)
unsigned
softclockpending(void)
@ -202,17 +214,21 @@ unsigned NAME(void) \
return (x); \
}
/* NAME: OP: MODIFIER: PC: */
GENSPL(splbio, |=, bio_imask, 2)
GENSPL(splclock, =, HWI_MASK | SWI_MASK, 3)
GENSPL(splhigh, =, HWI_MASK | SWI_MASK, 4)
GENSPL(splimp, |=, net_imask, 5)
GENSPL(splnet, |=, SWI_NET_MASK, 6)
GENSPL(splsoftclock, =, SWI_CLOCK_MASK, 7)
GENSPL(splsofttty, |=, SWI_TTY_MASK, 8)
GENSPL(splstatclock, |=, stat_imask, 9)
GENSPL(spltty, |=, tty_imask, 10)
GENSPL(splvm, |=, net_imask | bio_imask, 11)
/* NAME: OP: MODIFIER: PC: */
GENSPL(splbio, |=, bio_imask, 2)
GENSPL(splclock, =, HWI_MASK | SWI_MASK, 3)
GENSPL(splhigh, =, HWI_MASK | SWI_MASK, 4)
GENSPL(splimp, |=, net_imask, 5)
GENSPL(splnet, |=, SWI_NET_MASK, 6)
GENSPL(splcam, |=, cam_imask, 7)
GENSPL(splsoftcam, |=, SWI_CAMBIO_MASK | SWI_CAMNET_MASK, 8)
GENSPL(splsoftcambio, |=, SWI_CAMBIO_MASK, 9)
GENSPL(splsoftcamnet, |=, SWI_CAMNET_MASK 10)
GENSPL(splsoftclock, =, SWI_CLOCK_MASK, 11)
GENSPL(splsofttty, |=, SWI_TTY_MASK, 12)
GENSPL(splstatclock, |=, stat_imask, 13)
GENSPL(spltty, |=, tty_imask, 14)
GENSPL(splvm, |=, net_imask | bio_imask, 15)
#else /* INTR_SPL */
@ -240,6 +256,10 @@ GENSPL(splclock, cpl = HWI_MASK | SWI_MASK)
GENSPL(splhigh, cpl = HWI_MASK | SWI_MASK)
GENSPL(splimp, cpl |= net_imask)
GENSPL(splnet, cpl |= SWI_NET_MASK)
GENSPL(splcam, cpl |= cam_imask)
GENSPL(splsoftcam, cpl |= SWI_CAMBIO_MASK | SWI_CAMNET_MASK)
GENSPL(splsoftcambio, cpl |= SWI_CAMBIO_MASK)
GENSPL(splsoftcamnet, cpl |= SWI_CAMNET_MASK)
GENSPL(splsoftclock, cpl = SWI_CLOCK_MASK)
GENSPL(splsofttty, cpl |= SWI_TTY_MASK)
GENSPL(splstatclock, cpl |= stat_imask)

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
* $Id: isa.c,v 1.103 1997/08/28 03:36:40 msmith Exp $
* $Id: isa.c,v 1.104 1997/09/19 15:20:23 jmg Exp $
*/
/*
@ -319,6 +319,11 @@ haveseen_isadev(dvp, checkbits)
if (status)
return status;
}
for (tmpdvp = isa_devtab_cam; tmpdvp->id_driver; tmpdvp++) {
status |= haveseen(dvp, tmpdvp, checkbits);
if (status)
return status;
}
for (tmpdvp = isa_devtab_null; tmpdvp->id_driver; tmpdvp++) {
status |= haveseen(dvp, tmpdvp, checkbits);
if (status)
@ -358,6 +363,9 @@ isa_configure() {
for (dvp = isa_devtab_net; dvp->id_driver; dvp++)
if (dvp->id_driver->sensitive_hw)
config_isadev(dvp, &net_imask);
for (dvp = isa_devtab_cam; dvp->id_driver; dvp++)
if (dvp->id_driver->sensitive_hw)
config_isadev(dvp, &cam_imask);
for (dvp = isa_devtab_null; dvp->id_driver; dvp++)
if (dvp->id_driver->sensitive_hw)
config_isadev(dvp, (u_int *)NULL);
@ -372,6 +380,9 @@ isa_configure() {
for (dvp = isa_devtab_net; dvp->id_driver; dvp++)
if (!dvp->id_driver->sensitive_hw)
config_isadev(dvp, &net_imask);
for (dvp = isa_devtab_cam; dvp->id_driver; dvp++)
if (!dvp->id_driver->sensitive_hw)
config_isadev(dvp, &cam_imask);
for (dvp = isa_devtab_null; dvp->id_driver; dvp++)
if (!dvp->id_driver->sensitive_hw)
config_isadev(dvp, (u_int *)NULL);
@ -416,6 +427,8 @@ isa_configure() {
register_imask(dvp, bio_imask);
for (dvp = isa_devtab_net; dvp->id_driver; dvp++)
register_imask(dvp, net_imask);
for (dvp = isa_devtab_cam; dvp->id_driver; dvp++)
register_imask(dvp, cam_imask);
for (dvp = isa_devtab_null; dvp->id_driver; dvp++)
register_imask(dvp, SWI_CLOCK_MASK);
spl0();

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa_device.h 7.1 (Berkeley) 5/9/91
* $Id: isa_device.h,v 1.45 1997/07/24 18:05:22 fsmp Exp $
* $Id: isa_device.h,v 1.46 1997/08/28 03:37:46 msmith Exp $
*/
#ifndef _I386_ISA_ISA_DEVICE_H_
@ -101,6 +101,7 @@ extern struct isa_device isa_biotab_fdc[];
extern struct isa_device isa_biotab_wdc[];
extern struct isa_device isa_devtab_bio[];
extern struct isa_device isa_devtab_net[];
extern struct isa_device isa_devtab_cam[];
extern struct isa_device isa_devtab_null[];
extern struct isa_device isa_devtab_tty[];

View File

@ -140,6 +140,11 @@ struct ctlr
*/
u_char dcr_val, dcr_is;
/*
* Handle for canceling our timeout.
*/
struct callout_handle ch;
/* Device configuration structure:
*/
#ifdef DEVFS
@ -314,7 +319,7 @@ done_and_start_next(struct ctlr *ctlr, struct buf *bp, int err)
ctlr->start_queue.b_actf = bp->b_actf;
bp_done(bp, err);
untimeout(tmo_stop, ctlr);
untimeout(tmo_stop, ctlr, ctlr->ch);
start(ctlr);
}
@ -388,7 +393,6 @@ labpcinit(void)
if (labpcs)
{
bzero(labpcs, NLABPC * sizeof(struct cltr *));
return 1;
}
return 0;
}
@ -464,6 +468,7 @@ labpcattach(struct isa_device *dev)
{
struct ctlr *ctlr = labpcs[dev->id_unit];
callout_handle_init(&ctlr->ch);
ctlr->sample_us = (1000000.0 / (double)LABPC_DEFAULT_HERZ) + .50;
reset(ctlr);
@ -796,7 +801,7 @@ start(struct ctlr *ctlr)
(*ctlr->intr)(ctlr);
}
timeout(tmo_stop, ctlr, ctlr->tmo);
ctlr->ch = timeout(tmo_stop, ctlr, ctlr->tmo);
}
static void

View File

@ -40,7 +40,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: mcd.c,v 1.92 1997/06/01 16:03:13 peter Exp $
* $Id: mcd.c,v 1.93 1997/07/20 14:10:06 bde Exp $
*/
static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
@ -242,7 +242,7 @@ int mcd_attach(struct isa_device *dev)
cd->iobase = dev->id_iobase;
cd->flags |= MCDINIT;
mcd_soft_reset(unit);
TAILQ_INIT(&cd->head);
bufq_init(&cd->head);
#ifdef NOTYET
/* wire controller for interrupts and dma */
@ -440,7 +440,7 @@ MCD_TRACE("strategy: drive not valid\n");
/* queue it */
s = splbio();
tqdisksort(&cd->head, bp);
bufqdisksort(&cd->head, bp);
splx(s);
/* now check whether we can perform processing */
@ -467,11 +467,11 @@ static void mcd_start(int unit)
return;
}
bp = TAILQ_FIRST(&cd->head);
bp = bufq_first(&cd->head);
if (bp != 0) {
/* block found to process, dequeue */
/*MCD_TRACE("mcd_start: found block bp=0x%x\n",bp,0,0,0);*/
TAILQ_REMOVE(&cd->head, bp, b_act);
bufq_remove(&cd->head, bp);
splx(s);
} else {
/* nothing to do */
@ -975,6 +975,7 @@ mcdintr(unit)
* MCD_S_WAITREAD: wait for read ready, read data
*/
static struct mcd_mbx *mbxsave;
static struct callout_handle tohandle = CALLOUT_HANDLE_INITIALIZER(&tohandle);
static void
mcd_timeout(void *arg)
@ -1008,11 +1009,11 @@ mcd_doread(int state, struct mcd_mbx *mbxin)
/* get status */
outb(com_port, MCD_CMDGETSTAT);
mbx->count = RDELAY_WAITSTAT;
timeout(mcd_timeout,
(caddr_t)MCD_S_WAITSTAT,hz/100); /* XXX */
tohandle = timeout(mcd_timeout,
(caddr_t)MCD_S_WAITSTAT,hz/100); /* XXX */
return;
case MCD_S_WAITSTAT:
untimeout(mcd_timeout,(caddr_t)MCD_S_WAITSTAT);
untimeout(mcd_timeout,(caddr_t)MCD_S_WAITSTAT, tohandle);
if (mbx->count-- >= 0) {
if (inb(port+MCD_FLAGS) & MFL_STATUS_NOT_AVAIL) {
timeout(mcd_timeout,
@ -1052,8 +1053,8 @@ mcd_doread(int state, struct mcd_mbx *mbxin)
mcd_put(com_port, MCD_CMDSETMODE);
mcd_put(com_port, rm);
timeout(mcd_timeout,
(caddr_t)MCD_S_WAITMODE,hz/100); /* XXX */
tohandle = timeout(mcd_timeout,
(caddr_t)MCD_S_WAITMODE,hz/100); /* XXX */
return;
} else {
printf("mcd%d: timeout getstatus\n",unit);
@ -1061,13 +1062,14 @@ mcd_doread(int state, struct mcd_mbx *mbxin)
}
case MCD_S_WAITMODE:
untimeout(mcd_timeout,(caddr_t)MCD_S_WAITMODE);
untimeout(mcd_timeout,(caddr_t)MCD_S_WAITMODE, tohandle);
if (mbx->count-- < 0) {
printf("mcd%d: timeout set mode\n",unit);
goto readerr;
}
if (inb(port+MCD_FLAGS) & MFL_STATUS_NOT_AVAIL) {
timeout(mcd_timeout,(caddr_t)MCD_S_WAITMODE,hz/100);
tohandle = timeout(mcd_timeout,
(caddr_t)MCD_S_WAITMODE,hz/100);
return;
}
cd->status = inb(port+mcd_status) & 0xFF;
@ -1115,11 +1117,11 @@ mcd_doread(int state, struct mcd_mbx *mbxin)
}
mbx->count = RDELAY_WAITREAD;
timeout(mcd_timeout,
(caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
tohandle = timeout(mcd_timeout,
(caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
return;
case MCD_S_WAITREAD:
untimeout(mcd_timeout,(caddr_t)MCD_S_WAITREAD);
untimeout(mcd_timeout,(caddr_t)MCD_S_WAITREAD, tohandle);
if (mbx->count-- > 0) {
k = inb(port+MCD_FLAGS);
if (!(k & MFL_DATA_NOT_AVAIL)) { /* XXX */
@ -1163,8 +1165,8 @@ mcd_doread(int state, struct mcd_mbx *mbxin)
if (mcd_setflags(unit,cd) < 0)
goto changed;
}
timeout(mcd_timeout,
(caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
tohandle = timeout(mcd_timeout,
(caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
return;
} else {
printf("mcd%d: timeout read data\n",unit);

View File

@ -624,7 +624,8 @@ int32_t nca_scsi_cmd (struct scsi_xfer *xs)
* Tried to return COMPLETE but the machine hanged
* with this. */
return (SUCCESSFULLY_QUEUED);
timeout (nca_timeout, (caddr_t) scb, (xs->timeout * hz) / 1000);
xs->timeout_ch = timeout (nca_timeout, (caddr_t) scb,
(xs->timeout * hz) / 1000);
scb->flags |= SCB_TIMECHK;
PRINT (("nca%d/%d/%d command queued\n", unit,
xs->sc_link->target, xs->sc_link->lun));
@ -640,7 +641,7 @@ int32_t nca_scsi_cmd (struct scsi_xfer *xs)
/* Because we are polling, take out the timeout entry
* nca_timeout made. */
untimeout (nca_timeout, (void*) scb);
untimeout (nca_timeout, (void*) scb, scb->xfer->timeout_ch);
if (! nca_poll (z, scb))
/* We timed out again... This is bad. Notice that
@ -708,7 +709,8 @@ void nca_timeout (void *arg)
if (! (scb->flags & SCB_ABORTED)) {
nca_abort (z, scb);
/* 2 seconds for the abort */
timeout (nca_timeout, (caddr_t)scb, 2*hz);
scb->xfer->timeout_ch = timeout (nca_timeout, (caddr_t)scb,
2*hz);
scb->flags |= (SCB_ABORTED | SCB_TIMECHK);
} else {
/* abort timed out */
@ -987,7 +989,7 @@ void nca_done (adapter_t *z, scb_t *scb)
struct scsi_xfer *xs = scb->xfer;
if (scb->flags & SCB_TIMECHK)
untimeout (nca_timeout, (caddr_t) scb);
untimeout (nca_timeout, (caddr_t) scb, xs->timeout_ch);
/* How much of the buffer was not touched. */
xs->resid = scb->datalen;

View File

@ -41,7 +41,7 @@
*/
/* $Id: scd.c,v 1.31 1997/05/10 12:13:13 joerg Exp $ */
/* $Id: scd.c,v 1.32 1997/07/20 14:10:10 bde Exp $ */
/* Please send any comments to micke@dynas.se */
@ -181,6 +181,9 @@ static int scd_probe(struct isa_device *dev);
static int scd_attach(struct isa_device *dev);
struct isa_driver scddriver = { scd_probe, scd_attach, "scd" };
/* For canceling our timeout */
static struct callout_handle tohandle = CALLOUT_HANDLE_INITIALIZER(&tohanle);
static d_open_t scdopen;
static d_close_t scdclose;
static d_ioctl_t scdioctl;
@ -207,7 +210,7 @@ int scd_attach(struct isa_device *dev)
cd->flags = SCDINIT;
cd->audio_status = CD_AS_AUDIO_INVALID;
TAILQ_INIT(&cd->head);
bufq_init(&cd->head);
#ifdef DEVFS
cd->ra_devfs_token =
@ -360,7 +363,7 @@ scdstrategy(struct buf *bp)
/* queue it */
s = splbio();
tqdisksort(&cd->head, bp);
bufqdisksort(&cd->head, bp);
splx(s);
/* now check whether we can perform processing */
@ -388,10 +391,10 @@ scd_start(int unit)
return;
}
bp = TAILQ_FIRST(&cd->head);
bp = bufq_first(&cd->head);
if (bp != 0) {
/* block found to process, dequeue */
TAILQ_REMOVE(&cd->head, bp, b_act);
bufq_remove(&cd->head, bp);
cd->flags |= SCDMBXBSY;
splx(s);
} else {
@ -806,7 +809,7 @@ scd_doread(int state, struct scd_mbx *mbxin)
goto trystat;
case SCD_S_WAITSTAT:
untimeout(scd_timeout,(caddr_t)SCD_S_WAITSTAT);
untimeout(scd_timeout,(caddr_t)SCD_S_WAITSTAT, tohandle);
if (mbx->count-- <= 0) {
printf("scd%d: timeout. drive busy.\n",unit);
goto harderr;
@ -814,8 +817,8 @@ scd_doread(int state, struct scd_mbx *mbxin)
trystat:
if (IS_BUSY(port)) {
timeout(scd_timeout,
(caddr_t)SCD_S_WAITSTAT,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITSTAT,hz/100); /* XXX */
return;
}
@ -853,19 +856,19 @@ scd_doread(int state, struct scd_mbx *mbxin)
goto writeparam;
mbx->count = 100;
timeout(scd_timeout,
(caddr_t)SCD_S_WAITFIFO,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITFIFO,hz/100); /* XXX */
return;
case SCD_S_WAITSPIN:
untimeout(scd_timeout,(caddr_t)SCD_S_WAITSPIN);
untimeout(scd_timeout,(caddr_t)SCD_S_WAITSPIN, tohandle);
if (mbx->count-- <= 0) {
printf("scd%d: timeout waiting for drive to spin up.\n", unit);
goto harderr;
}
if (!STATUS_BIT(port, SBIT_RESULT_READY)) {
timeout(scd_timeout,
(caddr_t)SCD_S_WAITSPIN,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITSPIN,hz/100); /* XXX */
return;
}
write_control(port, CBIT_RESULT_READY_CLEAR);
@ -885,14 +888,14 @@ scd_doread(int state, struct scd_mbx *mbxin)
goto loop;
case SCD_S_WAITFIFO:
untimeout(scd_timeout,(caddr_t)SCD_S_WAITFIFO);
untimeout(scd_timeout,(caddr_t)SCD_S_WAITFIFO, tohandle);
if (mbx->count-- <= 0) {
printf("scd%d: timeout. write param not ready.\n",unit);
goto harderr;
}
if (!FSTATUS_BIT(port, FBIT_WPARAM_READY)) {
timeout(scd_timeout,
(caddr_t)SCD_S_WAITFIFO,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITFIFO,hz/100); /* XXX */
return;
}
XDEBUG(1, ("scd%d: mbx->count (writeparamwait) = %d(%d)\n", unit, mbx->count, 100));
@ -904,8 +907,8 @@ scd_doread(int state, struct scd_mbx *mbxin)
XDEBUG(1, ("scd%d: spinning up drive ...\n", unit));
outb(port+OREG_COMMAND, CMD_SPIN_UP);
mbx->count = 300;
timeout(scd_timeout,
(caddr_t)SCD_S_WAITSPIN,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITSPIN,hz/100); /* XXX */
return;
}
@ -928,12 +931,12 @@ scd_doread(int state, struct scd_mbx *mbxin)
DELAY(100);
}
timeout(scd_timeout,
(caddr_t)SCD_S_WAITREAD,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITREAD,hz/100); /* XXX */
return;
case SCD_S_WAITREAD:
untimeout(scd_timeout,(caddr_t)SCD_S_WAITREAD);
untimeout(scd_timeout,(caddr_t)SCD_S_WAITREAD, tohandle);
if (mbx->count-- <= 0) {
if (STATUS_BIT(port, SBIT_RESULT_READY))
goto got_param;
@ -944,8 +947,8 @@ scd_doread(int state, struct scd_mbx *mbxin)
process_attention(unit);
if (!(cd->flags & SCDVALID))
goto changed;
timeout(scd_timeout,
(caddr_t)SCD_S_WAITREAD,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITREAD,hz/100); /* XXX */
return;
}
XDEBUG(2, ("scd%d: mbx->count (after RDY_BIT) = %d(%d)\n", unit, mbx->count, RDELAY_WAITREAD));
@ -965,7 +968,7 @@ scd_doread(int state, struct scd_mbx *mbxin)
goto waitfor_param;
case SCD_S_WAITPARAM:
untimeout(scd_timeout,(caddr_t)SCD_S_WAITPARAM);
untimeout(scd_timeout,(caddr_t)SCD_S_WAITPARAM, tohandle);
if (mbx->count-- <= 0) {
printf("scd%d: timeout waiting for params\n",unit);
goto readerr;
@ -973,8 +976,8 @@ scd_doread(int state, struct scd_mbx *mbxin)
waitfor_param:
if (!STATUS_BIT(port, SBIT_RESULT_READY)) {
timeout(scd_timeout,
(caddr_t)SCD_S_WAITPARAM,hz/100); /* XXX */
tohandle = timeout(scd_timeout,
(caddr_t)SCD_S_WAITPARAM,hz/100); /* XXX */
return;
}
#if SCD_DEBUG

View File

@ -60,7 +60,7 @@
* that category, with the possible exception of scanners and
* some of the older MO drives.
*
* $Id: seagate.c,v 1.24 1997/07/20 14:10:10 bde Exp $
* $Id: seagate.c,v 1.25 1997/08/25 23:06:29 bde Exp $
*/
/*
@ -676,7 +676,8 @@ int32_t sea_scsi_cmd (struct scsi_xfer *xs)
* Tried to return COMPLETE but the machine hanged
* with this. */
return (SUCCESSFULLY_QUEUED);
timeout (sea_timeout, (caddr_t) scb, (xs->timeout * hz) / 1000);
xs->timeout_ch = timeout (sea_timeout, (caddr_t) scb,
(xs->timeout * hz) / 1000);
scb->flags |= SCB_TIMECHK;
PRINT (("sea%d/%d/%d command queued\n",
xs->sc_link->adapter_unit,
@ -693,7 +694,7 @@ int32_t sea_scsi_cmd (struct scsi_xfer *xs)
/* Because we are polling, take out the timeout entry
* sea_timeout made. */
untimeout (sea_timeout, (void*) scb);
untimeout (sea_timeout, (void*) scb, xs->timeout_ch);
if (! sea_poll (z, scb))
/* We timed out again... This is bad. Notice that
@ -761,7 +762,8 @@ void sea_timeout (void *arg)
if (! (scb->flags & SCB_ABORTED)) {
sea_abort (z, scb);
/* 2 seconds for the abort */
timeout (sea_timeout, (caddr_t)scb, 2*hz);
scb->xfer->timeout_ch = timeout (sea_timeout,
(caddr_t)scb, 2*hz);
scb->flags |= (SCB_ABORTED | SCB_TIMECHK);
} else {
/* abort timed out */
@ -1010,7 +1012,7 @@ void sea_done (adapter_t *z, scb_t *scb)
struct scsi_xfer *xs = scb->xfer;
if (scb->flags & SCB_TIMECHK)
untimeout (sea_timeout, (caddr_t) scb);
untimeout (sea_timeout, (caddr_t) scb, xs->timeout_ch);
/* How much of the buffer was not touched. */
xs->resid = scb->datalen;

View File

@ -30,7 +30,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHORS BE LIABLE.
*
* $Id: si.c,v 1.59 1997/07/20 14:10:11 bde Exp $
* $Id: si.c,v 1.60 1997/09/14 03:19:18 peter Exp $
*/
#ifndef lint
@ -910,7 +910,7 @@ siclose(dev, flag, mode, p)
/* ok. we are now still on the right track.. nuke the hardware */
if (pp->sp_state & SS_LSTART) {
untimeout(si_lstart, (caddr_t)pp);
untimeout(si_lstart, (caddr_t)pp, pp->lstart_ch);
pp->sp_state &= ~SS_LSTART;
}
@ -2114,12 +2114,12 @@ si_start(tp)
}
if ((pp->sp_state & (SS_LSTART|SS_INLSTART)) == SS_LSTART) {
untimeout(si_lstart, (caddr_t)pp);
untimeout(si_lstart, (caddr_t)pp, pp->lstart_ch);
} else {
pp->sp_state |= SS_LSTART;
}
DPRINT((pp, DBG_START, "arming lstart, time=%d\n", time));
timeout(si_lstart, (caddr_t)pp, time);
pp->lstart_ch = timeout(si_lstart, (caddr_t)pp, time);
}
out:

View File

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

View File

@ -250,6 +250,8 @@ static struct tw_sc {
u_char sc_buf[TW_SIZE]; /* We buffer our own input */
int sc_nextin; /* Next free slot in circular buffer */
int sc_nextout; /* First used slot in circular buffer */
/* Callout for canceling our abortrcv timeout */
struct callout_handle abortrcv_ch;
#ifdef HIRESTIME
int sc_xtimes[22]; /* Times for bits in current xmit packet */
int sc_rtimes[22]; /* Times for bits in current rcv packet */
@ -391,6 +393,7 @@ static int twattach(idp)
sc->sc_port = idp->id_iobase;
sc->sc_state = 0;
sc->sc_rcount = 0;
callout_handle_init(&sc->abortrcv_ch);
#ifdef DEVFS
sc->devfs_token =
@ -948,13 +951,13 @@ int unit;
sc->sc_bits = 0;
sc->sc_rphase = newphase;
/* 3 cycles of silence = 3/60 = 1/20 = 50 msec */
timeout(twabortrcv, (caddr_t)sc, hz/20);
sc->abortrcv_ch = timeout(twabortrcv, (caddr_t)sc, hz/20);
sc->sc_rcv_time[0] = tv.tv_usec;
sc->sc_no_rcv = 1;
return;
}
untimeout(twabortrcv, (caddr_t)sc);
timeout(twabortrcv, (caddr_t)sc, hz/20);
untimeout(twabortrcv, (caddr_t)sc, sc->abortrcv_ch);
sc->abortrcv_ch = timeout(twabortrcv, (caddr_t)sc, hz/20);
newphase = inb(port + tw_zcport) & tw_zcmask;
/* enforce a minimum delay since the last interrupt */
@ -988,7 +991,7 @@ int unit;
*/
sc->sc_state &= ~TWS_RCVING;
sc->sc_flags |= TW_RCV_ERROR;
untimeout(twabortrcv, (caddr_t)sc);
untimeout(twabortrcv, (caddr_t)sc, sc->abortrcv_ch);
log(LOG_ERR, "TWRCV: Invalid start code\n");
twdebugtimes(sc);
sc->sc_no_rcv = 0;
@ -1076,7 +1079,7 @@ int unit;
}
sc->sc_state &= ~TWS_RCVING;
twputpkt(sc, pkt);
untimeout(twabortrcv, (caddr_t)sc);
untimeout(twabortrcv, (caddr_t)sc, sc->abortrcv_ch);
if(sc->sc_flags & TW_RCV_ERROR) {
log(LOG_ERR, "TWRCV: invalid packet: (%d, %x) %c %d\n",
sc->sc_rcount, sc->sc_bits, 'A' + pkt[1], X10_KEY_LABEL[pkt[2]]);

View File

@ -22,7 +22,7 @@
* today: Fri Jun 2 17:21:03 EST 1994
* added 24F support ++sg
*
* $Id: ultra14f.c,v 1.55 1997/07/20 14:10:16 bde Exp $
* $Id: ultra14f.c,v 1.56 1997/09/07 04:21:25 bde Exp $
*/
#ifdef KERNEL /* don't laugh.. this compiles to a program too.. look */
@ -605,7 +605,7 @@ uhaintr(unit)
printf("uha: BAD MSCP RETURNED\n");
return; /* whatever it was, it'll timeout */
}
untimeout(uha_timeout, (caddr_t)mscp);
untimeout(uha_timeout, (caddr_t)mscp, mscp->xs->timeout_ch);
uha_done(uha, mscp);
}
@ -1261,7 +1261,8 @@ uha_scsi_cmd(xs)
if (!(flags & SCSI_NOMASK)) {
s = splbio();
uha_send_mbox(uha, mscp);
timeout(uha_timeout, (caddr_t)mscp, (xs->timeout * hz) / 1000);
xs->timeout_ch = timeout(uha_timeout, (caddr_t)mscp,
(xs->timeout * hz) / 1000);
splx(s);
SC_DEBUG(xs->sc_link, SDEV_DB3, ("cmd_sent\n"));
return (SUCCESSFULLY_QUEUED);
@ -1317,7 +1318,8 @@ uha_timeout(arg1)
uha_done(uha, mscp);
} else { /* abort the operation that has timed out */
printf("\n");
timeout(uha_timeout, (caddr_t)mscp, 2 * hz);
mscp->xs->timeout_ch = timeout(uha_timeout, (caddr_t)mscp,
2 * hz);
mscp->flags = MSCP_ABORTED;
}
splx(s);

View File

@ -502,7 +502,7 @@ void wcdstrategy (struct buf *bp)
x = splbio();
/* Place it in the queue of disk activities for this disk. */
tqdisksort (&t->buf_queue, bp);
bufqdisksort (&t->buf_queue, bp);
/* Tell the device to get going on the transfer if it's
* not doing anything, otherwise just wait for completion. */
@ -520,7 +520,7 @@ void wcdstrategy (struct buf *bp)
*/
static void wcd_start (struct wcd *t)
{
struct buf *bp = TAILQ_FIRST(&t->buf_queue);
struct buf *bp = bufq_first(&t->buf_queue);
u_long blkno, nblk;
/* See if there is a buf to do and we are not already doing one. */
@ -528,7 +528,7 @@ static void wcd_start (struct wcd *t)
return;
/* Unqueue the request. */
TAILQ_REMOVE(&t->buf_queue, bp, b_act);
bufq_remove(&t->buf_queue, bp);
/* Should reject all queued entries if media have changed. */
if (t->flags & F_MEDIA_CHANGED) {

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
* $Id: wd.c,v 1.138 1997/09/13 16:12:12 joerg Exp $
* $Id: wd.c,v 1.139 1997/09/20 07:41:43 dyson Exp $
*/
/* TODO:
@ -415,13 +415,13 @@ wdattach(struct isa_device *dvp)
if (eide_quirks & Q_CMD640B) {
if (dvp->id_unit == PRIMARY) {
printf("wdc0: CMD640B workaround enabled\n");
TAILQ_INIT( &wdtab[PRIMARY].controller_queue);
bufq_init(&wdtab[PRIMARY].controller_queue);
}
} else
TAILQ_INIT( &wdtab[dvp->id_unit].controller_queue);
bufq_init(&wdtab[dvp->id_unit].controller_queue);
#else
TAILQ_INIT( &wdtab[dvp->id_unit].controller_queue);
bufq_init(&wdtab[dvp->id_unit].controller_queue);
#endif
for (wdup = isa_biotab_wdc; wdup->id_driver != 0; wdup++) {
@ -439,7 +439,7 @@ wdattach(struct isa_device *dvp)
if (wddrives[lunit] != NULL)
panic("drive attached twice");
wddrives[lunit] = du;
TAILQ_INIT( &drive_queue[lunit]);
bufq_init(&drive_queue[lunit]);
bzero(du, sizeof *du);
du->dk_ctrlr = dvp->id_unit;
#ifdef CMD640
@ -634,7 +634,7 @@ wdstrategy(register struct buf *bp)
/* queue transfer on drive, activate drive and controller if idle */
s = splbio();
tqdisksort(&drive_queue[lunit], bp);
bufqdisksort(&drive_queue[lunit], bp);
if (wdutab[lunit].b_active == 0)
wdustart(du); /* start drive */
@ -708,14 +708,14 @@ wdustart(register struct disk *du)
return;
bp = drive_queue[du->dk_lunit].tqh_first;
bp = bufq_first(&drive_queue[du->dk_lunit]);
if (bp == NULL) { /* yes, an assign */
return;
}
TAILQ_REMOVE( &drive_queue[du->dk_lunit], bp, b_act);
bufq_remove(&drive_queue[du->dk_lunit], bp);
/* link onto controller queue */
TAILQ_INSERT_TAIL( &wdtab[ctrlr].controller_queue, bp, b_act);
bufq_insert_tail(&wdtab[ctrlr].controller_queue, bp);
/* mark the drive unit as busy */
wdutab[du->dk_lunit].b_active = 1;
@ -757,7 +757,7 @@ wdstart(int ctrlr)
return;
#endif
/* is there a drive for the controller to do a transfer with? */
bp = wdtab[ctrlr].controller_queue.tqh_first;
bp = bufq_first(&wdtab[ctrlr].controller_queue);
if (bp == NULL) {
#ifdef ATAPI
#ifdef CMD640
@ -1062,7 +1062,7 @@ wdintr(int unit)
return;
}
#endif
bp = wdtab[unit].controller_queue.tqh_first;
bp = bufq_first(&wdtab[unit].controller_queue);
du = wddrives[dkunit(bp->b_dev)];
/* finish off DMA */
@ -1245,7 +1245,7 @@ wdintr(int unit)
done: ;
/* done with this transfer, with or without error */
du->dk_flags &= ~(DKFL_SINGLE|DKFL_DMA);
TAILQ_REMOVE(&wdtab[unit].controller_queue, bp, b_act);
bufq_remove( &wdtab[unit].controller_queue, bp);
wdtab[unit].b_errcnt = 0;
bp->b_resid = bp->b_bcount - du->dk_skip * DEV_BSIZE;
wdutab[du->dk_lunit].b_active = 0;
@ -1265,7 +1265,7 @@ done: ;
/* anything more for controller to do? */
#ifndef ATAPI
/* This is not valid in ATAPI mode. */
if (wdtab[unit].controller_queue.tqh_first)
if (bufq_first(&wdtab[unit].controller_queue) != NULL)
#endif
wdstart(unit);
}

View File

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

View File

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