Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc/pic when calculating per-IPL virq masks, ta...



details:   https://anonhg.NetBSD.org/src/rev/483c3bef75b6
branches:  trunk
changeset: 781302:483c3bef75b6
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Aug 31 13:12:52 2012 +0000

description:
when calculating per-IPL virq masks, take into account that shared IRQs may
request different IPLs
fixes vr(4)-related problems seen on ofppc

diffstat:

 sys/arch/powerpc/pic/intr.c |  21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diffs (64 lines):

diff -r b9e7e7f48d30 -r 483c3bef75b6 sys/arch/powerpc/pic/intr.c
--- a/sys/arch/powerpc/pic/intr.c       Fri Aug 31 12:01:15 2012 +0000
+++ b/sys/arch/powerpc/pic/intr.c       Fri Aug 31 13:12:52 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.c,v 1.22 2012/06/07 04:37:09 macallan Exp $ */
+/*     $NetBSD: intr.c,v 1.23 2012/08/31 13:12:52 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.22 2012/06/07 04:37:09 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.23 2012/08/31 13:12:52 macallan Exp $");
 
 #include "opt_interrupt.h"
 #include "opt_multiprocessor.h"
@@ -352,8 +352,9 @@
 static void
 intr_calculatemasks(void)
 {
-       imask_t newmask[NIPL] = { [IPL_NONE...IPL_HIGH] = 0 };
+       imask_t newmask[NIPL];
        struct intr_source *is;
+       struct intrhand *ih;
        int irq;
 
        for (u_int ipl = IPL_NONE; ipl < NIPL; ipl++) {
@@ -362,7 +363,9 @@
 
        /* First, figure out which ipl each IRQ uses. */
        for (irq = 0, is = intrsources; irq < NVIRQ; irq++, is++) {
-               newmask[is->is_ipl] |= PIC_VIRQ_TO_MASK(irq);
+               for (ih = is->is_hand; ih != NULL; ih = ih->ih_next) {
+                       newmask[ih->ih_ipl] |= PIC_VIRQ_TO_MASK(irq);
+               }
        }
 
        /*
@@ -379,7 +382,7 @@
                newmask[ipl] |= newmask[ipl - 1];
        }
 
-#ifdef DEBUG_IPL
+#ifdef PIC_DEBUG
        for (u_int ipl = 0; ipl < NIPL; ipl++) {
                printf("%u: %08x -> %08x\n", ipl, imask[ipl], newmask[ipl]);
        }
@@ -661,10 +664,10 @@
 void
 genppc_cpu_configure(void)
 {
-       aprint_normal("biomask %x netmask %x ttymask %x\n",
-           (u_int)imask[IPL_BIO] & 0x1fffffff,
-           (u_int)imask[IPL_NET] & 0x1fffffff,
-           (u_int)imask[IPL_TTY] & 0x1fffffff);
+       aprint_normal("vmmask %x schedmask %x highmask %x\n",
+           (u_int)imask[IPL_VM] & 0x7fffffff,
+           (u_int)imask[IPL_SCHED] & 0x7fffffff,
+           (u_int)imask[IPL_HIGH] & 0x7fffffff);
 
        spl0();
 }



Home | Main Index | Thread Index | Old Index