summaryrefslogtreecommitdiff
path: root/sys/arch/mac68k/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-12-08 06:59:46 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-12-08 06:59:46 +0000
commit306580664beba87a40d32773f4549231cbf70be7 (patch)
treed4db9cba908a902c27ccb75ad06fd623e41db538 /sys/arch/mac68k/dev
parenta3a34c3c6b12a2a3e9461379fbe1d73dc712b8ae (diff)
Tweak interrupt handling code to allow shared interrupts for VIA2 sources.
This will be necessary shortly.
Diffstat (limited to 'sys/arch/mac68k/dev')
-rw-r--r--sys/arch/mac68k/dev/esp.c13
-rw-r--r--sys/arch/mac68k/dev/espvar.h3
-rw-r--r--sys/arch/mac68k/dev/if_ae_nubus.c11
-rw-r--r--sys/arch/mac68k/dev/mac68k5380.c15
-rw-r--r--sys/arch/mac68k/dev/sbc_obio.c15
-rw-r--r--sys/arch/mac68k/dev/sbcvar.h3
6 files changed, 39 insertions, 21 deletions
diff --git a/sys/arch/mac68k/dev/esp.c b/sys/arch/mac68k/dev/esp.c
index 927f0a20d38..4b9bd537693 100644
--- a/sys/arch/mac68k/dev/esp.c
+++ b/sys/arch/mac68k/dev/esp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: esp.c,v 1.18 2004/11/26 21:21:24 miod Exp $ */
+/* $OpenBSD: esp.c,v 1.19 2004/12/08 06:59:43 miod Exp $ */
/* $NetBSD: esp.c,v 1.59 1996/10/13 02:59:48 christos Exp $ */
/*
@@ -179,6 +179,9 @@ espattach(parent, self, aux)
*/
sc->sc_glue = &esp_glue;
+ esc->sc_ih.vh_fn = ncr53c9x_intr;
+ esc->sc_ih.vh_arg = esc;
+
/*
* Save the regs
*/
@@ -186,8 +189,8 @@ espattach(parent, self, aux)
unsigned long reg_offset;
esc->sc_reg = (volatile u_char *) SCSIBase;
- via2_register_irq(VIA2_SCSIIRQ, ncr53c9x_intr, esc,
- self->dv_xname);
+ esc->sc_ih.vh_ipl = VIA2_SCSIIRQ;
+ via2_register_irq(&esc->sc_ih, self->dv_xname);
esc->irq_mask = V2IF_SCSIIRQ;
reg_offset = SCSIBase - IOBase;
if (reg_offset == 0x10000) {
@@ -197,8 +200,8 @@ espattach(parent, self, aux)
}
} else {
esc->sc_reg = (volatile u_char *) SCSIBase + 0x402;
- via2_register_irq(VIA2_SCSIDRQ, ncr53c9x_intr, esc,
- self->dv_xname);
+ esc->sc_ih.vh_ipl = VIA2_SCSIDRQ;
+ via2_register_irq(&esc->sc_ih, self->dv_xname);
esc->irq_mask = V2IF_SCSIDRQ; /* V2IF_T1? */
sc->sc_freq = 25000000;
}
diff --git a/sys/arch/mac68k/dev/espvar.h b/sys/arch/mac68k/dev/espvar.h
index 95921cd2aba..38370af83ef 100644
--- a/sys/arch/mac68k/dev/espvar.h
+++ b/sys/arch/mac68k/dev/espvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: espvar.h,v 1.4 2001/07/04 08:52:45 niklas Exp $ */
+/* $OpenBSD: espvar.h,v 1.5 2004/12/08 06:59:43 miod Exp $ */
/* $NetBSD: espvar.h,v 1.16 1996/10/13 02:59:50 christos Exp $ */
/*
@@ -33,6 +33,7 @@
struct esp_softc {
struct ncr53c9x_softc sc_ncr53c9x; /* glue to MI code */
+ struct via2hand sc_ih;
volatile u_char *sc_reg; /* the registers */
diff --git a/sys/arch/mac68k/dev/if_ae_nubus.c b/sys/arch/mac68k/dev/if_ae_nubus.c
index 9ede3d5cf43..631f7f9532a 100644
--- a/sys/arch/mac68k/dev/if_ae_nubus.c
+++ b/sys/arch/mac68k/dev/if_ae_nubus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ae_nubus.c,v 1.11 2004/12/01 21:19:11 miod Exp $ */
+/* $OpenBSD: if_ae_nubus.c,v 1.12 2004/12/08 06:59:43 miod Exp $ */
/* $NetBSD: if_ae_nubus.c,v 1.17 1997/05/01 18:17:16 briggs Exp $ */
/*
@@ -426,15 +426,18 @@ ae_nb_watchdog(ifp)
struct ifnet *ifp;
{
struct ae_softc *sc = ifp->if_softc;
- extern struct intrhand via2intrs[7];
+ extern via2hand_t via2intrs[7];
/*
* This is a kludge! The via code seems to miss slot interrupts
* sometimes. This kludges around that by calling the handler
* by hand if the watchdog is activated. -- XXX (akb)
+ * XXX note that this assumes the nubus handler is first in the chain.
*/
- if (via2intrs[1].ih_fn != NULL)
- (void)(*via2intrs[1].ih_fn)(via2intrs[1].ih_arg);
+ if (!SLIST_EMPTY(&via2intrs[1])) {
+ struct via2hand *vh = SLIST_FIRST(&via2intrs[1]);
+ (void)(*vh->vh_fn)(vh->vh_arg);
+ }
log(LOG_ERR, "%s: device timeout\n", sc->sc_dev.dv_xname);
++sc->sc_arpcom.ac_if.if_oerrors;
diff --git a/sys/arch/mac68k/dev/mac68k5380.c b/sys/arch/mac68k/dev/mac68k5380.c
index 5a409ef50d7..097a580521c 100644
--- a/sys/arch/mac68k/dev/mac68k5380.c
+++ b/sys/arch/mac68k/dev/mac68k5380.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mac68k5380.c,v 1.19 2004/11/26 21:21:24 miod Exp $ */
+/* $OpenBSD: mac68k5380.c,v 1.20 2004/12/08 06:59:43 miod Exp $ */
/* $NetBSD: mac68k5380.c,v 1.29 1997/02/28 15:50:50 scottr Exp $ */
/*
@@ -155,6 +155,7 @@ scsi_mach_init(sc)
struct ncr_softc *sc;
{
static int initted = 0;
+ static struct via2hand ih_irq, ih_drq;
if (initted++)
panic("scsi_mach_init called again.");
@@ -174,10 +175,14 @@ scsi_mach_init(sc)
scsi_flag = Via1Base + VIA2 * 0x2000 + rIFR;
}
- via2_register_irq(VIA2_SCSIIRQ, ncr5380_irq_intr, sc,
- sc->sc_dev.dv_xname);
- via2_register_irq(VIA2_SCSIDRQ, ncr5380_drq_intr, sc,
- sc->sc_dev.dv_xname);
+ ih_irq.vh_fn = ncr5380_irq_intr;
+ ih_irq.vh_arg = sc;
+ ih_irq.vh_ipl = VIA2_SCSIIRQ;
+ via2_register_irq(&ih_irq, sc->sc_dev.dv_xname);
+ ih_drq.vh_fn = ncr5380_drq_intr;
+ ih_drq.vh_arg = sc;
+ ih_drq.vh_ipl = VIA2_SCSIDRQ;
+ via2_register_irq(&ih_drq, sc->sc_dev.dv_xname);
}
static int
diff --git a/sys/arch/mac68k/dev/sbc_obio.c b/sys/arch/mac68k/dev/sbc_obio.c
index bff4f430845..6051a2c2076 100644
--- a/sys/arch/mac68k/dev/sbc_obio.c
+++ b/sys/arch/mac68k/dev/sbc_obio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbc_obio.c,v 1.10 2004/12/02 06:43:25 miod Exp $ */
+/* $OpenBSD: sbc_obio.c,v 1.11 2004/12/08 06:59:43 miod Exp $ */
/* $NetBSD: sbc_obio.c,v 1.1 1997/03/01 20:18:59 scottr Exp $ */
/*
@@ -211,12 +211,17 @@ sbc_obio_attach(parent, self, args)
ncr_sc->sc_dma_start = sbc_dma_start;
ncr_sc->sc_dma_eop = sbc_dma_eop;
ncr_sc->sc_dma_stop = sbc_dma_stop;
- via2_register_irq(VIA2_SCSIDRQ, sbc_drq_intr, ncr_sc,
- ncr_sc->sc_dev.dv_xname);
+
+ sc->sc_ih_drq.vh_fn = sbc_drq_intr;
+ sc->sc_ih_drq.vh_arg = ncr_sc;
+ sc->sc_ih_drq.vh_ipl = VIA2_SCSIDRQ;
+ via2_register_irq(&sc->sc_ih_drq, ncr_sc->sc_dev.dv_xname);
}
- via2_register_irq(VIA2_SCSIIRQ, sbc_irq_intr, ncr_sc,
- ncr_sc->sc_dev.dv_xname);
+ sc->sc_ih_irq.vh_fn = sbc_irq_intr;
+ sc->sc_ih_irq.vh_arg = ncr_sc;
+ sc->sc_ih_irq.vh_ipl = VIA2_SCSIIRQ;
+ via2_register_irq(&sc->sc_ih_irq, ncr_sc->sc_dev.dv_xname);
sc->sc_clrintr = sbc_obio_clrintr;
if (sc->sc_options)
diff --git a/sys/arch/mac68k/dev/sbcvar.h b/sys/arch/mac68k/dev/sbcvar.h
index 4bec0604efd..96551d234dc 100644
--- a/sys/arch/mac68k/dev/sbcvar.h
+++ b/sys/arch/mac68k/dev/sbcvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbcvar.h,v 1.4 2004/12/02 06:43:25 miod Exp $ */
+/* $OpenBSD: sbcvar.h,v 1.5 2004/12/08 06:59:43 miod Exp $ */
/* $NetBSD: sbcvar.h,v 1.1 1997/03/01 20:19:00 scottr Exp $ */
/*
@@ -75,6 +75,7 @@ struct sbc_pdma_handle {
*/
struct sbc_softc {
struct ncr5380_softc ncr_sc;
+ struct via2hand sc_ih_drq, sc_ih_irq;
volatile struct sbc_regs *sc_regs;
volatile vm_offset_t sc_drq_addr;
volatile vm_offset_t sc_nodrq_addr;