summaryrefslogtreecommitdiffstats
path: root/sys/sys/interrupt.h
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/sys/interrupt.h
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/sys/interrupt.h')
-rw-r--r--sys/sys/interrupt.h39
1 files changed, 21 insertions, 18 deletions
diff --git a/sys/sys/interrupt.h b/sys/sys/interrupt.h
index 8fe63f4..54fd11c 100644
--- a/sys/sys/interrupt.h
+++ b/sys/sys/interrupt.h
@@ -36,27 +36,30 @@
* together via the 'next' pointer.
*/
-struct ithd;
-
-struct intrec {
- driver_intr_t *handler; /* code address of handler */
- void *argument; /* argument to pass to handler */
- enum intr_type flags; /* flag bits (sys/bus.h) */
- char *name; /* name of handler */
- struct ithd *ithd; /* handler we're connected to */
- struct intrec *next; /* next handler for this irq */
+struct intrhand {
+ driver_intr_t *ih_handler; /* code address of handler */
+ void *ih_argument; /* argument to pass to handler */
+ enum intr_type ih_flags; /* flag bits (sys/bus.h) */
+ char *ih_name; /* name of handler */
+ struct ithd *ih_ithd; /* handler we're connected to */
+ struct intrhand *ih_next; /* next handler for this irq */
+ int ih_need; /* need interrupt */
};
-typedef void swihand_t __P((void));
+int ithread_priority __P((int flags));
+void sched_swi __P((struct intrhand *, int));
+#define SWI_SWITCH 0x1
+#define SWI_NOSWITCH 0x2
+#define SWI_DELAY 0x4 /* implies NOSWITCH */
-extern swihand_t *shandlers[];
+struct intrhand * sinthand_add __P((const char *name, struct ithd **,
+ driver_intr_t, void *arg, int pri, int flags));
-void register_swi __P((int intr, swihand_t *handler));
-void swi_dispatcher __P((int intr));
-swihand_t swi_generic;
-swihand_t swi_null;
-void unregister_swi __P((int intr, swihand_t *handler));
-int ithread_priority __P((int flags));
-void sched_softintr __P((void));
+extern struct ithd *tty_ithd;
+extern struct ithd *clk_ithd;
+
+extern struct intrhand *net_ih;
+extern struct intrhand *softclock_ih;
+extern struct intrhand *vm_ih;
#endif
OpenPOWER on IntegriCloud