Subject: Re: "soft" interrupts busted on MacPPC
To: None <port-macppc@netbsd.org>
From: Makoto Fujiwara <makoto@ki.nu>
List: port-macppc
Date: 01/30/2002 11:35:17
Hi, Donald,
I have got your two files, have diff between them,
and apply patch + manually modify on extintr.c-1.12.4.1,
which is netbsd-1-5 tag src, and build a kernel.

I have one thing to check in mind, ttya console hangs when 
20-50 chars are fed fast, say, by copy-and-paste from the other screen.

I thought it was 10% related, but nothing changed after patch applied.
That's the story before I read the recent mail.

Now I have checked the diff, and it seems to me it is already included
in 1.5.3_ALPHA src. The diff I have here are:

---
Makoto Fujiwara

--- extintr.c-1.12.4.1	Thu Nov  2 01:26:07 2000
+++ extintr.c	Sat Jan 26 21:19:51 2002
@@ -618,6 +618,7 @@
 	int irq;
 	int pcpl;
 	int hwpend;
+	int softpend;
 	int emsr, dmsr;
 	static int processing;
 
@@ -630,7 +631,9 @@
 	asm volatile("mtmsr %0" :: "r"(dmsr));
 
 	pcpl = splhigh();		/* Turn off all */
+	softpend = ipending & ~pcpl;	/* pending "softies" */
 	hwpend = ipending & ~pcpl;	/* Do now unmasked pendings */
+	ipending &= pcpl;		/* Clear ints we're about to do */
 	if (!have_openpic) {
 		imen &= ~hwpend;
 		enable_irq(~imen);
@@ -652,22 +655,21 @@
 
 	/*out32rb(INT_ENABLE_REG, ~imen);*/
 
-	if ((ipending & ~pcpl) & (1 << SIR_CLOCK)) {
+	if (softpend & (1 << SIR_CLOCK)) {
 		ipending &= ~(1 << SIR_CLOCK);
 		softclock();
 		intrcnt[CNT_SOFTCLOCK]++;
 	}
-	if ((ipending & ~pcpl) & (1 << SIR_NET)) {
+	if (softpend & (1 << SIR_NET)) {
 		ipending &= ~(1 << SIR_NET);
 		softnet();
 		intrcnt[CNT_SOFTNET]++;
 	}
-	if ((ipending & ~pcpl) & (1 << SIR_SERIAL)) {
+	if (softpend & (1 << SIR_SERIAL)) {
 		ipending &= ~(1 << SIR_SERIAL);
 		softserial();
 		intrcnt[CNT_SOFTSERIAL]++;
 	}
-	ipending &= pcpl;
 	cpl = pcpl;	/* Don't use splx... we are here already! */
 	asm volatile("mtmsr %0" :: "r"(emsr));
 	processing = 0;