summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_taskqueue.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-10-25 05:19:40 +0000
committerjhb <jhb@FreeBSD.org>2000-10-25 05:19:40 +0000
commitff18363a3e5e60f38c8f7a52c7e7f4ea1c8b797f (patch)
treed0f426694e386a2b666529e1e1ad06938c3d7e83 /sys/kern/subr_taskqueue.c
parent08451a100d3bc5d4373e28f7acd976df25f3f785 (diff)
downloadFreeBSD-src-ff18363a3e5e60f38c8f7a52c7e7f4ea1c8b797f.zip
FreeBSD-src-ff18363a3e5e60f38c8f7a52c7e7f4ea1c8b797f.tar.gz
- Overhaul the software interrupt code to use interrupt threads for each
type of software interrupt. Roughly, what used to be a bit in spending now maps to a swi thread. Each thread can have multiple handlers, just like a hardware interrupt thread. - Instead of using a bitmask of pending interrupts, we schedule the specific software interrupt thread to run, so spending, NSWI, and the shandlers array are no longer needed. We can now have an arbitrary number of software interrupt threads. When you register a software interrupt thread via sinthand_add(), you get back a struct intrhand that you pass to sched_swi() when you wish to schedule your swi thread to run. - Convert the name of 'struct intrec' to 'struct intrhand' as it is a bit more intuitive. Also, prefix all the members of struct intrhand with 'ih_'. - Make swi_net() a MI function since there is now no point in it being MD. Submitted by: cp
Diffstat (limited to 'sys/kern/subr_taskqueue.c')
-rw-r--r--sys/kern/subr_taskqueue.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/subr_taskqueue.c b/sys/kern/subr_taskqueue.c
index 3fa0f05..ba25c7f 100644
--- a/sys/kern/subr_taskqueue.c
+++ b/sys/kern/subr_taskqueue.c
@@ -40,6 +40,8 @@ MALLOC_DEFINE(M_TASKQUEUE, "taskqueue", "Task Queues");
static STAILQ_HEAD(taskqueue_list, taskqueue) taskqueue_queues;
+static struct intrhand *taskqueue_ih;
+
struct taskqueue {
STAILQ_ENTRY(taskqueue) tq_link;
STAILQ_HEAD(, task) tq_queue;
@@ -191,14 +193,15 @@ taskqueue_run(struct taskqueue *queue)
static void
taskqueue_swi_enqueue(void *context)
{
- setsofttq();
+ sched_swi(taskqueue_ih, SWI_NOSWITCH);
}
static void
-taskqueue_swi_run(void)
+taskqueue_swi_run(void *dummy)
{
taskqueue_run(taskqueue_swi);
}
TASKQUEUE_DEFINE(swi, taskqueue_swi_enqueue, 0,
- register_swi(SWI_TQ, taskqueue_swi_run));
+ taskqueue_ih = sinthand_add("task queue", NULL,
+ taskqueue_swi_run, NULL, SWI_TQ, 0));
OpenPOWER on IntegriCloud