diff options
Diffstat (limited to 'sys/arch/alpha')
-rw-r--r-- | sys/arch/alpha/dev/shared_intr.c | 26 | ||||
-rw-r--r-- | sys/arch/alpha/include/intr.h | 4 | ||||
-rw-r--r-- | sys/arch/alpha/isa/isa_machdep.h | 5 | ||||
-rw-r--r-- | sys/arch/alpha/pci/sio.c | 3 | ||||
-rw-r--r-- | sys/arch/alpha/pci/sio_pic.c | 13 | ||||
-rw-r--r-- | sys/arch/alpha/pci/siovar.h | 3 |
6 files changed, 48 insertions, 6 deletions
diff --git a/sys/arch/alpha/dev/shared_intr.c b/sys/arch/alpha/dev/shared_intr.c index 3bda076be0c..bc547ccd8bd 100644 --- a/sys/arch/alpha/dev/shared_intr.c +++ b/sys/arch/alpha/dev/shared_intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shared_intr.c,v 1.2 1997/11/10 15:53:08 niklas Exp $ */ +/* $OpenBSD: shared_intr.c,v 1.3 1998/06/29 05:32:50 downsj Exp $ */ /* $NetBSD: shared_intr.c,v 1.1 1996/11/17 02:03:08 cgd Exp $ */ /* @@ -115,6 +115,30 @@ alpha_shared_intr_dispatch(intr, num) return (handled); } +int +alpha_shared_intr_check(intr, num, type) + struct alpha_shared_intr *intr; + unsigned int num; + int type; +{ + if (intr[num].intr_sharetype == IST_UNUSABLE) + return (0); + + switch (intr[num].intr_sharetype) { + case IST_EDGE: + case IST_LEVEL: + if (type == intr[num].intr_sharetype) + break; + case IST_PULSE: + if ((type != IST_NONE) && (intr[num].intr_q.tqh_first != NULL)) + return (0); + case IST_NONE: + break; + } + + return (1); +} + void * alpha_shared_intr_establish(intr, num, type, level, fn, arg, basename) struct alpha_shared_intr *intr; diff --git a/sys/arch/alpha/include/intr.h b/sys/arch/alpha/include/intr.h index 6100a7ff0c1..6f4b5c59974 100644 --- a/sys/arch/alpha/include/intr.h +++ b/sys/arch/alpha/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.4 1997/01/24 19:57:12 niklas Exp $ */ +/* $OpenBSD: intr.h,v 1.5 1998/06/29 05:32:51 downsj Exp $ */ /* $NetBSD: intr.h,v 1.4 1996/12/03 17:34:47 cgd Exp $ */ /* @@ -94,6 +94,8 @@ struct alpha_shared_intr { struct alpha_shared_intr *alpha_shared_intr_alloc __P((unsigned int)); int alpha_shared_intr_dispatch __P((struct alpha_shared_intr *, unsigned int)); +int alpha_shared_intr_check __P((struct alpha_shared_intr *, + unsigned int, int)); void *alpha_shared_intr_establish __P((struct alpha_shared_intr *, unsigned int, int, int, int (*)(void *), void *, const char *)); int alpha_shared_intr_get_sharetype __P((struct alpha_shared_intr *, diff --git a/sys/arch/alpha/isa/isa_machdep.h b/sys/arch/alpha/isa/isa_machdep.h index 4fa25b19952..6f3745d0bc6 100644 --- a/sys/arch/alpha/isa/isa_machdep.h +++ b/sys/arch/alpha/isa/isa_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: isa_machdep.h,v 1.4 1997/01/24 19:57:24 niklas Exp $ */ +/* $OpenBSD: isa_machdep.h,v 1.5 1998/06/29 05:32:53 downsj Exp $ */ /* $NetBSD: isa_machdep.h,v 1.3 1996/11/19 04:53:07 cgd Exp $ */ /* @@ -41,6 +41,7 @@ struct alpha_isa_chipset { void *(*ic_intr_establish) __P((void *, int, int, int, int (*)(void *), void *, char *)); void (*ic_intr_disestablish) __P((void *, void *)); + int (*ic_intr_check) __P((void *, int, int)); }; /* @@ -52,6 +53,8 @@ struct alpha_isa_chipset { (*(c)->ic_intr_establish)((c)->ic_v, (i), (t), (l), (f), (a), (nm)) #define isa_intr_disestablish(c, h) \ (*(c)->ic_intr_disestablish)((c)->ic_v, (h)) +#define isa_intr_check(c, i, t) \ + (*(c)->ic_intr_check)((c)->ic_v, (i), (t)) /* * alpha-specific ISA functions. diff --git a/sys/arch/alpha/pci/sio.c b/sys/arch/alpha/pci/sio.c index d166adfbf9d..23776832526 100644 --- a/sys/arch/alpha/pci/sio.c +++ b/sys/arch/alpha/pci/sio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sio.c,v 1.13 1998/02/24 02:05:20 millert Exp $ */ +/* $OpenBSD: sio.c,v 1.14 1998/06/29 05:32:54 downsj Exp $ */ /* $NetBSD: sio.c,v 1.15 1996/12/05 01:39:36 cgd Exp $ */ /* @@ -191,6 +191,7 @@ sio_bridge_callback(v) ic.ic_attach_hook = sio_isa_attach_hook; ic.ic_intr_establish = sio_intr_establish; ic.ic_intr_disestablish = sio_intr_disestablish; + ic.ic_intr_check = sio_intr_check; sa.sa_iba.iba_busname = "isa"; sa.sa_iba.iba_iot = sc->sc_iot; diff --git a/sys/arch/alpha/pci/sio_pic.c b/sys/arch/alpha/pci/sio_pic.c index b92e263e395..a219f89a30c 100644 --- a/sys/arch/alpha/pci/sio_pic.c +++ b/sys/arch/alpha/pci/sio_pic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sio_pic.c,v 1.10 1998/03/18 00:48:29 angelos Exp $ */ +/* $OpenBSD: sio_pic.c,v 1.11 1998/06/29 05:32:55 downsj Exp $ */ /* $NetBSD: sio_pic.c,v 1.16 1996/11/17 02:05:26 cgd Exp $ */ /* @@ -270,6 +270,17 @@ sio_intr_string(v, irq) return (irqstr); } +int +sio_intr_check(v, irq, type) + void *v; + int irq, type; +{ + if (irq > ICU_LEN || type == IST_NONE) + return (0); + + return (alpha_shared_intr_check(sio_intr, irq, type)); +} + void * sio_intr_establish(v, irq, type, level, fn, arg, name) void *v, *arg; diff --git a/sys/arch/alpha/pci/siovar.h b/sys/arch/alpha/pci/siovar.h index 48bab3d8dfb..9cf8866b82b 100644 --- a/sys/arch/alpha/pci/siovar.h +++ b/sys/arch/alpha/pci/siovar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: siovar.h,v 1.5 1996/12/08 00:20:50 niklas Exp $ */ +/* $OpenBSD: siovar.h,v 1.6 1998/06/29 05:32:57 downsj Exp $ */ /* $NetBSD: siovar.h,v 1.5 1996/10/23 04:12:34 cgd Exp $ */ /* @@ -32,6 +32,7 @@ void sio_intr_setup __P((bus_space_tag_t)); void sio_iointr __P((void *framep, unsigned long vec)); const char *sio_intr_string __P((void *, int)); +int sio_intr_check __P((void *, int, int)); void *sio_intr_establish __P((void *, int, int, int, int (*)(void *), void *, char *)); void sio_intr_disestablish __P((void *, void *)); |