summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2008-10-12 22:42:10 -0700
committerGabe Black <gblack@eecs.umich.edu>2008-10-12 22:42:10 -0700
commit9e8e2f9ec6ae4ea3be8f5280a1ca4cb734e3e068 (patch)
treea9e124e2bf543a3e538667ba8b1fcd3ca16ec8c6 /src/arch/x86
parent4c19c56a7706c7382f46c4f8c7dd10c2b2c8746a (diff)
downloadgem5-9e8e2f9ec6ae4ea3be8f5280a1ca4cb734e3e068.tar.xz
X86: Make the x86 interrupt fault kick off the interrupt microcode.
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/faults.cc14
-rw-r--r--src/arch/x86/faults.hh19
2 files changed, 22 insertions, 11 deletions
diff --git a/src/arch/x86/faults.cc b/src/arch/x86/faults.cc
index 1c94a1251..18680899e 100644
--- a/src/arch/x86/faults.cc
+++ b/src/arch/x86/faults.cc
@@ -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 @@ namespace X86ISA
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 --git a/src/arch/x86/faults.hh b/src/arch/x86/faults.hh
index b15ad15d1..b7948a638 100644
--- a/src/arch/x86/faults.hh
+++ b/src/arch/x86/faults.hh
@@ -137,9 +137,10 @@ namespace X86ISA
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 @@ namespace X86ISA
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 @@ namespace X86ISA
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 @@ namespace X86ISA
{
public:
SystemManagementInterrupt() :
- X86Interrupt("System Management Interrupt", "#SMI")
+ X86Interrupt("System Management Interrupt", "#SMI", 0)
{}
};
@@ -372,15 +371,15 @@ namespace X86ISA
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)
{}
};