diff options
author | gibbs <gibbs@FreeBSD.org> | 1997-09-21 21:43:54 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1997-09-21 21:43:54 +0000 |
commit | 3579df4d35e102051246eb21aa0d7712fbfb6544 (patch) | |
tree | 8d1f4c2b2e369e3fe2c31dd6990d82ab0ca66efb | |
parent | d281074565525b1dfa00c6fad20aa0005b0a7867 (diff) | |
download | FreeBSD-src-3579df4d35e102051246eb21aa0d7712fbfb6544.zip FreeBSD-src-3579df4d35e102051246eb21aa0d7712fbfb6544.tar.gz |
Update for changes in the callout interface.
-rw-r--r-- | sys/compat/linux/linux_misc.c | 7 | ||||
-rw-r--r-- | sys/i386/isa/matcd/matcd.c | 10 | ||||
-rw-r--r-- | sys/i386/isa/pcvt/pcvt_kbd.c | 12 | ||||
-rw-r--r-- | sys/i386/isa/pcvt/pcvt_sup.c | 27 | ||||
-rw-r--r-- | sys/i386/linux/linux_misc.c | 7 | ||||
-rw-r--r-- | sys/i386/scsi/aic7xxx.c | 43 | ||||
-rw-r--r-- | sys/i386/scsi/bt.c | 15 |
7 files changed, 73 insertions, 48 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 42e3a7d..723732b 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_misc.c,v 1.28 1997/04/28 02:53:17 msmith Exp $ + * $Id: linux_misc.c,v 1.29 1997/07/20 16:06:01 bde Exp $ */ #include <sys/param.h> @@ -82,11 +82,12 @@ linux_alarm(struct proc *p, struct linux_alarm_args *args, int *retval) if (itimerfix(&it.it_value) || itimerfix(&it.it_interval)) return EINVAL; s = splclock(); - untimeout(realitexpire, (caddr_t)p); + if (timerisset(&p->p_realtimer.it_value)) + untimeout(realitexpire, (caddr_t)p, p->p_ithandle); tv = time; if (timerisset(&it.it_value)) { timevaladd(&it.it_value, &tv); - timeout(realitexpire, (caddr_t)p, hzto(&it.it_value)); + p->p_ithandle = timeout(realitexpire, (caddr_t)p, hzto(&it.it_value)); } p->p_realtimer = it; splx(s); diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c index b9911a7..6abdfaa 100644 --- a/sys/i386/isa/matcd/matcd.c +++ b/sys/i386/isa/matcd/matcd.c @@ -337,7 +337,7 @@ static char MATCDVERSION[]="Version 1(26) 18-Oct-95"; static char MATCDCOPYRIGHT[] = "Matsushita CD-ROM driver, Copr. 1994,1995 Frank Durda IV"; /* The proceeding strings may not be changed*/ -/* $Id: matcd.c,v 1.27 1997/05/10 12:13:17 joerg Exp $ */ +/* $Id: matcd.c,v 1.28 1997/07/20 11:14:53 bde Exp $ */ /*--------------------------------------------------------------------------- Include declarations @@ -895,7 +895,7 @@ void matcdstrategy(struct buf *bp) } s=splbio(); /*Make sure we don't get intr'ed*/ - tqdisksort(&request_head[controller], bp);/*Add new request (bp) to queue (dp + bufqdisksort(&request_head[controller], bp);/*Add new request (bp) to queue (dp and sort the requests in a way that may not be ideal for CD-ROM media*/ @@ -924,7 +924,7 @@ static void matcd_start(int controller) struct partition *p; int part,ldrive; - bp = TAILQ_FIRST(&request_head[controller]); + bp = bufq_first(&request_head[controller]); if (bp == NULL) { /*Nothing on read queue to do?*/ wakeup((caddr_t)&matcd_data->status); /*Wakeup any blocked*/ return; /* opens, ioctls, etc*/ @@ -948,7 +948,7 @@ static void matcd_start(int controller) get the command to do and issue it */ - TAILQ_REMOVE(&request_head[controller], bp, b_act); + bufq_remove(&request_head[controller], bp); part=matcd_partition(bp->b_dev); p=cd->dlabel.d_partitions + part; @@ -1352,7 +1352,7 @@ matcd_attach(struct isa_device *dev) #endif /*DEBUGPROBE*/ printf("matcdc%d Host interface type %d\n", nextcontroller,iftype); - TAILQ_INIT(&request_head[nextcontroller]); + bufq_init(&request_head[nextcontroller]); for (cdrive=0; cdrive<4; cdrive++) { /*We're hunting drives...*/ zero_cmd(cmd); cmd[0]=NOP; /*A reasonably harmless command. diff --git a/sys/i386/isa/pcvt/pcvt_kbd.c b/sys/i386/isa/pcvt/pcvt_kbd.c index 6f6b348..6a4e15b 100644 --- a/sys/i386/isa/pcvt/pcvt_kbd.c +++ b/sys/i386/isa/pcvt/pcvt_kbd.c @@ -197,6 +197,8 @@ do_vgapage(int page) */ static int lost_intr_timeout_queued = 0; +static struct callout_handle lost_intr_ch = + CALLOUT_HANDLE_INITIALIZER(&lost_intr_ch); static void check_for_lost_intr (void *arg) @@ -220,7 +222,7 @@ check_for_lost_intr (void *arg) pcrint (0); splx (opri); } - timeout(check_for_lost_intr, (void *)NULL, hz); + lost_intr_ch = timeout(check_for_lost_intr, (void *)NULL, hz); lost_intr_timeout_queued = 1; #endif /* !_I386_ISA_KBDIO_H_ */ } @@ -309,9 +311,9 @@ update_led(void) #if PCVT_UPDLED_LOSES_INTR if (lost_intr_timeout_queued) - untimeout(check_for_lost_intr, NULL); + untimeout(check_for_lost_intr, NULL, lost_intr_ch); - timeout(check_for_lost_intr, NULL, hz); + lost_intr_ch = timeout(check_for_lost_intr, NULL, hz); lost_intr_timeout_queued = 1; #endif /* PCVT_UPDLED_LOSES_INTR */ @@ -675,7 +677,7 @@ r_entry: return; if (lost_intr_timeout_queued) { - untimeout(check_for_lost_intr, (void *)NULL); + untimeout(check_for_lost_intr, (void *)NULL, lost_intr_ch); lost_intr_timeout_queued = 0; } @@ -816,7 +818,7 @@ r_entry: update_led(); - timeout(check_for_lost_intr, (void *)NULL, hz); + lost_intr_ch = timeout(check_for_lost_intr, (void *)NULL, hz); lost_intr_timeout_queued = 1; #endif /* !_I386_ISA_KBDIO_H_ */ diff --git a/sys/i386/isa/pcvt/pcvt_sup.c b/sys/i386/isa/pcvt/pcvt_sup.c index b04a459..d34c01b 100644 --- a/sys/i386/isa/pcvt/pcvt_sup.c +++ b/sys/i386/isa/pcvt/pcvt_sup.c @@ -84,8 +84,13 @@ static void vgapcvtinfo ( struct pcvtinfo *data ); static unsigned char * compute_charset_base ( unsigned fontset ); #endif /* XSERVER */ +static struct callout_handle async_update_ch = + CALLOUT_HANDLE_INITIALIZER(&async_update_ch); + #if PCVT_SCREENSAVER static void scrnsv_timedout ( void *arg ); +static struct callout_handle scrnsv_timeout_ch = + CALLOUT_HANDLE_INITIALIZER(&scrnsv_timeout_ch); static u_short *savedscreen = (u_short *)0; /* ptr to screen contents */ static size_t scrnsv_size = (size_t)-1; /* size of saved image */ @@ -96,6 +101,8 @@ static void pcvt_set_scrnsv_tmo ( int timeout );/* else declared global */ #if PCVT_PRETTYSCRNS static u_short *scrnsv_current = (u_short *)0; /* attention char ptr */ +static struct callout_handle scrnsv_blink_ch = + CALLOUT_HANDLE_INITIALIZER(&scrnsv_blink_ch); static void scrnsv_blink ( void * ); static u_short getrand ( void ); #endif /* PCVT_PRETTYSCRNS */ @@ -897,7 +904,7 @@ async_update(void *arg) if(arg == UPDATE_STOP) { - untimeout(async_update, UPDATE_START); + untimeout(async_update, UPDATE_START, async_update_ch); return; } #endif /* XSERVER */ @@ -1082,7 +1089,8 @@ async_update_exit: if(arg == UPDATE_START) { - timeout(async_update, UPDATE_START, PCVT_UPDATEFAST); + async_update_ch = timeout(async_update, UPDATE_START, + PCVT_UPDATEFAST); } } @@ -1942,7 +1950,7 @@ scrnsv_blink(void * arg) *scrnsv_current = (7 /* LIGHTGRAY */ << 8) + '*'; if(adaptor_type == VGA_ADAPTOR) vgapaletteio(7 /* LIGHTGRAY */, &blink_rgb[(r >> 4) & 7], 1); - timeout(scrnsv_blink, NULL, hz); + scrnsv_blink_ch = timeout(scrnsv_blink, NULL, hz); } #endif /* PCVT_PRETTYSCRNS */ @@ -1961,7 +1969,7 @@ pcvt_set_scrnsv_tmo(int timeout) int x = splhigh(); if(scrnsv_timeout) - untimeout(scrnsv_timedout, NULL); + untimeout(scrnsv_timedout, NULL, scrnsv_timeout_ch); scrnsv_timeout = timeout; pcvt_scrnsv_reset(); /* sanity */ @@ -2038,7 +2046,7 @@ scrnsv_timedout(void *arg) vgapaletteio(0 /* BLACK */, &black, 1); } /* prepare for next time... */ - timeout(scrnsv_timedout, NULL, hz / 10); + scrnsv_timeout_ch = timeout(scrnsv_timedout, NULL, hz / 10); } else { @@ -2048,7 +2056,7 @@ scrnsv_timedout(void *arg) #if PCVT_PRETTYSCRNS scrnsv_current = vsp->Crtat; - timeout(scrnsv_blink, NULL, hz); + scrnsv_blink_ch = timeout(scrnsv_blink, NULL, hz); #endif /* PCVT_PRETTYSCRNS */ sw_cursor(0); /* cursor off on mda/cga */ @@ -2076,14 +2084,14 @@ pcvt_scrnsv_reset(void) { last_schedule = time.tv_sec; reschedule = 1; - untimeout(scrnsv_timedout, NULL); + untimeout(scrnsv_timedout, NULL, scrnsv_timeout_ch); } if(scrnsv_active) { #if PCVT_PRETTYSCRNS if(scrnsv_active > 1) - untimeout(scrnsv_blink, NULL); + untimeout(scrnsv_blink, NULL, scrnsv_blink_ch); #endif /* PCVT_PRETTYSCRNS */ bcopy(savedscreen, vsp->Crtat, scrnsv_size); @@ -2106,7 +2114,8 @@ pcvt_scrnsv_reset(void) if(reschedule) { /* mark next timeout */ - timeout(scrnsv_timedout, NULL, scrnsv_timeout * hz); + scrnsv_timeout_ch = timeout(scrnsv_timedout, NULL, + scrnsv_timeout * hz); } splx(x); } diff --git a/sys/i386/linux/linux_misc.c b/sys/i386/linux/linux_misc.c index 42e3a7d..723732b 100644 --- a/sys/i386/linux/linux_misc.c +++ b/sys/i386/linux/linux_misc.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_misc.c,v 1.28 1997/04/28 02:53:17 msmith Exp $ + * $Id: linux_misc.c,v 1.29 1997/07/20 16:06:01 bde Exp $ */ #include <sys/param.h> @@ -82,11 +82,12 @@ linux_alarm(struct proc *p, struct linux_alarm_args *args, int *retval) if (itimerfix(&it.it_value) || itimerfix(&it.it_interval)) return EINVAL; s = splclock(); - untimeout(realitexpire, (caddr_t)p); + if (timerisset(&p->p_realtimer.it_value)) + untimeout(realitexpire, (caddr_t)p, p->p_ithandle); tv = time; if (timerisset(&it.it_value)) { timevaladd(&it.it_value, &tv); - timeout(realitexpire, (caddr_t)p, hzto(&it.it_value)); + p->p_ithandle = timeout(realitexpire, (caddr_t)p, hzto(&it.it_value)); } p->p_realtimer = it; splx(s); diff --git a/sys/i386/scsi/aic7xxx.c b/sys/i386/scsi/aic7xxx.c index fe02f31..e51b2d3 100644 --- a/sys/i386/scsi/aic7xxx.c +++ b/sys/i386/scsi/aic7xxx.c @@ -39,7 +39,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aic7xxx.c,v 1.123 1997/08/17 14:04:08 itojun Exp $ + * $Id: aic7xxx.c,v 1.124 1997/08/21 21:23:21 gibbs Exp $ */ /* * TODO: @@ -1307,8 +1307,10 @@ ahc_handle_seqint(ahc, intstat) * Ensure we have enough time to actually * retrieve the sense. */ - untimeout(ahc_timeout, (caddr_t)scb); - timeout(ahc_timeout, (caddr_t)scb, hz); + untimeout(ahc_timeout, (caddr_t)scb, + scb->xs->timeout_ch); + scb->xs->timeout_ch = timeout(ahc_timeout, + (caddr_t)scb, hz); break; } /* @@ -1936,7 +1938,7 @@ ahc_done(ahc, scb) if (scb->flags & SCB_MSGOUT_SDTR) ahc->sdtrpending &= ~mask; } - untimeout(ahc_timeout, (caddr_t)scb); + untimeout(ahc_timeout, (caddr_t)scb, scb->xs->timeout_ch); ahc_free_scb(ahc, scb); /* * If we're polling, we rely on the ITS_DONE flag in the xs structure @@ -2526,7 +2528,8 @@ ahc_scsi_cmd(xs) ahc_run_waiting_queue(ahc); if ((flags & SCSI_NOMASK) == 0) { - timeout(ahc_timeout, (caddr_t)scb, (xs->timeout * hz) / 1000); + scb->xs->timeout_ch = timeout(ahc_timeout, (caddr_t)scb, + (xs->timeout * hz) / 1000); splx(s); return (SUCCESSFULLY_QUEUED); } @@ -2923,8 +2926,9 @@ ahc_timeout(arg) sc_print_addr(scb->xs->sc_link); printf("SCB 0x%x timedout while recovery in progress\n", scb->hscb->tag); - timeout(ahc_timeout, (caddr_t)scb, - (scb->xs->timeout * hz) / 1000); + scb->xs->timeout_ch = + timeout(ahc_timeout, (caddr_t)scb, + (scb->xs->timeout * hz) / 1000); unpause_sequencer(ahc, /*unpause_always*/TRUE); splx(s); return; @@ -3008,7 +3012,8 @@ bus_reset: SELBUSB : 0))); scb->flags |= SCB_SENTORDEREDTAG|SCB_RECOVERY_SCB; ahc->orderedtag |= mask; - timeout(ahc_timeout, (caddr_t)scb, (5 * hz)); + scb->xs->timeout_ch = timeout(ahc_timeout, (caddr_t)scb, + (5 * hz)); unpause_sequencer(ahc, /*unpause_always*/TRUE); printf("Ordered Tag queued\n"); } else { @@ -3058,13 +3063,15 @@ bus_reset: active_scb->flags |= SCB_ABORT|SCB_RECOVERY_SCB; if (active_scb != scb) { untimeout(ahc_timeout, - (caddr_t)active_scb); + (caddr_t)active_scb, + active_scb->xs->timeout_ch); /* Give scb a new lease on life */ - timeout(ahc_timeout, (caddr_t)scb, - (scb->xs->timeout * hz) / 1000); + scb->xs->timeout_ch = + timeout(ahc_timeout, (caddr_t)scb, + (scb->xs->timeout * hz) / 1000); } - timeout(ahc_timeout, (caddr_t)active_scb, - (2000 * hz) / 1000); + active_scb->xs->timeout_ch = + timeout(ahc_timeout, active_scb, 2 * hz); unpause_sequencer(ahc, /*unpause_always*/TRUE); } else { int disconnected; @@ -3129,8 +3136,9 @@ bus_reset: STAILQ_INSERT_HEAD(&ahc->waiting_scbs, scb, links); scb->flags |= SCB_WAITINGQ; - timeout(ahc_timeout, (caddr_t)scb, - (2000 * hz) / 1000); + scb->xs->timeout_ch = + timeout(ahc_timeout, (caddr_t)scb, + (2000 * hz) / 1000); ahc_outb(ahc, SCBPTR, saved_scbptr); /* * ahc_run_waiting_queue may unpause us @@ -3628,7 +3636,7 @@ ahc_reset_current_bus(ahc) DELAY(AHC_BUSRESET_DELAY); /* Turn off the bus reset */ ahc_outb(ahc, SCSISEQ, scsiseq & ~SCSIRSTO); - + ahc_clear_intstat(ahc); /* Re-enable reset interrupts */ @@ -3749,7 +3757,8 @@ ahc_untimeout_done_queue(ahc) for (i = 0; i < ahc->scb_data->numscbs; i++) { scbp = ahc->scb_data->scbarray[i]; if (scbp->flags & SCB_QUEUED_FOR_DONE) - untimeout(ahc_timeout, (caddr_t)scbp); + untimeout(ahc_timeout, (caddr_t)scbp, + scbp->xs->timeout_ch); } } diff --git a/sys/i386/scsi/bt.c b/sys/i386/scsi/bt.c index 6f5c118..6f21cca 100644 --- a/sys/i386/scsi/bt.c +++ b/sys/i386/scsi/bt.c @@ -12,7 +12,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: bt.c,v 1.13 1997/03/23 06:33:37 bde Exp $ + * $Id: bt.c,v 1.14 1997/07/20 16:21:36 bde Exp $ */ /* @@ -643,7 +643,8 @@ bt_intr(arg) } wmbi->stat = BT_MBI_FREE; if (ccb) { - untimeout(bt_timeout, (caddr_t)ccb); + untimeout(bt_timeout, (caddr_t)ccb, + ccb->xfer->timeout_ch); bt_done(bt, ccb); } /* Set the IN mail Box pointer for next */ bt_nextmbx(wmbi, wmbx, mbi); @@ -1410,7 +1411,8 @@ bt_scsi_cmd(xs) */ SC_DEBUG(xs->sc_link, SDEV_DB3, ("cmd_sent\n")); if (!(flags & SCSI_NOMASK)) { - timeout(bt_timeout, (caddr_t)ccb, (xs->timeout * hz) / 1000); + xs->timeout_ch = timeout(bt_timeout, (caddr_t)ccb, + (xs->timeout * hz) / 1000); return (SUCCESSFULLY_QUEUED); } /* @@ -1459,7 +1461,7 @@ bt_poll(bt, xs, ccb) * because we are polling, take out the timeout entry * bt_timeout made */ - untimeout(bt_timeout, (caddr_t)ccb); + untimeout(bt_timeout, (caddr_t)ccb, ccb->xfer->timeout_ch); count = 2000; while (count) { /* @@ -1501,7 +1503,7 @@ bt_timeout(void *arg1) * Entry chains when time outed....So infinity Loop.. * 94/04/20 amurai@spec.co.jp */ - untimeout(bt_timeout, (caddr_t)ccb); + untimeout(bt_timeout, (caddr_t)ccb, ccb->xfer->timeout_ch); unit = ccb->xfer->sc_link->adapter_unit; bt = btdata[unit]; @@ -1537,7 +1539,8 @@ bt_timeout(void *arg1) bt_send_mbo(bt, ~SCSI_NOMASK, BT_MBO_ABORT, ccb); /* 2 secs for the abort */ ccb->flags = CCB_ABORTED; - timeout(bt_timeout, (caddr_t)ccb, 2 * hz); + ccb->xfer->timeout_ch = timeout(bt_timeout, (caddr_t)ccb, + 2 * hz); } splx(s); } |