faults.hh (7625:b1e69203bae9) | faults.hh (7678:f19b6a3a8cec) |
---|---|
1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 72 unchanged lines hidden (view full) --- 81 } 82 83 virtual bool isSoft() 84 { 85 return false; 86 } 87 88#if FULL_SYSTEM | 1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 72 unchanged lines hidden (view full) --- 81 } 82 83 virtual bool isSoft() 84 { 85 return false; 86 } 87 88#if FULL_SYSTEM |
89 void invoke(ThreadContext * tc); | 89 void invoke(ThreadContext * tc, 90 StaticInstPtr inst = StaticInst::nullStaticInstPtr); |
90 91 virtual std::string describe() const; 92#endif 93 }; 94 95 // Base class for x86 faults which behave as if the underlying instruction 96 // didn't happen. 97 class X86Fault : public X86FaultBase --- 11 unchanged lines hidden (view full) --- 109 { 110 protected: 111 X86Trap(const char * name, const char * mnem, 112 const uint8_t vector, uint64_t _errorCode = (uint64_t)-1) 113 : X86FaultBase(name, mnem, vector, _errorCode) 114 {} 115 116#if FULL_SYSTEM | 91 92 virtual std::string describe() const; 93#endif 94 }; 95 96 // Base class for x86 faults which behave as if the underlying instruction 97 // didn't happen. 98 class X86Fault : public X86FaultBase --- 11 unchanged lines hidden (view full) --- 110 { 111 protected: 112 X86Trap(const char * name, const char * mnem, 113 const uint8_t vector, uint64_t _errorCode = (uint64_t)-1) 114 : X86FaultBase(name, mnem, vector, _errorCode) 115 {} 116 117#if FULL_SYSTEM |
117 void invoke(ThreadContext * tc); | 118 void invoke(ThreadContext * tc, 119 StaticInstPtr inst = StaticInst::nullStaticInstPtr); |
118#endif 119 }; 120 121 // Base class for x86 aborts which seem to be catastrophic failures. 122 class X86Abort : public X86FaultBase 123 { 124 protected: 125 X86Abort(const char * name, const char * mnem, 126 const uint8_t vector, uint64_t _errorCode = (uint64_t)-1) 127 : X86FaultBase(name, mnem, vector, _errorCode) 128 {} 129 130#if FULL_SYSTEM | 120#endif 121 }; 122 123 // Base class for x86 aborts which seem to be catastrophic failures. 124 class X86Abort : public X86FaultBase 125 { 126 protected: 127 X86Abort(const char * name, const char * mnem, 128 const uint8_t vector, uint64_t _errorCode = (uint64_t)-1) 129 : X86FaultBase(name, mnem, vector, _errorCode) 130 {} 131 132#if FULL_SYSTEM |
131 void invoke(ThreadContext * tc); | 133 void invoke(ThreadContext * tc, 134 StaticInstPtr inst = StaticInst::nullStaticInstPtr); |
132#endif 133 }; 134 135 // Base class for x86 interrupts. 136 class X86Interrupt : public X86FaultBase 137 { 138 protected: 139 X86Interrupt(const char * name, const char * mnem, --- 5 unchanged lines hidden (view full) --- 145 class UnimpInstFault : public FaultBase 146 { 147 public: 148 const char * name() const 149 { 150 return "unimplemented_micro"; 151 } 152 | 135#endif 136 }; 137 138 // Base class for x86 interrupts. 139 class X86Interrupt : public X86FaultBase 140 { 141 protected: 142 X86Interrupt(const char * name, const char * mnem, --- 5 unchanged lines hidden (view full) --- 148 class UnimpInstFault : public FaultBase 149 { 150 public: 151 const char * name() const 152 { 153 return "unimplemented_micro"; 154 } 155 |
153 void invoke(ThreadContext * tc) | 156 void invoke(ThreadContext * tc, 157 StaticInstPtr inst = StaticInst::nullStaticInstPtr) |
154 { 155 panic("Unimplemented instruction!"); 156 } 157 }; 158 159 static inline Fault genMachineCheckFault() 160 { 161 panic("Machine check fault not implemented in x86!\n"); --- 160 unchanged lines hidden (view full) --- 322 code.present = present; 323 code.write = (mode == BaseTLB::Write); 324 code.user = user; 325 code.reserved = reserved; 326 code.fetch = (mode == BaseTLB::Execute); 327 errorCode = code; 328 } 329 | 158 { 159 panic("Unimplemented instruction!"); 160 } 161 }; 162 163 static inline Fault genMachineCheckFault() 164 { 165 panic("Machine check fault not implemented in x86!\n"); --- 160 unchanged lines hidden (view full) --- 326 code.present = present; 327 code.write = (mode == BaseTLB::Write); 328 code.user = user; 329 code.reserved = reserved; 330 code.fetch = (mode == BaseTLB::Execute); 331 errorCode = code; 332 } 333 |
330 void invoke(ThreadContext * tc); | 334 void invoke(ThreadContext * tc, 335 StaticInstPtr inst = StaticInst::nullStaticInstPtr); |
331 332#if FULL_SYSTEM 333 virtual std::string describe() const; 334#endif 335 }; 336 337 class X87FpExceptionPending : public X86Fault 338 { --- 53 unchanged lines hidden (view full) --- 392 393 class InitInterrupt : public X86Interrupt 394 { 395 public: 396 InitInterrupt(uint8_t _vector) : 397 X86Interrupt("INIT Interrupt", "#INIT", _vector) 398 {} 399 | 336 337#if FULL_SYSTEM 338 virtual std::string describe() const; 339#endif 340 }; 341 342 class X87FpExceptionPending : public X86Fault 343 { --- 53 unchanged lines hidden (view full) --- 397 398 class InitInterrupt : public X86Interrupt 399 { 400 public: 401 InitInterrupt(uint8_t _vector) : 402 X86Interrupt("INIT Interrupt", "#INIT", _vector) 403 {} 404 |
400 void invoke(ThreadContext * tc); | 405 void invoke(ThreadContext * tc, 406 StaticInstPtr inst = StaticInst::nullStaticInstPtr); |
401 }; 402 403 class StartupInterrupt : public X86Interrupt 404 { 405 public: 406 StartupInterrupt(uint8_t _vector) : 407 X86Interrupt("Startup Interrupt", "#SIPI", _vector) 408 {} 409 | 407 }; 408 409 class StartupInterrupt : public X86Interrupt 410 { 411 public: 412 StartupInterrupt(uint8_t _vector) : 413 X86Interrupt("Startup Interrupt", "#SIPI", _vector) 414 {} 415 |
410 void invoke(ThreadContext * tc); | 416 void invoke(ThreadContext * tc, 417 StaticInstPtr inst = StaticInst::nullStaticInstPtr); |
411 }; 412 413 class SoftwareInterrupt : public X86Interrupt 414 { 415 public: 416 SoftwareInterrupt(uint8_t _vector) : 417 X86Interrupt("Software Interrupt", "#INTR", _vector) 418 {} 419 420 bool isSoft() 421 { 422 return true; 423 } 424 }; 425}; 426 427#endif // __ARCH_X86_FAULTS_HH__ | 418 }; 419 420 class SoftwareInterrupt : public X86Interrupt 421 { 422 public: 423 SoftwareInterrupt(uint8_t _vector) : 424 X86Interrupt("Software Interrupt", "#INTR", _vector) 425 {} 426 427 bool isSoft() 428 { 429 return true; 430 } 431 }; 432}; 433 434#endif // __ARCH_X86_FAULTS_HH__ |