summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/include/intr.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/sparc64/include/intr.h')
-rw-r--r--sys/arch/sparc64/include/intr.h37
1 files changed, 36 insertions, 1 deletions
diff --git a/sys/arch/sparc64/include/intr.h b/sys/arch/sparc64/include/intr.h
index 6a979f16b46..fd50694c938 100644
--- a/sys/arch/sparc64/include/intr.h
+++ b/sys/arch/sparc64/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.5 2002/06/11 05:01:17 art Exp $ */
+/* $OpenBSD: intr.h,v 1.6 2003/06/24 21:54:39 henric Exp $ */
/* $NetBSD: intr.h,v 1.8 2001/01/14 23:50:30 thorpej Exp $ */
/*-
@@ -37,6 +37,39 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef _SPARC64_INTR_H_
+#define _SPARC64_INTR_H_
+
+#ifndef _SPARC64_INTREG_H_
+#include <sparc64/sparc64/intreg.h>
+#endif
+
+/*
+ * Interrupt handler chains. Interrupt handlers should return 0 for
+ * ``not me'' or 1 (``I took care of it''). intr_establish() inserts a
+ * handler into the list. The handler is called with its (single)
+ * argument, or with a pointer to a clockframe if ih_arg is NULL.
+ */
+struct intrhand {
+ int (*ih_fun)(void *);
+ void *ih_arg;
+ short ih_number; /* interrupt number */
+ /* the H/W provides */
+ char ih_pil; /* interrupt priority */
+ volatile char ih_busy; /* handler is on list */
+ struct intrhand *ih_next; /* global list */
+ struct intrhand *ih_pending; /* pending list */
+ volatile u_int64_t *ih_map; /* interrupt map reg */
+ volatile u_int64_t *ih_clr; /* clear interrupt reg */
+ u_int64_t ih_count; /* # of interrupts */
+ const void *ih_bus; /* parent bus */
+ char ih_name[1]; /* device name */
+};
+
+extern struct intrhand *intrlev[MAXINTNUM];
+
+void intr_establish(int, struct intrhand *);
+
/* XXX - arbitrary numbers; no interpretation is defined yet */
#define IPL_NONE 0 /* nothing */
#define IPL_SOFTINT 1 /* softint */
@@ -63,3 +96,5 @@ softintr_disestablish(void *cookie);
void
softintr_schedule(void *cookie);
+
+#endif /* _SPARC64_INTR_H_ */