- 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).
This commit is contained in:
John Baldwin 2001-02-09 17:46:35 +00:00
parent b4151f7101
commit 062d8ff5a0
8 changed files with 39 additions and 41 deletions

View File

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

View File

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

View File

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

View File

@ -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)) {

View File

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

View File

@ -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)) {

View File

@ -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);
}
/*

View File

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