Re: quiet irq 9

KIYOHARA Takashi <[email protected]>
Newsgroups gmane.os.netbsd.ports.cobalt
Message-ID <[email protected]>
Hi! tsutsui-san,


From: Izumi Tsutsui <[email protected]>
Date: Thu, 19 Jun 2008 22:43:53 +0900

> > Does this mean interrupt will not happen in after EOI is issued by
> > mistake at happening of interrupt in i8259 in a word?
> 
> When I wrote EOI code in cobalt/interrupt.c:icu_intr(),
> I wondered whether EOI should be sent before calling
> interrupt handlers to avoid possible race, but some other
> 8259 code (algor/pci/pcib.c etc.) did send EOI after
> calling handlers, so I left it.

I try to issue EOI before calling intrrupt handlers. However i8259 not 
respond.

Index: interrupt.c
===================================================================
RCS file: /cvsroot/src/sys/arch/cobalt/cobalt/interrupt.c,v
retrieving revision 1.3
diff -u -r1.3 interrupt.c
--- interrupt.c	14 May 2008 13:29:27 -0000	1.3
+++ interrupt.c	21 Jun 2008 01:33:59 -0000
@@ -333,6 +333,20 @@
 			irq = OCW3_POLL_IRQ(ICU2_READ(PIC_OCW3)) + 8;
 		}
 
+#if 1
+{
+int _irq = irq;
+		/* issue EOI to ack */
+		if (_irq >= 8) {
+			ICU2_WRITE(PIC_OCW2,
+			    OCW2_SELECT | OCW2_SL | OCW2_EOI |
+			    OCW2_ILS(_irq - 8));
+			_irq = IRQ_SLAVE;
+		}
+		ICU1_WRITE(PIC_OCW2,
+		    OCW2_SELECT | OCW2_SL | OCW2_EOI | OCW2_ILS(_irq));
+}
+#endif
 		icu_intrtab[irq].intr_evcnt.ev_count++;
 		LIST_FOREACH(ih, &icu_intrtab[irq].intr_q, ih_q) {
 			if (__predict_false(ih->ih_func == NULL))
@@ -343,6 +357,7 @@
 			}
 		}
 
+#if 0
 		/* issue EOI to ack */
 		if (irq >= 8) {
 			ICU2_WRITE(PIC_OCW2,
@@ -352,6 +367,7 @@
 		}
 		ICU1_WRITE(PIC_OCW2,
 		    OCW2_SELECT | OCW2_SL | OCW2_EOI | OCW2_ILS(irq));
+#endif
 	}
 }
 

Have you good idea?

Thanks,
--
kiyohara
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.