summaryrefslogtreecommitdiff
path: root/sys/arch/sgi/xbow
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/sgi/xbow')
-rw-r--r--sys/arch/sgi/xbow/xbow.c8
-rw-r--r--sys/arch/sgi/xbow/xbow.h7
-rw-r--r--sys/arch/sgi/xbow/xbridge.c4
-rw-r--r--sys/arch/sgi/xbow/xheart.c22
4 files changed, 25 insertions, 16 deletions
diff --git a/sys/arch/sgi/xbow/xbow.c b/sys/arch/sgi/xbow/xbow.c
index 9be999d45be..43c5adc0f96 100644
--- a/sys/arch/sgi/xbow/xbow.c
+++ b/sys/arch/sgi/xbow/xbow.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xbow.c,v 1.25 2009/11/18 19:05:53 miod Exp $ */
+/* $OpenBSD: xbow.c,v 1.26 2009/11/25 11:23:30 miod Exp $ */
/*
* Copyright (c) 2008, 2009 Miodrag Vallat.
@@ -665,7 +665,7 @@ int xbow_intr_widget = 0;
paddr_t xbow_intr_widget_register;
int (*xbow_intr_widget_intr_register)(int, int, int *) = NULL;
int (*xbow_intr_widget_intr_establish)(int (*)(void *), void *, int, int,
- const char *) = NULL;
+ const char *, struct intrhand *) = NULL;
void (*xbow_intr_widget_intr_disestablish)(int) = NULL;
void (*xbow_intr_widget_intr_set)(int) = NULL;
void (*xbow_intr_widget_intr_clear)(int) = NULL;
@@ -681,13 +681,13 @@ xbow_intr_register(int widget, int level, int *intrbit)
int
xbow_intr_establish(int (*func)(void *), void *arg, int intrbit, int level,
- const char *name)
+ const char *name, struct intrhand *ihstore)
{
if (xbow_intr_widget_intr_establish == NULL)
return EINVAL;
return (*xbow_intr_widget_intr_establish)(func, arg, intrbit, level,
- name);
+ name, ihstore);
}
void
diff --git a/sys/arch/sgi/xbow/xbow.h b/sys/arch/sgi/xbow/xbow.h
index 579cf7a6770..7775aba34ed 100644
--- a/sys/arch/sgi/xbow/xbow.h
+++ b/sys/arch/sgi/xbow/xbow.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xbow.h,v 1.9 2009/11/18 19:05:53 miod Exp $ */
+/* $OpenBSD: xbow.h,v 1.10 2009/11/25 11:23:30 miod Exp $ */
/*
* Copyright (c) 2008 Miodrag Vallat.
@@ -50,7 +50,7 @@ extern paddr_t xbow_intr_widget_register;
extern int (*xbow_intr_widget_intr_register)(int, int, int *);
extern int (*xbow_intr_widget_intr_establish)(int (*)(void *), void *,
- int, int, const char *);
+ int, int, const char *, struct intrhand *);
extern void (*xbow_intr_widget_intr_disestablish)(int);
extern void (*xbow_intr_widget_intr_set)(int);
@@ -80,7 +80,8 @@ struct xbow_attach_args {
void xbow_build_bus_space(struct mips_bus_space *, int, int);
int xbow_intr_register(int, int, int *);
-int xbow_intr_establish(int (*)(void *), void *, int, int, const char *);
+int xbow_intr_establish(int (*)(void *), void *, int, int, const char *,
+ struct intrhand *);
void xbow_intr_disestablish(int);
void xbow_intr_clear(int);
void xbow_intr_set(int);
diff --git a/sys/arch/sgi/xbow/xbridge.c b/sys/arch/sgi/xbow/xbridge.c
index deada09cff4..da82dc060aa 100644
--- a/sys/arch/sgi/xbow/xbridge.c
+++ b/sys/arch/sgi/xbow/xbridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xbridge.c,v 1.63 2009/11/19 06:07:05 miod Exp $ */
+/* $OpenBSD: xbridge.c,v 1.64 2009/11/25 11:23:30 miod Exp $ */
/*
* Copyright (c) 2008, 2009 Miodrag Vallat.
@@ -984,7 +984,7 @@ xbridge_intr_establish(void *cookie, pci_intr_handle_t ih, int level,
* XXX between devices of different levels.
*/
if (xbow_intr_establish(xbridge_intr_handler, xi, intrsrc,
- IPL_BIO, NULL)) {
+ IPL_BIO, NULL, NULL)) {
printf("%s: unable to register interrupt handler\n",
DEVNAME(xb));
return NULL;
diff --git a/sys/arch/sgi/xbow/xheart.c b/sys/arch/sgi/xbow/xheart.c
index 100a2211df6..547456d716b 100644
--- a/sys/arch/sgi/xbow/xheart.c
+++ b/sys/arch/sgi/xbow/xheart.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xheart.c,v 1.16 2009/11/12 17:13:35 miod Exp $ */
+/* $OpenBSD: xheart.c,v 1.17 2009/11/25 11:23:30 miod Exp $ */
/*
* Copyright (c) 2008 Miodrag Vallat.
@@ -64,7 +64,8 @@ int xheart_ow_triplet(void *, int);
int xheart_ow_pulse(struct xheart_softc *, int, int);
int xheart_intr_register(int, int, int *);
-int xheart_intr_establish(int (*)(void *), void *, int, int, const char *);
+int xheart_intr_establish(int (*)(void *), void *, int, int, const char *,
+ struct intrhand *);
void xheart_intr_disestablish(int);
void xheart_intr_clear(int);
void xheart_intr_set(int);
@@ -291,7 +292,7 @@ found:
*/
int
xheart_intr_establish(int (*func)(void *), void *arg, int intrbit,
- int level, const char *name)
+ int level, const char *name, struct intrhand *ihstore)
{
struct intrhand *ih;
int s;
@@ -308,9 +309,15 @@ xheart_intr_establish(int (*func)(void *), void *arg, int intrbit,
if (xheart_intrhand[intrbit] != NULL)
return EEXIST;
- ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
- if (ih == NULL)
- return ENOMEM;
+ if (ihstore == NULL) {
+ ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
+ if (ih == NULL)
+ return ENOMEM;
+ ih->ih_flags = IH_ALLOCATED;
+ } else {
+ ih = ihstore;
+ ih->ih_flags = 0;
+ }
ih->ih_next = NULL;
ih->ih_fun = func;
@@ -358,7 +365,8 @@ xheart_intr_disestablish(int intrbit)
splx(s);
- free(ih, M_DEVBUF);
+ if (ISSET(ih->ih_flags, IH_ALLOCATED))
+ free(ih, M_DEVBUF);
}
void