summaryrefslogtreecommitdiff
path: root/sys/arch/alpha/include
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-06-15 20:08:30 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-06-15 20:08:30 +0000
commit3c18738eebc3ab152ffb51145446e53abd3236d3 (patch)
tree65edf799ed5992b4b991b8ce6eeff4ef74f2e0b7 /sys/arch/alpha/include
parentfd293392db098cbdef234cf36ac226873023a403 (diff)
Rework the interrupt code, shaving some cycles off in the process.
Rather than an "iointr" routine that decomposes a vector into an IRQ, we maintain a vector table directly, hooking up each "iointr" routine at the correct vector. This also allows us to hook device interrupts up to specific vectors. From thorpej NetBSD Tested by myself and a number of end-users.
Diffstat (limited to 'sys/arch/alpha/include')
-rw-r--r--sys/arch/alpha/include/cpuconf.h4
-rw-r--r--sys/arch/alpha/include/intr.h41
2 files changed, 40 insertions, 5 deletions
diff --git a/sys/arch/alpha/include/cpuconf.h b/sys/arch/alpha/include/cpuconf.h
index 565f03dcd0a..cd3e9f5103a 100644
--- a/sys/arch/alpha/include/cpuconf.h
+++ b/sys/arch/alpha/include/cpuconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpuconf.h,v 1.4 2000/11/08 21:27:18 ericj Exp $ */
+/* $OpenBSD: cpuconf.h,v 1.5 2006/06/15 20:08:29 brad Exp $ */
/* $NetBSD: cpuconf.h,v 1.12 2000/06/08 03:10:06 thorpej Exp $ */
/*
@@ -62,13 +62,11 @@ struct platform {
* Platform Specific Function Hooks
* cons_init - console initialization
* device_register - boot configuration aid
- * iointr - I/O interrupt handler
* clockintr - Clock Interrupt Handler
* mcheck_handler - Platform Specific Machine Check Handler
*/
void (*cons_init)(void);
void (*device_register)(struct device *, void *);
- void (*iointr)(void *, unsigned long);
void (*clockintr)(struct clockframe *);
void (*mcheck_handler)(unsigned long, struct trapframe *,
unsigned long, unsigned long);
diff --git a/sys/arch/alpha/include/intr.h b/sys/arch/alpha/include/intr.h
index 5576f4bcc6e..5fb16d23e34 100644
--- a/sys/arch/alpha/include/intr.h
+++ b/sys/arch/alpha/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.22 2006/03/12 03:14:36 brad Exp $ */
+/* $OpenBSD: intr.h,v 1.23 2006/06/15 20:08:29 brad Exp $ */
/* $NetBSD: intr.h,v 1.26 2000/06/03 20:47:41 thorpej Exp $ */
/*-
@@ -74,6 +74,34 @@
#include <machine/atomic.h>
/*
+ * The Alpha System Control Block. This is 8k long, and you get
+ * 16 bytes per vector (i.e. the vector numbers are spaced 16
+ * apart).
+ *
+ * This is sort of a "shadow" SCB -- rather than the CPU jumping
+ * to (SCBaddr + (16 * vector)), like it does on the VAX, we get
+ * a vector number in a1. We use the SCB to look up a routine/arg
+ * and jump to it.
+ *
+ * Since we use the SCB only for I/O interrupts, we make it shorter
+ * than normal, starting it at vector 0x800 (the start of the I/O
+ * interrupt vectors).
+ */
+#define SCB_IOVECBASE 0x0800
+#define SCB_VECSIZE 0x0010
+#define SCB_SIZE 0x2000
+
+#define SCB_VECTOIDX(x) ((x) >> 4)
+#define SCB_IDXTOVEC(x) ((x) << 4)
+
+#define SCB_NIOVECS SCB_VECTOIDX(SCB_SIZE - SCB_IOVECBASE)
+
+struct scbvec {
+ void (*scb_func)(void *, u_long);
+ void *scb_arg;
+};
+
+/*
* Alpha interrupts come in at one of 4 levels:
*
* software interrupt level
@@ -237,6 +265,8 @@ int alpha_shared_intr_get_sharetype(struct alpha_shared_intr *,
unsigned int);
int alpha_shared_intr_isactive(struct alpha_shared_intr *,
unsigned int);
+int alpha_shared_intr_firstactive(struct alpha_shared_intr *,
+ unsigned int);
void alpha_shared_intr_set_dfltsharetype(struct alpha_shared_intr *,
unsigned int, int);
void alpha_shared_intr_set_maxstrays(struct alpha_shared_intr *,
@@ -250,7 +280,14 @@ void alpha_shared_intr_set_private(struct alpha_shared_intr *,
void *alpha_shared_intr_get_private(struct alpha_shared_intr *,
unsigned int);
-void set_iointr(void (*)(void *, unsigned long));
+extern struct scbvec scb_iovectab[];
+
+void scb_init(void);
+void scb_set(u_long, void (*)(void *, u_long), void *);
+u_long scb_alloc(void (*)(void *, u_long), void *);
+void scb_free(u_long);
+
+#define SCB_ALLOC_FAILED ((u_long) -1)
#endif /* _KERNEL */
#endif /* ! _ALPHA_INTR_H_ */