diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2012-04-15 20:40:40 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2012-04-15 20:40:40 +0000 |
commit | ddd4a6ae7c06594ec976059318dc36aad02c083a (patch) | |
tree | 4fd091cff7a841dddd79b653e62a56409e6e15d7 | |
parent | 1988780eca61e41f0d80c1f65987b3bc6f5115be (diff) |
Provide an hpc_intr_establish() function for hpc subdevices, so they don't
need to have knowledge of the underlying interrupt controller. No functional
change.
-rw-r--r-- | sys/arch/sgi/hpc/hpc.c | 14 | ||||
-rw-r--r-- | sys/arch/sgi/hpc/hpcvar.h | 7 | ||||
-rw-r--r-- | sys/arch/sgi/hpc/if_sq.c | 5 | ||||
-rw-r--r-- | sys/arch/sgi/hpc/wdsc.c | 5 | ||||
-rw-r--r-- | sys/arch/sgi/hpc/zs.c | 5 |
5 files changed, 24 insertions, 12 deletions
diff --git a/sys/arch/sgi/hpc/hpc.c b/sys/arch/sgi/hpc/hpc.c index 9af8b30cc9c..88a58383f2e 100644 --- a/sys/arch/sgi/hpc/hpc.c +++ b/sys/arch/sgi/hpc/hpc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hpc.c,v 1.6 2012/04/15 20:38:10 miod Exp $ */ +/* $OpenBSD: hpc.c,v 1.7 2012/04/15 20:40:39 miod Exp $ */ /* $NetBSD: hpc.c,v 1.66 2011/07/01 18:53:46 dyoung Exp $ */ /* $NetBSD: ioc.c,v 1.9 2011/07/01 18:53:47 dyoung Exp $ */ @@ -93,8 +93,11 @@ #include <sgi/gio/gioreg.h> #include <sgi/gio/giovar.h> -#include <sgi/hpc/hpcvar.h> #include <sgi/hpc/hpcreg.h> +#include <sgi/hpc/hpcvar.h> +#include <sgi/localbus/imcvar.h> +#include <sgi/localbus/intreg.h> +#include <sgi/localbus/intvar.h> #include <sgi/hpc/iocreg.h> #include <sgi/sgi/ip22.h> @@ -766,6 +769,13 @@ hpc_print(void *aux, const char *pnp) return UNCONF; } +void * +hpc_intr_establish(int irq, int level, int (*handler)(void *), void *arg, + const char *what) +{ + return int2_intr_establish(irq, level, handler, arg, what); +} + /* * bus_space_barrier() function for HPC3 (which have a write buffer) */ diff --git a/sys/arch/sgi/hpc/hpcvar.h b/sys/arch/sgi/hpc/hpcvar.h index 0debe5fd001..f0511489288 100644 --- a/sys/arch/sgi/hpc/hpcvar.h +++ b/sys/arch/sgi/hpc/hpcvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hpcvar.h,v 1.3 2012/04/08 22:08:25 miod Exp $ */ +/* $OpenBSD: hpcvar.h,v 1.4 2012/04/15 20:40:39 miod Exp $ */ /* $NetBSD: hpcvar.h,v 1.12 2011/01/25 12:21:04 tsutsui Exp $ */ /* @@ -107,3 +107,8 @@ struct hpc_attach_args { uint8_t hpc_eeprom[256];/* HPC eeprom contents */ }; + +void *hpc_intr_establish(int, int, int (*)(void *), + void *, const char *); + +extern bus_space_t hpc3bus_tag; diff --git a/sys/arch/sgi/hpc/if_sq.c b/sys/arch/sgi/hpc/if_sq.c index 259aa1ad178..80907710d39 100644 --- a/sys/arch/sgi/hpc/if_sq.c +++ b/sys/arch/sgi/hpc/if_sq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sq.c,v 1.3 2012/04/08 22:08:25 miod Exp $ */ +/* $OpenBSD: if_sq.c,v 1.4 2012/04/15 20:40:39 miod Exp $ */ /* $NetBSD: if_sq.c,v 1.42 2011/07/01 18:53:47 dyoung Exp $ */ /* @@ -73,7 +73,6 @@ #include <machine/intr.h> #include <mips64/arcbios.h> /* bios_enaddr */ #include <sgi/sgi/ip22.h> -#include <sgi/localbus/intvar.h> #include <dev/ic/seeq8003reg.h> @@ -289,7 +288,7 @@ sq_attach(struct device *parent, struct device *self, void *aux) sc->sc_ac.ac_enaddr[2] != SGI_OUI_2) enaddr_aton(bios_enaddr, sc->sc_ac.ac_enaddr); - if ((int2_intr_establish(haa->ha_irq, IPL_NET, sq_intr, sc, + if ((hpc_intr_establish(haa->ha_irq, IPL_NET, sq_intr, sc, self->dv_xname)) == NULL) { printf(": unable to establish interrupt!\n"); goto fail_6; diff --git a/sys/arch/sgi/hpc/wdsc.c b/sys/arch/sgi/hpc/wdsc.c index 101b5178819..7db90b26182 100644 --- a/sys/arch/sgi/hpc/wdsc.c +++ b/sys/arch/sgi/hpc/wdsc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wdsc.c,v 1.1 2012/03/28 20:44:23 miod Exp $ */ +/* $OpenBSD: wdsc.c,v 1.2 2012/04/15 20:40:39 miod Exp $ */ /* $NetBSD: wdsc.c,v 1.32 2011/07/01 18:53:47 dyoung Exp $ */ /* @@ -52,7 +52,6 @@ #include <machine/autoconf.h> #include <machine/bus.h> #include <machine/cpu.h> -#include <sgi/localbus/intvar.h> #include <sgi/hpc/hpcreg.h> #include <sgi/hpc/hpcvar.h> @@ -173,7 +172,7 @@ wdsc_attach(struct device *parent, struct device *self, void *aux) sc->sc_clkfreq = 200; /* 20MHz */ sc->sc_dmamode = SBIC_CTL_BURST_DMA; - if (int2_intr_establish(haa->ha_irq, IPL_BIO, + if (hpc_intr_establish(haa->ha_irq, IPL_BIO, wd33c93_intr, wsc, self->dv_xname) == NULL) { printf(": unable to establish interrupt!\n"); return; diff --git a/sys/arch/sgi/hpc/zs.c b/sys/arch/sgi/hpc/zs.c index fdf6eeef1b4..ff01333b005 100644 --- a/sys/arch/sgi/hpc/zs.c +++ b/sys/arch/sgi/hpc/zs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zs.c,v 1.4 2012/04/05 21:48:37 miod Exp $ */ +/* $OpenBSD: zs.c,v 1.5 2012/04/15 20:40:39 miod Exp $ */ /* $NetBSD: zs.c,v 1.37 2011/02/20 07:59:50 matt Exp $ */ /*- @@ -62,7 +62,6 @@ #include <sgi/hpc/hpcvar.h> #include <sgi/hpc/hpcreg.h> -#include <sgi/localbus/intvar.h> /* * Some warts needed by z8530tty.c - @@ -289,7 +288,7 @@ zs_hpc_attach(struct device *parent, struct device *self, void *aux) zsc->sc_si = softintr_establish(IPL_SOFTTTY, zssoft, zsc); - int2_intr_establish(haa->ha_irq, IPL_TTY, zshard, zsc, self->dv_xname); + hpc_intr_establish(haa->ha_irq, IPL_TTY, zshard, zsc, self->dv_xname); /* * Set the master interrupt enable and interrupt vector. |