summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/include
diff options
context:
space:
mode:
authorHenric Jungheim <henric@cvs.openbsd.org>2003-06-24 21:54:40 +0000
committerHenric Jungheim <henric@cvs.openbsd.org>2003-06-24 21:54:40 +0000
commit355b8560084501d10eae7686c8385754bc6c7072 (patch)
treed3bc0a5b778c1c6b51beb7fedae743f3fc436c13 /sys/arch/sparc64/include
parent02503c73b4a809f21312fef8bf66cfe5d0f1a50f (diff)
Add a "where" argument to the sparc64 interrupt code. This lets us
associate a name with each interrupt handler. This is not visible outside the kernel (yet). ok jason@
Diffstat (limited to 'sys/arch/sparc64/include')
-rw-r--r--sys/arch/sparc64/include/bus.h18
-rw-r--r--sys/arch/sparc64/include/cpu.h38
-rw-r--r--sys/arch/sparc64/include/intr.h37
3 files changed, 52 insertions, 41 deletions
diff --git a/sys/arch/sparc64/include/bus.h b/sys/arch/sparc64/include/bus.h
index e30b876c509..a86c87c0812 100644
--- a/sys/arch/sparc64/include/bus.h
+++ b/sys/arch/sparc64/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.15 2003/03/06 08:26:08 henric Exp $ */
+/* $OpenBSD: bus.h,v 1.16 2003/06/24 21:54:39 henric Exp $ */
/* $NetBSD: bus.h,v 1.31 2001/09/21 15:30:41 wiz Exp $ */
/*-
@@ -221,7 +221,8 @@ struct sparc_bus_space_tag {
void *(*sparc_intr_establish)(bus_space_tag_t,
bus_space_tag_t,
int, int, int,
- int (*)(void *), void *);
+ int (*)(void *), void *,
+ const char *);
};
@@ -282,7 +283,18 @@ void *bus_intr_establish(
see machine/intr.h*/
int, /*flags*/
int (*)(void *), /*handler*/
- void *); /*handler arg*/
+ void *, /*handler arg*/
+ const char *); /*what*/
+void *bus_intr_allocate(
+ bus_space_tag_t,
+ int (*)(void *), /*handler*/
+ void *, /*handler arg*/
+ int, /*number*/
+ int, /*pil*/
+ volatile u_int64_t *, /*map*/
+ volatile u_int64_t *, /*clr*/
+ const char *); /*what*/
+void bus_intr_free(void *);
void bus_space_render_tag(
bus_space_tag_t,
char *,
diff --git a/sys/arch/sparc64/include/cpu.h b/sys/arch/sparc64/include/cpu.h
index 9b28cfedc7f..e706dd0b77e 100644
--- a/sys/arch/sparc64/include/cpu.h
+++ b/sys/arch/sparc64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.21 2003/06/02 23:27:56 millert Exp $ */
+/* $OpenBSD: cpu.h,v 1.22 2003/06/24 21:54:39 henric Exp $ */
/* $NetBSD: cpu.h,v 1.28 2001/06/14 22:56:58 thorpej Exp $ */
/*
@@ -74,7 +74,6 @@
#include <machine/psl.h>
#include <machine/reg.h>
#include <machine/intr.h>
-#include <sparc64/sparc64/intreg.h>
/*#include <sys/sched.h> */
@@ -194,15 +193,8 @@ union sir {
#define SIR_CLOCK 1
#endif
-extern struct intrhand soft01intr, soft01net, soft01clock;
-
-#if 0
-#define setsoftint() send_softint(-1, IPL_SOFTINT, &soft01intr)
-#define setsoftnet() send_softint(-1, IPL_SOFTNET, &soft01net)
-#else
void setsoftint(void);
void setsoftnet(void);
-#endif
extern int want_ast;
@@ -234,29 +226,6 @@ extern int want_resched; /* resched() was called */
extern struct proc *fpproc; /* FPU owner */
extern int foundfpu; /* true => we have an FPU */
-/*
- * 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 */
-};
-extern struct intrhand *intrhand[];
-extern struct intrhand *intrlev[MAXINTNUM];
-
-void intr_establish(int level, struct intrhand *);
-
/* disksubr.c */
struct dkbad;
int isbad(struct dkbad *bt, int, int, int);
@@ -275,13 +244,8 @@ void savefpstate(struct fpstate64 *);
void loadfpstate(struct fpstate64 *);
u_int64_t probeget(paddr_t, int, int);
int probeset(paddr_t, int, int, u_int64_t);
-#if 0
-void write_all_windows(void);
-void write_user_windows(void);
-#else
#define write_all_windows() __asm __volatile("flushw" : : )
#define write_user_windows() __asm __volatile("flushw" : : )
-#endif
void proc_trampoline(void);
struct pcb;
void snapshot(struct pcb *);
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_ */