Module Name:    src
Committed By:   riz
Date:           Mon Sep  3 19:11:31 UTC 2012

Modified Files:
        src/sys/arch/powerpc/pic [netbsd-6]: intr.c

Log Message:
Pull up following revision(s) (requested by macallan in ticket #535):
        sys/arch/powerpc/pic/intr.c: revision 1.23
when calculating per-IPL virq masks, take into account that shared =20
IRQs may
request different IPLs
fixes vr(4)-related problems seen on ofppc


To generate a diff of this commit:
cvs rdiff -u -r1.20.2.1 -r1.20.2.2 src/sys/arch/powerpc/pic/intr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/powerpc/pic/intr.c
diff -u src/sys/arch/powerpc/pic/intr.c:1.20.2.1 src/sys/arch/powerpc/pic/intr.c:1.20.2.2
--- src/sys/arch/powerpc/pic/intr.c:1.20.2.1	Tue Jun 12 19:35:46 2012
+++ src/sys/arch/powerpc/pic/intr.c	Mon Sep  3 19:11:30 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.20.2.1 2012/06/12 19:35:46 riz Exp $ */
+/*	$NetBSD: intr.c,v 1.20.2.2 2012/09/03 19:11:30 riz Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.20.2.1 2012/06/12 19:35:46 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.20.2.2 2012/09/03 19:11:30 riz Exp $");
 
 #include "opt_interrupt.h"
 #include "opt_multiprocessor.h"
@@ -352,8 +352,9 @@ intr_typename(int type)
 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 @@ intr_calculatemasks(void)
 
 	/* 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 @@ intr_calculatemasks(void)
 		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 @@ spllower(int ncpl)
 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();
 }

Reply via email to