diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/x86/faults.cc | 14 | ||||
-rw-r--r-- | src/arch/x86/faults.hh | 19 |
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) {} }; |