Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/atari/isa Ack EOI for IRQ_SLAVE of the master PIC a...



details:   https://anonhg.NetBSD.org/src/rev/ea3785520685
branches:  trunk
changeset: 829177:ea3785520685
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Jan 20 19:36:47 2018 +0000

description:
Ack EOI for IRQ_SLAVE of the master PIC after ack for IRQ of the slave PIC.

I'm not sure if there are possible races in the original code, but
this is what i8259_asm_ack2() in sys/arch/x86/include/i8259.h does
and it looks this change makes a Milan kernel a bit stable.

diffstat:

 sys/arch/atari/isa/isa_milan.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (57 lines):

diff -r 8b6ebd644deb -r ea3785520685 sys/arch/atari/isa/isa_milan.c
--- a/sys/arch/atari/isa/isa_milan.c    Sat Jan 20 19:33:53 2018 +0000
+++ b/sys/arch/atari/isa/isa_milan.c    Sat Jan 20 19:36:47 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: isa_milan.c,v 1.15 2018/01/20 18:33:09 tsutsui Exp $   */
+/*     $NetBSD: isa_milan.c,v 1.16 2018/01/20 19:36:47 tsutsui Exp $   */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isa_milan.c,v 1.15 2018/01/20 18:33:09 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa_milan.c,v 1.16 2018/01/20 19:36:47 tsutsui Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -122,9 +122,11 @@
 
        s = splx(iinfo_p->ipl);
        (void) (iinfo_p->ifunc)(iinfo_p->iarg);
-       if (vector > 7)
+       if (vector > 7) {
                WICU(AD_8259_SLAVE, 0x60 | (vector & 7));
-       else WICU(AD_8259_MASTER, 0x60 | (vector & 7));
+               vector = IRQ_SLAVE;
+       }
+       WICU(AD_8259_MASTER, 0x60 | (vector & 7));
        splx(s);
 }
 
@@ -140,10 +142,6 @@
                return;
        }
 
-       /* Ack cascade 0x60 == Specific EOI             */
-       if (vector > 7)
-               WICU(AD_8259_MASTER, 0x60|IRQ_SLAVE);
-
        iinfo_p = &milan_isa_iinfo[vector];
        if (iinfo_p->ifunc == NULL) {
                printf("milan_isa_intr: Stray interrupt: %d (mask:%04x)\n",
@@ -159,9 +157,11 @@
        else {
                s = splx(iinfo_p->ipl);
                (void) (iinfo_p->ifunc)(iinfo_p->iarg);
-               if (vector > 7)
+               if (vector > 7) {
                        WICU(AD_8259_SLAVE, 0x60 | (vector & 7));
-               else WICU(AD_8259_MASTER, 0x60 | (vector & 7));
+                       vector = IRQ_SLAVE;
+               }
+               WICU(AD_8259_MASTER, 0x60 | (vector & 7));
                splx(s);
        }
 }



Home | Main Index | Thread Index | Old Index