faults.hh revision 5681
14120Sgblack@eecs.umich.edu/* 24120Sgblack@eecs.umich.edu * Copyright (c) 2007 The Hewlett-Packard Development Company 34120Sgblack@eecs.umich.edu * All rights reserved. 44120Sgblack@eecs.umich.edu * 54120Sgblack@eecs.umich.edu * Redistribution and use of this software in source and binary forms, 64120Sgblack@eecs.umich.edu * with or without modification, are permitted provided that the 74120Sgblack@eecs.umich.edu * following conditions are met: 84120Sgblack@eecs.umich.edu * 94120Sgblack@eecs.umich.edu * The software must be used only for Non-Commercial Use which means any 104120Sgblack@eecs.umich.edu * use which is NOT directed to receiving any direct monetary 114120Sgblack@eecs.umich.edu * compensation for, or commercial advantage from such use. Illustrative 124120Sgblack@eecs.umich.edu * examples of non-commercial use are academic research, personal study, 134120Sgblack@eecs.umich.edu * teaching, education and corporate research & development. 144120Sgblack@eecs.umich.edu * Illustrative examples of commercial use are distributing products for 154120Sgblack@eecs.umich.edu * commercial advantage and providing services using the software for 164120Sgblack@eecs.umich.edu * commercial advantage. 174120Sgblack@eecs.umich.edu * 184120Sgblack@eecs.umich.edu * If you wish to use this software or functionality therein that may be 194120Sgblack@eecs.umich.edu * covered by patents for commercial use, please contact: 204120Sgblack@eecs.umich.edu * Director of Intellectual Property Licensing 214120Sgblack@eecs.umich.edu * Office of Strategy and Technology 224120Sgblack@eecs.umich.edu * Hewlett-Packard Company 234120Sgblack@eecs.umich.edu * 1501 Page Mill Road 244120Sgblack@eecs.umich.edu * Palo Alto, California 94304 254120Sgblack@eecs.umich.edu * 264120Sgblack@eecs.umich.edu * Redistributions of source code must retain the above copyright notice, 274120Sgblack@eecs.umich.edu * this list of conditions and the following disclaimer. Redistributions 284120Sgblack@eecs.umich.edu * in binary form must reproduce the above copyright notice, this list of 294120Sgblack@eecs.umich.edu * conditions and the following disclaimer in the documentation and/or 304120Sgblack@eecs.umich.edu * other materials provided with the distribution. Neither the name of 314120Sgblack@eecs.umich.edu * the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its 324120Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from 334120Sgblack@eecs.umich.edu * this software without specific prior written permission. No right of 344120Sgblack@eecs.umich.edu * sublicense is granted herewith. Derivatives of the software and 354120Sgblack@eecs.umich.edu * output created using the software may be prepared, but only for 364120Sgblack@eecs.umich.edu * Non-Commercial Uses. Derivatives of the software may be shared with 374120Sgblack@eecs.umich.edu * others provided: (i) the others agree to abide by the list of 384120Sgblack@eecs.umich.edu * conditions herein which includes the Non-Commercial Use restrictions; 394120Sgblack@eecs.umich.edu * and (ii) such Derivatives of the software include the above copyright 404120Sgblack@eecs.umich.edu * notice to acknowledge the contribution from this software where 414120Sgblack@eecs.umich.edu * applicable, this list of conditions and the disclaimer below. 424120Sgblack@eecs.umich.edu * 434120Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 444120Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 454120Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 464120Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 474120Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 484120Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 494120Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 504120Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 514120Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 524120Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 534120Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 544120Sgblack@eecs.umich.edu * 554120Sgblack@eecs.umich.edu * Authors: Gabe Black 564120Sgblack@eecs.umich.edu */ 574120Sgblack@eecs.umich.edu 584120Sgblack@eecs.umich.edu#ifndef __ARCH_X86_FAULTS_HH__ 594120Sgblack@eecs.umich.edu#define __ARCH_X86_FAULTS_HH__ 604120Sgblack@eecs.umich.edu 614139Sgblack@eecs.umich.edu#include "base/misc.hh" 624135Sgblack@eecs.umich.edu#include "sim/faults.hh" 634120Sgblack@eecs.umich.edu 644120Sgblack@eecs.umich.edunamespace X86ISA 654120Sgblack@eecs.umich.edu{ 665114Sgblack@eecs.umich.edu // Base class for all x86 "faults" where faults is in the m5 sense 675114Sgblack@eecs.umich.edu class X86FaultBase : public FaultBase 684135Sgblack@eecs.umich.edu { 694365Sgblack@eecs.umich.edu protected: 705114Sgblack@eecs.umich.edu const char * faultName; 715114Sgblack@eecs.umich.edu const char * mnem; 725139Sgblack@eecs.umich.edu uint64_t errorCode; 735114Sgblack@eecs.umich.edu 745139Sgblack@eecs.umich.edu X86FaultBase(const char * _faultName, const char * _mnem, 755139Sgblack@eecs.umich.edu uint64_t _errorCode = 0) : 765139Sgblack@eecs.umich.edu faultName(_faultName), mnem(_mnem), errorCode(_errorCode) 775114Sgblack@eecs.umich.edu { 785114Sgblack@eecs.umich.edu } 795114Sgblack@eecs.umich.edu 804729Sgblack@eecs.umich.edu const char * name() const 814365Sgblack@eecs.umich.edu { 825114Sgblack@eecs.umich.edu return faultName; 834365Sgblack@eecs.umich.edu } 844365Sgblack@eecs.umich.edu 855114Sgblack@eecs.umich.edu virtual bool isBenign() 865114Sgblack@eecs.umich.edu { 875114Sgblack@eecs.umich.edu return true; 885114Sgblack@eecs.umich.edu } 895114Sgblack@eecs.umich.edu 905114Sgblack@eecs.umich.edu virtual const char * mnemonic() const 915114Sgblack@eecs.umich.edu { 925114Sgblack@eecs.umich.edu return mnem; 935114Sgblack@eecs.umich.edu } 945114Sgblack@eecs.umich.edu }; 955114Sgblack@eecs.umich.edu 965114Sgblack@eecs.umich.edu // Base class for x86 faults which behave as if the underlying instruction 975114Sgblack@eecs.umich.edu // didn't happen. 985114Sgblack@eecs.umich.edu class X86Fault : public X86FaultBase 995114Sgblack@eecs.umich.edu { 1005114Sgblack@eecs.umich.edu protected: 1015139Sgblack@eecs.umich.edu X86Fault(const char * name, const char * mnem, 1025139Sgblack@eecs.umich.edu uint64_t _errorCode = 0) : 1035139Sgblack@eecs.umich.edu X86FaultBase(name, mnem, _errorCode) 1045114Sgblack@eecs.umich.edu {} 1055114Sgblack@eecs.umich.edu }; 1065114Sgblack@eecs.umich.edu 1075114Sgblack@eecs.umich.edu // Base class for x86 traps which behave as if the underlying instruction 1085114Sgblack@eecs.umich.edu // completed. 1095114Sgblack@eecs.umich.edu class X86Trap : public X86FaultBase 1105114Sgblack@eecs.umich.edu { 1115114Sgblack@eecs.umich.edu protected: 1125139Sgblack@eecs.umich.edu X86Trap(const char * name, const char * mnem, 1135139Sgblack@eecs.umich.edu uint64_t _errorCode = 0) : 1145139Sgblack@eecs.umich.edu X86FaultBase(name, mnem, _errorCode) 1155114Sgblack@eecs.umich.edu {} 1165114Sgblack@eecs.umich.edu 1175114Sgblack@eecs.umich.edu#if FULL_SYSTEM 1185124Sgblack@eecs.umich.edu void invoke(ThreadContext * tc); 1195114Sgblack@eecs.umich.edu#endif 1205114Sgblack@eecs.umich.edu }; 1215114Sgblack@eecs.umich.edu 1225114Sgblack@eecs.umich.edu // Base class for x86 aborts which seem to be catastrophic failures. 1235114Sgblack@eecs.umich.edu class X86Abort : public X86FaultBase 1245114Sgblack@eecs.umich.edu { 1255114Sgblack@eecs.umich.edu protected: 1265139Sgblack@eecs.umich.edu X86Abort(const char * name, const char * mnem, 1275139Sgblack@eecs.umich.edu uint64_t _errorCode = 0) : 1285139Sgblack@eecs.umich.edu X86FaultBase(name, mnem, _errorCode) 1295114Sgblack@eecs.umich.edu {} 1305114Sgblack@eecs.umich.edu 1315114Sgblack@eecs.umich.edu#if FULL_SYSTEM 1325124Sgblack@eecs.umich.edu void invoke(ThreadContext * tc); 1335114Sgblack@eecs.umich.edu#endif 1345114Sgblack@eecs.umich.edu }; 1355114Sgblack@eecs.umich.edu 1365114Sgblack@eecs.umich.edu // Base class for x86 interrupts. 1375114Sgblack@eecs.umich.edu class X86Interrupt : public X86FaultBase 1385114Sgblack@eecs.umich.edu { 1395114Sgblack@eecs.umich.edu protected: 1405681Sgblack@eecs.umich.edu uint8_t vector; 1415681Sgblack@eecs.umich.edu X86Interrupt(const char * name, const char * mnem, uint8_t _vector, 1425139Sgblack@eecs.umich.edu uint64_t _errorCode = 0) : 1435681Sgblack@eecs.umich.edu X86FaultBase(name, mnem, _errorCode), vector(_vector) 1445114Sgblack@eecs.umich.edu {} 1455114Sgblack@eecs.umich.edu 1465114Sgblack@eecs.umich.edu#if FULL_SYSTEM 1475124Sgblack@eecs.umich.edu void invoke(ThreadContext * tc); 1485114Sgblack@eecs.umich.edu#endif 1494135Sgblack@eecs.umich.edu }; 1504150Sgblack@eecs.umich.edu 1514365Sgblack@eecs.umich.edu class UnimpInstFault : public FaultBase 1524365Sgblack@eecs.umich.edu { 1534365Sgblack@eecs.umich.edu public: 1544729Sgblack@eecs.umich.edu const char * name() const 1554365Sgblack@eecs.umich.edu { 1564365Sgblack@eecs.umich.edu return "unimplemented_micro"; 1574365Sgblack@eecs.umich.edu } 1584365Sgblack@eecs.umich.edu 1594365Sgblack@eecs.umich.edu void invoke(ThreadContext * tc) 1604365Sgblack@eecs.umich.edu { 1614365Sgblack@eecs.umich.edu panic("Unimplemented instruction!"); 1624365Sgblack@eecs.umich.edu } 1634365Sgblack@eecs.umich.edu }; 1644365Sgblack@eecs.umich.edu 1654150Sgblack@eecs.umich.edu static inline Fault genMachineCheckFault() 1664150Sgblack@eecs.umich.edu { 1674150Sgblack@eecs.umich.edu panic("Machine check fault not implemented in x86!\n"); 1684150Sgblack@eecs.umich.edu } 1695114Sgblack@eecs.umich.edu 1705114Sgblack@eecs.umich.edu // Below is a summary of the interrupt/exception information in the 1715114Sgblack@eecs.umich.edu // architecture manuals. 1725114Sgblack@eecs.umich.edu 1735114Sgblack@eecs.umich.edu // Class | Type | vector | Cause | mnem 1745114Sgblack@eecs.umich.edu //------------------------------------------------------------------------ 1755114Sgblack@eecs.umich.edu //Contrib Fault 0 Divide-by-Zero-Error #DE 1765114Sgblack@eecs.umich.edu //Benign Either 1 Debug #DB 1775114Sgblack@eecs.umich.edu //Benign Interrupt 2 Non-Maskable-Interrupt #NMI 1785114Sgblack@eecs.umich.edu //Benign Trap 3 Breakpoint #BP 1795114Sgblack@eecs.umich.edu //Benign Trap 4 Overflow #OF 1805114Sgblack@eecs.umich.edu //Benign Fault 5 Bound-Range #BR 1815114Sgblack@eecs.umich.edu //Benign Fault 6 Invalid-Opcode #UD 1825114Sgblack@eecs.umich.edu //Benign Fault 7 Device-Not-Available #NM 1835114Sgblack@eecs.umich.edu //Benign Abort 8 Double-Fault #DF 1845114Sgblack@eecs.umich.edu // 9 Coprocessor-Segment-Overrun 1855114Sgblack@eecs.umich.edu //Contrib Fault 10 Invalid-TSS #TS 1865114Sgblack@eecs.umich.edu //Contrib Fault 11 Segment-Not-Present #NP 1875114Sgblack@eecs.umich.edu //Contrib Fault 12 Stack #SS 1885114Sgblack@eecs.umich.edu //Contrib Fault 13 General-Protection #GP 1895114Sgblack@eecs.umich.edu //Either Fault 14 Page-Fault #PF 1905114Sgblack@eecs.umich.edu // 15 Reserved 1915114Sgblack@eecs.umich.edu //Benign Fault 16 x87 Floating-Point Exception Pending #MF 1925114Sgblack@eecs.umich.edu //Benign Fault 17 Alignment-Check #AC 1935114Sgblack@eecs.umich.edu //Benign Abort 18 Machine-Check #MC 1945114Sgblack@eecs.umich.edu //Benign Fault 19 SIMD Floating-Point #XF 1955114Sgblack@eecs.umich.edu // 20-29 Reserved 1965114Sgblack@eecs.umich.edu //Contrib ? 30 Security Exception #SX 1975114Sgblack@eecs.umich.edu // 31 Reserved 1985114Sgblack@eecs.umich.edu //Benign Interrupt 0-255 External Interrupts #INTR 1995114Sgblack@eecs.umich.edu //Benign Interrupt 0-255 Software Interrupts INTn 2005114Sgblack@eecs.umich.edu 2015114Sgblack@eecs.umich.edu class DivideByZero : public X86Fault 2025114Sgblack@eecs.umich.edu { 2035114Sgblack@eecs.umich.edu public: 2045114Sgblack@eecs.umich.edu DivideByZero() : 2055114Sgblack@eecs.umich.edu X86Fault("Divide-by-Zero-Error", "#DE") 2065114Sgblack@eecs.umich.edu {} 2075114Sgblack@eecs.umich.edu }; 2085114Sgblack@eecs.umich.edu 2095114Sgblack@eecs.umich.edu class DebugException : public X86FaultBase 2105114Sgblack@eecs.umich.edu { 2115114Sgblack@eecs.umich.edu public: 2125114Sgblack@eecs.umich.edu DebugException() : 2135114Sgblack@eecs.umich.edu X86FaultBase("Debug", "#DB") 2145114Sgblack@eecs.umich.edu {} 2155114Sgblack@eecs.umich.edu }; 2165114Sgblack@eecs.umich.edu 2175114Sgblack@eecs.umich.edu class NonMaskableInterrupt : public X86Interrupt 2185114Sgblack@eecs.umich.edu { 2195114Sgblack@eecs.umich.edu public: 2205655Sgblack@eecs.umich.edu NonMaskableInterrupt(uint8_t _vector) : 2215681Sgblack@eecs.umich.edu X86Interrupt("Non Maskable Interrupt", "#NMI", _vector) 2225114Sgblack@eecs.umich.edu {} 2235114Sgblack@eecs.umich.edu }; 2245114Sgblack@eecs.umich.edu 2255114Sgblack@eecs.umich.edu class Breakpoint : public X86Trap 2265114Sgblack@eecs.umich.edu { 2275114Sgblack@eecs.umich.edu public: 2285114Sgblack@eecs.umich.edu Breakpoint() : 2295114Sgblack@eecs.umich.edu X86Trap("Breakpoint", "#BP") 2305114Sgblack@eecs.umich.edu {} 2315114Sgblack@eecs.umich.edu }; 2325114Sgblack@eecs.umich.edu 2335114Sgblack@eecs.umich.edu class OverflowTrap : public X86Trap 2345114Sgblack@eecs.umich.edu { 2355114Sgblack@eecs.umich.edu public: 2365114Sgblack@eecs.umich.edu OverflowTrap() : 2375114Sgblack@eecs.umich.edu X86Trap("Overflow", "#OF") 2385114Sgblack@eecs.umich.edu {} 2395114Sgblack@eecs.umich.edu }; 2405114Sgblack@eecs.umich.edu 2415114Sgblack@eecs.umich.edu class BoundRange : public X86Fault 2425114Sgblack@eecs.umich.edu { 2435114Sgblack@eecs.umich.edu public: 2445114Sgblack@eecs.umich.edu BoundRange() : 2455114Sgblack@eecs.umich.edu X86Fault("Bound-Range", "#BR") 2465114Sgblack@eecs.umich.edu {} 2475114Sgblack@eecs.umich.edu }; 2485114Sgblack@eecs.umich.edu 2495114Sgblack@eecs.umich.edu class InvalidOpcode : public X86Fault 2505114Sgblack@eecs.umich.edu { 2515114Sgblack@eecs.umich.edu public: 2525114Sgblack@eecs.umich.edu InvalidOpcode() : 2535114Sgblack@eecs.umich.edu X86Fault("Invalid-Opcode", "#UD") 2545114Sgblack@eecs.umich.edu {} 2555114Sgblack@eecs.umich.edu }; 2565114Sgblack@eecs.umich.edu 2575114Sgblack@eecs.umich.edu class DeviceNotAvailable : public X86Fault 2585114Sgblack@eecs.umich.edu { 2595114Sgblack@eecs.umich.edu public: 2605114Sgblack@eecs.umich.edu DeviceNotAvailable() : 2615114Sgblack@eecs.umich.edu X86Fault("Device-Not-Available", "#NM") 2625114Sgblack@eecs.umich.edu {} 2635114Sgblack@eecs.umich.edu }; 2645114Sgblack@eecs.umich.edu 2655114Sgblack@eecs.umich.edu class DoubleFault : public X86Abort 2665114Sgblack@eecs.umich.edu { 2675114Sgblack@eecs.umich.edu public: 2685114Sgblack@eecs.umich.edu DoubleFault() : 2695114Sgblack@eecs.umich.edu X86Abort("Double-Fault", "#DF") 2705114Sgblack@eecs.umich.edu {} 2715114Sgblack@eecs.umich.edu }; 2725114Sgblack@eecs.umich.edu 2735114Sgblack@eecs.umich.edu class InvalidTSS : public X86Fault 2745114Sgblack@eecs.umich.edu { 2755114Sgblack@eecs.umich.edu public: 2765114Sgblack@eecs.umich.edu InvalidTSS() : 2775114Sgblack@eecs.umich.edu X86Fault("Invalid-TSS", "#TS") 2785114Sgblack@eecs.umich.edu {} 2795114Sgblack@eecs.umich.edu }; 2805114Sgblack@eecs.umich.edu 2815114Sgblack@eecs.umich.edu class SegmentNotPresent : public X86Fault 2825114Sgblack@eecs.umich.edu { 2835114Sgblack@eecs.umich.edu public: 2845114Sgblack@eecs.umich.edu SegmentNotPresent() : 2855114Sgblack@eecs.umich.edu X86Fault("Segment-Not-Present", "#NP") 2865114Sgblack@eecs.umich.edu {} 2875114Sgblack@eecs.umich.edu }; 2885114Sgblack@eecs.umich.edu 2895114Sgblack@eecs.umich.edu class StackFault : public X86Fault 2905114Sgblack@eecs.umich.edu { 2915114Sgblack@eecs.umich.edu public: 2925114Sgblack@eecs.umich.edu StackFault() : 2935114Sgblack@eecs.umich.edu X86Fault("Stack", "#SS") 2945114Sgblack@eecs.umich.edu {} 2955114Sgblack@eecs.umich.edu }; 2965114Sgblack@eecs.umich.edu 2975114Sgblack@eecs.umich.edu class GeneralProtection : public X86Fault 2985114Sgblack@eecs.umich.edu { 2995114Sgblack@eecs.umich.edu public: 3005139Sgblack@eecs.umich.edu GeneralProtection(uint64_t _errorCode) : 3015139Sgblack@eecs.umich.edu X86Fault("General-Protection", "#GP", _errorCode) 3025114Sgblack@eecs.umich.edu {} 3035114Sgblack@eecs.umich.edu }; 3045114Sgblack@eecs.umich.edu 3055114Sgblack@eecs.umich.edu class PageFault : public X86Fault 3065114Sgblack@eecs.umich.edu { 3075114Sgblack@eecs.umich.edu public: 3085114Sgblack@eecs.umich.edu PageFault() : 3095114Sgblack@eecs.umich.edu X86Fault("Page-Fault", "#PF") 3105114Sgblack@eecs.umich.edu {} 3115114Sgblack@eecs.umich.edu }; 3125114Sgblack@eecs.umich.edu 3135114Sgblack@eecs.umich.edu class X87FpExceptionPending : public X86Fault 3145114Sgblack@eecs.umich.edu { 3155114Sgblack@eecs.umich.edu public: 3165114Sgblack@eecs.umich.edu X87FpExceptionPending() : 3175114Sgblack@eecs.umich.edu X86Fault("x87 Floating-Point Exception Pending", "#MF") 3185114Sgblack@eecs.umich.edu {} 3195114Sgblack@eecs.umich.edu }; 3205114Sgblack@eecs.umich.edu 3215652Sgblack@eecs.umich.edu class AlignmentCheck : public X86Fault 3225114Sgblack@eecs.umich.edu { 3235114Sgblack@eecs.umich.edu public: 3245114Sgblack@eecs.umich.edu AlignmentCheck() : 3255114Sgblack@eecs.umich.edu X86Fault("Alignment-Check", "#AC") 3265114Sgblack@eecs.umich.edu {} 3275114Sgblack@eecs.umich.edu }; 3285114Sgblack@eecs.umich.edu 3295652Sgblack@eecs.umich.edu class MachineCheck : public X86Abort 3305114Sgblack@eecs.umich.edu { 3315114Sgblack@eecs.umich.edu public: 3325114Sgblack@eecs.umich.edu MachineCheck() : 3335114Sgblack@eecs.umich.edu X86Abort("Machine-Check", "#MC") 3345114Sgblack@eecs.umich.edu {} 3355114Sgblack@eecs.umich.edu }; 3365114Sgblack@eecs.umich.edu 3375652Sgblack@eecs.umich.edu class SIMDFloatingPointFault : public X86Fault 3385114Sgblack@eecs.umich.edu { 3395114Sgblack@eecs.umich.edu public: 3405114Sgblack@eecs.umich.edu SIMDFloatingPointFault() : 3415114Sgblack@eecs.umich.edu X86Fault("SIMD Floating-Point", "#XF") 3425114Sgblack@eecs.umich.edu {} 3435114Sgblack@eecs.umich.edu }; 3445114Sgblack@eecs.umich.edu 3455652Sgblack@eecs.umich.edu class SecurityException : public X86FaultBase 3465114Sgblack@eecs.umich.edu { 3475114Sgblack@eecs.umich.edu public: 3485114Sgblack@eecs.umich.edu SecurityException() : 3495114Sgblack@eecs.umich.edu X86FaultBase("Security Exception", "#SX") 3505114Sgblack@eecs.umich.edu {} 3515114Sgblack@eecs.umich.edu }; 3525114Sgblack@eecs.umich.edu 3535652Sgblack@eecs.umich.edu class ExternalInterrupt : public X86Interrupt 3545114Sgblack@eecs.umich.edu { 3555114Sgblack@eecs.umich.edu public: 3565654Sgblack@eecs.umich.edu ExternalInterrupt(uint8_t _vector) : 3575681Sgblack@eecs.umich.edu X86Interrupt("External Interrupt", "#INTR", _vector) 3585114Sgblack@eecs.umich.edu {} 3595114Sgblack@eecs.umich.edu }; 3605114Sgblack@eecs.umich.edu 3615655Sgblack@eecs.umich.edu class SystemManagementInterrupt : public X86Interrupt 3625655Sgblack@eecs.umich.edu { 3635655Sgblack@eecs.umich.edu public: 3645655Sgblack@eecs.umich.edu SystemManagementInterrupt() : 3655681Sgblack@eecs.umich.edu X86Interrupt("System Management Interrupt", "#SMI", 0) 3665655Sgblack@eecs.umich.edu {} 3675655Sgblack@eecs.umich.edu }; 3685655Sgblack@eecs.umich.edu 3695655Sgblack@eecs.umich.edu class InitInterrupt : public X86Interrupt 3705655Sgblack@eecs.umich.edu { 3715655Sgblack@eecs.umich.edu uint8_t vector; 3725655Sgblack@eecs.umich.edu public: 3735655Sgblack@eecs.umich.edu InitInterrupt(uint8_t _vector) : 3745681Sgblack@eecs.umich.edu X86Interrupt("INIT Interrupt", "#INIT", _vector) 3755655Sgblack@eecs.umich.edu {} 3765655Sgblack@eecs.umich.edu }; 3775655Sgblack@eecs.umich.edu 3785652Sgblack@eecs.umich.edu class SoftwareInterrupt : public X86Interrupt 3795114Sgblack@eecs.umich.edu { 3805114Sgblack@eecs.umich.edu public: 3815681Sgblack@eecs.umich.edu SoftwareInterrupt(uint8_t _vector) : 3825681Sgblack@eecs.umich.edu X86Interrupt("Software Interrupt", "INTn", _vector) 3835114Sgblack@eecs.umich.edu {} 3845114Sgblack@eecs.umich.edu }; 3855114Sgblack@eecs.umich.edu 3865114Sgblack@eecs.umich.edu // These faults aren't part of the ISA definition. They trigger filling 3875114Sgblack@eecs.umich.edu // the tlb on a miss and are to take the place of a hardware table walker. 3885114Sgblack@eecs.umich.edu class FakeITLBFault : public X86Fault 3895114Sgblack@eecs.umich.edu { 3905124Sgblack@eecs.umich.edu protected: 3915124Sgblack@eecs.umich.edu Addr vaddr; 3925124Sgblack@eecs.umich.edu public: 3935124Sgblack@eecs.umich.edu FakeITLBFault(Addr _vaddr) : 3945124Sgblack@eecs.umich.edu X86Fault("fake instruction tlb fault", "itlb"), 3955124Sgblack@eecs.umich.edu vaddr(_vaddr) 3965114Sgblack@eecs.umich.edu {} 3975124Sgblack@eecs.umich.edu 3985124Sgblack@eecs.umich.edu void invoke(ThreadContext * tc); 3995114Sgblack@eecs.umich.edu }; 4005114Sgblack@eecs.umich.edu 4015114Sgblack@eecs.umich.edu class FakeDTLBFault : public X86Fault 4025114Sgblack@eecs.umich.edu { 4035124Sgblack@eecs.umich.edu protected: 4045124Sgblack@eecs.umich.edu Addr vaddr; 4055124Sgblack@eecs.umich.edu public: 4065124Sgblack@eecs.umich.edu FakeDTLBFault(Addr _vaddr) : 4075124Sgblack@eecs.umich.edu X86Fault("fake data tlb fault", "dtlb"), 4085124Sgblack@eecs.umich.edu vaddr(_vaddr) 4095114Sgblack@eecs.umich.edu {} 4105124Sgblack@eecs.umich.edu 4115124Sgblack@eecs.umich.edu void invoke(ThreadContext * tc); 4125114Sgblack@eecs.umich.edu }; 4134120Sgblack@eecs.umich.edu}; 4144120Sgblack@eecs.umich.edu 4154120Sgblack@eecs.umich.edu#endif // __ARCH_X86_FAULTS_HH__ 416