From b30904d8405e0fc49c1043759a015628e89a2a2c Mon Sep 17 00:00:00 2001 From: jhb Date: Fri, 9 Feb 2001 17:46:35 +0000 Subject: - Catch up to the new swi API changes: - Use swi_* function names. - Use void * to hold cookies to handlers instead of struct intrhand *. - In sio.c, use 'driver_name' instead of "sio" as the name of the driver lock to minimize diffs with cy(4). --- sys/alpha/alpha/busdma_machdep.c | 2 +- sys/amd64/amd64/busdma_machdep.c | 2 +- sys/cam/cam_xpt.c | 14 ++++++-------- sys/dev/sio/sio.c | 24 ++++++++++++------------ sys/i386/i386/busdma_machdep.c | 2 +- sys/isa/sio.c | 24 ++++++++++++------------ sys/kern/kern_clock.c | 4 ++-- sys/kern/subr_taskqueue.c | 8 ++++---- 8 files changed, 39 insertions(+), 41 deletions(-) (limited to 'sys') diff --git a/sys/alpha/alpha/busdma_machdep.c b/sys/alpha/alpha/busdma_machdep.c index e920894..c082563 100644 --- a/sys/alpha/alpha/busdma_machdep.c +++ b/sys/alpha/alpha/busdma_machdep.c @@ -687,7 +687,7 @@ free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage) STAILQ_INSERT_TAIL(&bounce_map_callbacklist, map, links); busdma_swi_pending = 1; - sched_swi(vm_ih, SWI_NOSWITCH); + swi_sched(vm_ih, SWI_NOSWITCH); } } mtx_unlock(&bounce_lock); diff --git a/sys/amd64/amd64/busdma_machdep.c b/sys/amd64/amd64/busdma_machdep.c index 9f0f7c37b..63906dd 100644 --- a/sys/amd64/amd64/busdma_machdep.c +++ b/sys/amd64/amd64/busdma_machdep.c @@ -639,7 +639,7 @@ free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage) STAILQ_INSERT_TAIL(&bounce_map_callbacklist, map, links); busdma_swi_pending = 1; - sched_swi(vm_ih, SWI_NOSWITCH); + swi_sched(vm_ih, SWI_NOSWITCH); } } splx(s); diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 8e8a49b..39cf22f 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -616,8 +616,8 @@ u_int32_t cam_debug_delay; #endif /* Pointers to software interrupt handlers */ -struct intrhand *camnet_ih; -struct intrhand *cambio_ih; +void *camnet_ih; +void *cambio_ih; #if defined(CAM_DEBUG_FLAGS) && !defined(CAMDEBUG) #error "You must have options CAMDEBUG to use options CAM_DEBUG_FLAGS" @@ -1381,10 +1381,8 @@ xpt_init(dummy) } /* Install our software interrupt handlers */ - camnet_ih = sinthand_add("camnet", NULL, camisr, &cam_netq, - SWI_CAMNET, 0); - cambio_ih = sinthand_add("cambio", NULL, camisr, &cam_bioq, - SWI_CAMBIO, 0); + swi_add(NULL, "camnet", camisr, &cam_netq, SWI_CAMNET, 0, &camnet_ih); + swi_add(NULL, "cambio", camisr, &cam_bioq, SWI_CAMBIO, 0, &cambio_ih); } static cam_status @@ -4561,13 +4559,13 @@ xpt_done(union ccb *done_ccb) TAILQ_INSERT_TAIL(&cam_bioq, &done_ccb->ccb_h, sim_links.tqe); done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX; - sched_swi(cambio_ih, SWI_NOSWITCH); + swi_sched(cambio_ih, SWI_NOSWITCH); break; case CAM_PERIPH_NET: TAILQ_INSERT_TAIL(&cam_netq, &done_ccb->ccb_h, sim_links.tqe); done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX; - sched_swi(camnet_ih, SWI_NOSWITCH); + swi_sched(camnet_ih, SWI_NOSWITCH); break; } } diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index be5f642..252a376 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -408,8 +408,8 @@ static int siocnunit; #endif static Port_t siogdbiobase; static int siogdbunit = -1; -static struct intrhand *sio_slow_ih; -static struct intrhand *sio_fast_ih; +static void *sio_slow_ih; +static void *sio_fast_ih; static int sio_timeout; static int sio_timeouts_until_log; static struct callout_handle sio_timeout_handle @@ -769,7 +769,7 @@ sioprobe(dev, xrid) com->bsh = rman_get_bushandle(port); if (atomic_cmpset_int(&sio_inited, 0, 1)) - mtx_init(&sio_lock, "sio", MTX_SPIN); + mtx_init(&sio_lock, driver_name, MTX_SPIN); #if 0 /* @@ -1314,10 +1314,10 @@ determined_type: ; printf("\n"); if (sio_fast_ih == NULL) { - sio_fast_ih = sinthand_add("tty:sio", &tty_ithd, siopoll, - NULL, SWI_TTY, 0); - sio_slow_ih = sinthand_add("tty:sio", &clk_ithd, siopoll, - NULL, SWI_TTY, 0); + swi_add(&tty_ithd, "tty:sio", siopoll, NULL, SWI_TTY, 0, + &sio_fast_ih); + swi_add(&clk_ithd, "tty:sio", siopoll, NULL, SWI_TTY, 0, + &sio_slow_ih); } com->devs[0] = make_dev(&sio_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, "ttyd%r", unit); @@ -1964,7 +1964,7 @@ siointr1(com) } ++com->bytes_in; if (com->hotchar != 0 && recv_data == com->hotchar) - sched_swi(sio_fast_ih, SWI_NOSWITCH); + swi_sched(sio_fast_ih, SWI_NOSWITCH); ioptr = com->iptr; if (ioptr >= com->ibufend) CE_RECORD(com, CE_INTERRUPT_BUF_OVERFLOW); @@ -1972,10 +1972,10 @@ siointr1(com) if (com->do_timestamp) microtime(&com->timestamp); ++com_events; - sched_swi(sio_slow_ih, SWI_DELAY); + swi_sched(sio_slow_ih, SWI_DELAY); #if 0 /* for testing input latency vs efficiency */ if (com->iptr - com->ibuf == 8) - sched_swi(sio_fast_ih, SWI_NOSWITCH); + swi_sched(sio_fast_ih, SWI_NOSWITCH); #endif ioptr[0] = recv_data; ioptr[com->ierroff] = line_status; @@ -2013,7 +2013,7 @@ cont: if (!(com->state & CS_CHECKMSR)) { com_events += LOTS_OF_EVENTS; com->state |= CS_CHECKMSR; - sched_swi(sio_fast_ih, SWI_NOSWITCH); + swi_sched(sio_fast_ih, SWI_NOSWITCH); } /* handle CTS change immediately for crisp flow ctl */ @@ -2068,7 +2068,7 @@ cont: com_events += LOTS_OF_EVENTS; com->state |= CS_ODONE; /* handle at high level ASAP */ - sched_swi(sio_fast_ih, SWI_NOSWITCH); + swi_sched(sio_fast_ih, SWI_NOSWITCH); } } if (COM_IIR_TXRDYBUG(com->flags) && (int_ctl != int_ctl_new)) { diff --git a/sys/i386/i386/busdma_machdep.c b/sys/i386/i386/busdma_machdep.c index 9f0f7c37b..63906dd 100644 --- a/sys/i386/i386/busdma_machdep.c +++ b/sys/i386/i386/busdma_machdep.c @@ -639,7 +639,7 @@ free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage) STAILQ_INSERT_TAIL(&bounce_map_callbacklist, map, links); busdma_swi_pending = 1; - sched_swi(vm_ih, SWI_NOSWITCH); + swi_sched(vm_ih, SWI_NOSWITCH); } } splx(s); diff --git a/sys/isa/sio.c b/sys/isa/sio.c index be5f642..252a376 100644 --- a/sys/isa/sio.c +++ b/sys/isa/sio.c @@ -408,8 +408,8 @@ static int siocnunit; #endif static Port_t siogdbiobase; static int siogdbunit = -1; -static struct intrhand *sio_slow_ih; -static struct intrhand *sio_fast_ih; +static void *sio_slow_ih; +static void *sio_fast_ih; static int sio_timeout; static int sio_timeouts_until_log; static struct callout_handle sio_timeout_handle @@ -769,7 +769,7 @@ sioprobe(dev, xrid) com->bsh = rman_get_bushandle(port); if (atomic_cmpset_int(&sio_inited, 0, 1)) - mtx_init(&sio_lock, "sio", MTX_SPIN); + mtx_init(&sio_lock, driver_name, MTX_SPIN); #if 0 /* @@ -1314,10 +1314,10 @@ determined_type: ; printf("\n"); if (sio_fast_ih == NULL) { - sio_fast_ih = sinthand_add("tty:sio", &tty_ithd, siopoll, - NULL, SWI_TTY, 0); - sio_slow_ih = sinthand_add("tty:sio", &clk_ithd, siopoll, - NULL, SWI_TTY, 0); + swi_add(&tty_ithd, "tty:sio", siopoll, NULL, SWI_TTY, 0, + &sio_fast_ih); + swi_add(&clk_ithd, "tty:sio", siopoll, NULL, SWI_TTY, 0, + &sio_slow_ih); } com->devs[0] = make_dev(&sio_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, "ttyd%r", unit); @@ -1964,7 +1964,7 @@ siointr1(com) } ++com->bytes_in; if (com->hotchar != 0 && recv_data == com->hotchar) - sched_swi(sio_fast_ih, SWI_NOSWITCH); + swi_sched(sio_fast_ih, SWI_NOSWITCH); ioptr = com->iptr; if (ioptr >= com->ibufend) CE_RECORD(com, CE_INTERRUPT_BUF_OVERFLOW); @@ -1972,10 +1972,10 @@ siointr1(com) if (com->do_timestamp) microtime(&com->timestamp); ++com_events; - sched_swi(sio_slow_ih, SWI_DELAY); + swi_sched(sio_slow_ih, SWI_DELAY); #if 0 /* for testing input latency vs efficiency */ if (com->iptr - com->ibuf == 8) - sched_swi(sio_fast_ih, SWI_NOSWITCH); + swi_sched(sio_fast_ih, SWI_NOSWITCH); #endif ioptr[0] = recv_data; ioptr[com->ierroff] = line_status; @@ -2013,7 +2013,7 @@ cont: if (!(com->state & CS_CHECKMSR)) { com_events += LOTS_OF_EVENTS; com->state |= CS_CHECKMSR; - sched_swi(sio_fast_ih, SWI_NOSWITCH); + swi_sched(sio_fast_ih, SWI_NOSWITCH); } /* handle CTS change immediately for crisp flow ctl */ @@ -2068,7 +2068,7 @@ cont: com_events += LOTS_OF_EVENTS; com->state |= CS_ODONE; /* handle at high level ASAP */ - sched_swi(sio_fast_ih, SWI_NOSWITCH); + swi_sched(sio_fast_ih, SWI_NOSWITCH); } } if (COM_IIR_TXRDYBUG(com->flags) && (int_ctl != int_ctl_new)) { diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 0743c6c..fb4b4a6 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -209,11 +209,11 @@ hardclock(frame) mtx_unlock_spin(&callout_lock); /* - * sched_swi acquires sched_lock, so we don't want to call it with + * swi_sched acquires sched_lock, so we don't want to call it with * callout_lock held; incorrect locking order. */ if (need_softclock) - sched_swi(softclock_ih, SWI_NOSWITCH); + swi_sched(softclock_ih, SWI_NOSWITCH); } /* diff --git a/sys/kern/subr_taskqueue.c b/sys/kern/subr_taskqueue.c index 5afda76..30d834a 100644 --- a/sys/kern/subr_taskqueue.c +++ b/sys/kern/subr_taskqueue.c @@ -40,7 +40,7 @@ static MALLOC_DEFINE(M_TASKQUEUE, "taskqueue", "Task Queues"); static STAILQ_HEAD(taskqueue_list, taskqueue) taskqueue_queues; -static struct intrhand *taskqueue_ih; +static void *taskqueue_ih; struct taskqueue { STAILQ_ENTRY(taskqueue) tq_link; @@ -193,7 +193,7 @@ taskqueue_run(struct taskqueue *queue) static void taskqueue_swi_enqueue(void *context) { - sched_swi(taskqueue_ih, SWI_NOSWITCH); + swi_sched(taskqueue_ih, SWI_NOSWITCH); } static void @@ -203,5 +203,5 @@ taskqueue_swi_run(void *dummy) } TASKQUEUE_DEFINE(swi, taskqueue_swi_enqueue, 0, - taskqueue_ih = sinthand_add("task queue", NULL, - taskqueue_swi_run, NULL, SWI_TQ, 0)); + swi_add(NULL, "task queue", taskqueue_swi_run, NULL, SWI_TQ, 0, + &taskqueue_ih)); -- cgit v1.1