summaryrefslogtreecommitdiff
path: root/sys/arch/macppc/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/macppc/dev')
-rw-r--r--sys/arch/macppc/dev/macintr.c22
-rw-r--r--sys/arch/macppc/dev/openpic.c36
-rw-r--r--sys/arch/macppc/dev/zs.c17
3 files changed, 32 insertions, 43 deletions
diff --git a/sys/arch/macppc/dev/macintr.c b/sys/arch/macppc/dev/macintr.c
index f0f38b0a962..c73e45c0d9b 100644
--- a/sys/arch/macppc/dev/macintr.c
+++ b/sys/arch/macppc/dev/macintr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: macintr.c,v 1.38 2009/08/22 02:54:50 mk Exp $ */
+/* $OpenBSD: macintr.c,v 1.39 2009/10/01 20:19:18 kettenis Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -374,7 +374,7 @@ intr_calculatemasks()
for (irq = 0; irq < ICU_LEN; irq++)
if (m_intrlevel[irq] & (1 << level))
irqs |= 1 << irq;
- imask[level] = irqs | SINT_MASK;
+ imask[level] = irqs | SINT_ALLMASK;
}
/*
@@ -387,7 +387,7 @@ intr_calculatemasks()
imask[IPL_NET] |= imask[IPL_BIO];
imask[IPL_TTY] |= imask[IPL_NET];
imask[IPL_VM] |= imask[IPL_TTY];
- imask[IPL_CLOCK] |= imask[IPL_VM] | SPL_CLOCK;
+ imask[IPL_CLOCK] |= imask[IPL_VM] | SPL_CLOCKMASK;
/*
* These are pseudo-levels.
@@ -400,7 +400,7 @@ intr_calculatemasks()
register int irqs = 1 << irq;
for (q = m_intrhand[irq]; q; q = q->ih_next)
irqs |= imask[q->ih_level];
- m_intrmask[irq] = irqs | SINT_MASK;
+ m_intrmask[irq] = irqs | SINT_ALLMASK;
}
/* Lastly, determine which IRQs are actually in use. */
@@ -579,23 +579,17 @@ mac_intr_do_pending_int()
do {
if((ci->ci_ipending & SINT_CLOCK) & ~pcpl) {
ci->ci_ipending &= ~SINT_CLOCK;
- softclock();
+ softintr_dispatch(SI_SOFTCLOCK);
}
if((ci->ci_ipending & SINT_NET) & ~pcpl) {
- extern int netisr;
- int pisr;
-
ci->ci_ipending &= ~SINT_NET;
- while ((pisr = netisr) != 0) {
- atomic_clearbits_int(&netisr, pisr);
- softnet(pisr);
- }
+ softintr_dispatch(SI_SOFTNET);
}
if((ci->ci_ipending & SINT_TTY) & ~pcpl) {
ci->ci_ipending &= ~SINT_TTY;
- softtty();
+ softintr_dispatch(SI_SOFTTTY);
}
- } while ((ci->ci_ipending & SINT_MASK) & ~pcpl);
+ } while ((ci->ci_ipending & SINT_ALLMASK) & ~pcpl);
ci->ci_ipending &= pcpl;
ci->ci_cpl = pcpl; /* Don't use splx... we are here already! */
ppc_intr_enable(s);
diff --git a/sys/arch/macppc/dev/openpic.c b/sys/arch/macppc/dev/openpic.c
index ca863b97c3e..2fc2070031c 100644
--- a/sys/arch/macppc/dev/openpic.c
+++ b/sys/arch/macppc/dev/openpic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openpic.c,v 1.57 2009/09/15 21:02:24 kettenis Exp $ */
+/* $OpenBSD: openpic.c,v 1.58 2009/10/01 20:19:18 kettenis Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -71,8 +71,8 @@ static int mapirq(int irq);
int openpic_prog_button(void *arg);
void openpic_enable_irq_mask(int irq_mask);
-#define HWIRQ_MAX 27
-#define HWIRQ_MASK 0x0fffffff
+#define HWIRQ_MAX (31 - (SI_NQUEUES + 1))
+#define HWIRQ_MASK (0xffffffff >> (SI_NQUEUES + 1))
/* IRQ vector used for inter-processor interrupts. */
#define IPI_VECTOR_NOP 64
@@ -414,9 +414,9 @@ openpic_calc_mask()
for (i = IPL_NONE; i <= IPL_HIGH; i++) {
if (i > IPL_NONE)
- imask[i] |= SINT_MASK;
+ imask[i] |= SINT_ALLMASK;
if (i >= IPL_CLOCK)
- imask[i] |= SPL_CLOCK;
+ imask[i] |= SPL_CLOCKMASK;
}
imask[IPL_HIGH] = 0xffffffff;
}
@@ -492,7 +492,7 @@ openpic_do_pending_int()
if (pripending == 0)
continue;
irq = 31 - cntlzw(pripending);
- ci->ci_ipending &= ~(1L << irq);
+ ci->ci_ipending &= ~(1 << irq);
ci->ci_cpl = imask[o_intrmaxlvl[o_hwirq[irq]]];
openpic_enable_irq_mask(~ci->ci_cpl);
ih = o_intrhand[irq];
@@ -512,7 +512,7 @@ openpic_do_pending_int()
hwpend = ci->ci_ipending & ~pcpl;/* Catch new pendings */
hwpend &= HWIRQ_MASK;
}
- ci->ci_cpl = pcpl | SINT_MASK;
+ ci->ci_cpl = pcpl | SINT_ALLMASK;
openpic_enable_irq_mask(~ci->ci_cpl);
atomic_clearbits_int(&ci->ci_iactive, CI_IACTIVE_PROCESSING_HARD);
@@ -537,25 +537,19 @@ openpic_do_pending_softint(int pcpl)
ci->ci_cpl = SINT_CLOCK|SINT_NET|SINT_TTY;
ppc_intr_enable(1);
KERNEL_LOCK();
- softclock();
+ softintr_dispatch(SI_SOFTCLOCK);
KERNEL_UNLOCK();
ppc_intr_disable();
continue;
}
if((ci->ci_ipending & SINT_NET) & ~pcpl) {
- extern int netisr;
- int pisr;
-
ci->ci_ipending &= ~SINT_NET;
ci->ci_cpl = SINT_NET|SINT_TTY;
- while ((pisr = netisr) != 0) {
- atomic_clearbits_int(&netisr, pisr);
- ppc_intr_enable(1);
- KERNEL_LOCK();
- softnet(pisr);
- KERNEL_UNLOCK();
- ppc_intr_disable();
- }
+ ppc_intr_enable(1);
+ KERNEL_LOCK();
+ softintr_dispatch(SI_SOFTNET);
+ KERNEL_UNLOCK();
+ ppc_intr_disable();
continue;
}
if((ci->ci_ipending & SINT_TTY) & ~pcpl) {
@@ -563,12 +557,12 @@ openpic_do_pending_softint(int pcpl)
ci->ci_cpl = SINT_TTY;
ppc_intr_enable(1);
KERNEL_LOCK();
- softtty();
+ softintr_dispatch(SI_SOFTTTY);
KERNEL_UNLOCK();
ppc_intr_disable();
continue;
}
- } while ((ci->ci_ipending & SINT_MASK) & ~pcpl);
+ } while ((ci->ci_ipending & SINT_ALLMASK) & ~pcpl);
ci->ci_cpl = pcpl; /* Don't use splx... we are here already! */
atomic_clearbits_int(&ci->ci_iactive, CI_IACTIVE_PROCESSING_SOFT);
diff --git a/sys/arch/macppc/dev/zs.c b/sys/arch/macppc/dev/zs.c
index 317992a7e22..0cfbb93f9f3 100644
--- a/sys/arch/macppc/dev/zs.c
+++ b/sys/arch/macppc/dev/zs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zs.c,v 1.17 2008/08/19 07:59:19 kettenis Exp $ */
+/* $OpenBSD: zs.c,v 1.18 2009/10/01 20:19:18 kettenis Exp $ */
/* $NetBSD: zs.c,v 1.17 2001/06/19 13:42:15 wiz Exp $ */
/*
@@ -170,7 +170,7 @@ struct cfattach zsc_ca = {
extern struct cfdriver zsc_cd;
int zshard(void *);
-int zssoft(void *);
+void zssoft(void *);
#ifdef ZS_TXDMA
int zs_txdma_int(void *);
#endif
@@ -393,6 +393,9 @@ zsc_attach(struct device *parent, struct device *self, void *aux)
mac_intr_establish(parent, intr[1][1], IST_LEVEL, IPL_TTY,
zs_txdma_int, (void *)1, "zsdma1");
#endif
+ zsc->zsc_softintr = softintr_establish(IPL_SOFTTTY, zssoft, zsc);
+ if (zsc->zsc_softintr == NULL)
+ panic("zsattach: could not establish soft interrupt");
/*
* Set the master interrupt enable and interrupt vector.
@@ -476,8 +479,7 @@ zshard(void *arg)
/* We are at splzs here, so no need to lock. */
if (zssoftpending == 0) {
zssoftpending = 1;
- /* XXX setsoftserial(); */
- setsofttty(); /* UGLY HACK!!! */
+ softintr_schedule(zsc->zsc_softintr);
}
}
}
@@ -487,7 +489,7 @@ zshard(void *arg)
/*
* Similar scheme as for zshard (look at all of them)
*/
-int
+void
zssoft(arg)
void *arg;
{
@@ -496,7 +498,7 @@ zssoft(arg)
/* This is not the only ISR on this IPL. */
if (zssoftpending == 0)
- return (0);
+ return;
/*
* The soft intr. bit will be set by zshard only if
@@ -510,7 +512,6 @@ zssoft(arg)
continue;
(void) zsc_intr_soft(zsc);
}
- return (1);
}
#ifdef ZS_TXDMA
@@ -534,7 +535,7 @@ zs_txdma_int(arg)
if (cs->cs_softreq) {
if (zssoftpending == 0) {
zssoftpending = 1;
- setsoftserial();
+ softintr_schedule(zsc->zsc_softintr);
}
}
return 1;