changeset f33045b4dbee in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=f33045b4dbee
description:
        X86: Make the I8259 PIC accept a specific EOI command.

diffstat:

2 files changed, 3 insertions(+), 2 deletions(-)
src/dev/x86/i8259.cc |    4 ++--
src/dev/x86/i8259.hh |    1 +

diffs (79 lines):

diff -r a55b78e4b6d6 -r f33045b4dbee src/dev/x86/i8259.cc
--- a/src/dev/x86/i8259.cc      Sun Oct 12 23:05:22 2008 -0700
+++ b/src/dev/x86/i8259.cc      Sun Oct 12 23:22:58 2008 -0700
@@ -107,8 +107,12 @@
                 DPRINTF(I8259, "Subcommand: No operation.\n");
                 break;
               case 0x3:
-                DPRINTF(I8259, "Subcommand: Specific EIO.");
-                DPRINTF(I8259, "Reset In-Service bit %d.\n", bits(val, 2, 0));
+                {
+                    int line = bits(val, 2, 0);
+                    DPRINTF(I8259, "Subcommand: Specific EIO on line %d.\n",
+                            line);
+                    handleEOI(line);
+                }
                 break;
               case 0x4:
                 DPRINTF(I8259, "Subcommand: Rotate in auto-EOI mode (set).\n");
@@ -206,6 +210,30 @@
 }
 
 void
+X86ISA::I8259::handleEOI(int line)
+{
+    ISR &= ~(1 << line);
+    // There may be an interrupt that was waiting which can
+    // now be sent.
+    if (IRR)
+        requestInterrupt(findMsbSet(IRR));
+}
+
+void
+X86ISA::I8259::requestInterrupt(int line)
+{
+    if (bits(ISR, 7, line) == 0) {
+        if (output) {
+            DPRINTF(I8259, "Propogating interrupt.\n");
+            output->signalInterrupt();
+        } else {
+            warn("Received interrupt but didn't have "
+                    "anyone to tell about it.\n");
+        }
+    }
+}
+
+void
 X86ISA::I8259::signalInterrupt(int line)
 {
     DPRINTF(I8259, "Interrupt raised on line %d.\n", line);
@@ -216,15 +244,7 @@
         DPRINTF(I8259, "Interrupt %d was masked.\n", line);
     } else {
         IRR |= 1 << line;
-        if (bits(ISR, 7, line) == 0) {
-            if (output) {
-                DPRINTF(I8259, "Propogating interrupt.\n");
-                output->signalInterrupt();
-            } else {
-                warn("Received interrupt but didn't have "
-                        "anyone to tell about it.\n");
-            }
-        }
+        requestInterrupt(line);
     }
 }
 
diff -r a55b78e4b6d6 -r f33045b4dbee src/dev/x86/i8259.hh
--- a/src/dev/x86/i8259.hh      Sun Oct 12 23:05:22 2008 -0700
+++ b/src/dev/x86/i8259.hh      Sun Oct 12 23:22:58 2008 -0700
@@ -73,6 +73,9 @@
     bool expectICW4;
     int initControlWord;
 
+    void requestInterrupt(int line);
+    void handleEOI(int line);
+
   public:
     typedef I8259Params Params;
 
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to