changeset 54c2d92f601e in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=54c2d92f601e
description:
        X86: Make the x86 interrupt fault kick off the interrupt microcode.

diffstat:

1 file changed, 1 insertion(+), 1 deletion(-)
src/arch/x86/faults.hh |    2 +-

diffs (99 lines):

diff -r 39ae093fb4eb -r 54c2d92f601e src/arch/x86/faults.cc
--- a/src/arch/x86/faults.cc    Sun Oct 12 22:42:03 2008 -0700
+++ b/src/arch/x86/faults.cc    Sun Oct 12 22:42:10 2008 -0700
@@ -85,6 +85,7 @@
  * Authors: Gabe Black
  */
 
+#include "arch/x86/decoder.hh"
 #include "arch/x86/faults.hh"
 #include "base/trace.hh"
 #include "config/full_system.hh"
@@ -112,7 +113,18 @@
 
     void X86Interrupt::invoke(ThreadContext * tc)
     {
-        panic("X86 faults are not implemented!");
+        using namespace X86ISAInst::RomLabels;
+        HandyM5Reg m5reg = tc->readMiscRegNoEffect(MISCREG_M5_REG);
+        MicroPC entry;
+        if (m5reg.mode == LongMode) {
+            entry = extern_label_longModeInterrupt;
+        } else {
+            entry = extern_label_legacyModeInterrupt;
+        }
+        tc->setIntReg(INTREG_MICRO(1), vector);
+        tc->setIntReg(INTREG_MICRO(7), tc->readPC());
+        tc->setMicroPC(romMicroPC(entry));
+        tc->setNextMicroPC(romMicroPC(entry) + 1);
     }
 
     void FakeITLBFault::invoke(ThreadContext * tc)
diff -r 39ae093fb4eb -r 54c2d92f601e src/arch/x86/faults.hh
--- a/src/arch/x86/faults.hh    Sun Oct 12 22:42:03 2008 -0700
+++ b/src/arch/x86/faults.hh    Sun Oct 12 22:42:10 2008 -0700
@@ -137,9 +137,10 @@
     class X86Interrupt : public X86FaultBase
     {
       protected:
-        X86Interrupt(const char * name, const char * mnem,
+        uint8_t vector;
+        X86Interrupt(const char * name, const char * mnem, uint8_t _vector,
                 uint64_t _errorCode = 0) :
-            X86FaultBase(name, mnem, _errorCode)
+            X86FaultBase(name, mnem, _errorCode), vector(_vector)
         {}
 
 #if FULL_SYSTEM
@@ -215,10 +216,9 @@
 
     class NonMaskableInterrupt : public X86Interrupt
     {
-        uint8_t vector;
       public:
         NonMaskableInterrupt(uint8_t _vector) :
-            X86Interrupt("Non Maskable Interrupt", "#NMI"), vector(_vector)
+            X86Interrupt("Non Maskable Interrupt", "#NMI", _vector)
         {}
     };
 
@@ -352,10 +352,9 @@
 
     class ExternalInterrupt : public X86Interrupt
     {
-        uint8_t vector;
       public:
         ExternalInterrupt(uint8_t _vector) :
-            X86Interrupt("External Interrupt", "#INTR"), vector(_vector)
+            X86Interrupt("External Interrupt", "#INTR", _vector)
         {}
     };
 
@@ -363,7 +362,7 @@
     {
       public:
         SystemManagementInterrupt() :
-            X86Interrupt("System Management Interrupt", "#SMI")
+            X86Interrupt("System Management Interrupt", "#SMI", 0)
         {}
     };
 
@@ -372,15 +371,15 @@
         uint8_t vector;
       public:
         InitInterrupt(uint8_t _vector) :
-            X86Interrupt("INIT Interrupt", "#INIT"), vector(_vector)
+            X86Interrupt("INIT Interrupt", "#INIT", _vector)
         {}
     };
 
     class SoftwareInterrupt : public X86Interrupt
     {
       public:
-        SoftwareInterrupt() :
-            X86Interrupt("Software Interrupt", "INTn")
+        SoftwareInterrupt(uint8_t _vector) :
+            X86Interrupt("Software Interrupt", "INTn", _vector)
         {}
     };
 
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to