faults.hh (5857:8cd8e1393990) | faults.hh (5858:54f64fb1bd62) |
---|---|
1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * Redistribution and use of this software in source and binary forms, 6 * with or without modification, are permitted provided that the 7 * following conditions are met: 8 * --- 81 unchanged lines hidden (view full) --- 90 return true; 91 } 92 93 virtual const char * mnemonic() const 94 { 95 return mnem; 96 } 97 | 1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * Redistribution and use of this software in source and binary forms, 6 * with or without modification, are permitted provided that the 7 * following conditions are met: 8 * --- 81 unchanged lines hidden (view full) --- 90 return true; 91 } 92 93 virtual const char * mnemonic() const 94 { 95 return mnem; 96 } 97 |
98 void 99 invoke(ThreadContext * tc) | 98 virtual bool isSoft() |
100 { | 99 { |
101 panic("Unimplemented fault %s.\n", name()); | 100 return false; |
102 } | 101 } |
102 103#if FULL_SYSTEM 104 void invoke(ThreadContext * tc); 105#endif |
|
103 }; 104 105 // Base class for x86 faults which behave as if the underlying instruction 106 // didn't happen. 107 class X86Fault : public X86FaultBase 108 { 109 protected: 110 X86Fault(const char * name, const char * mnem, --- 34 unchanged lines hidden (view full) --- 145 // Base class for x86 interrupts. 146 class X86Interrupt : public X86FaultBase 147 { 148 protected: 149 X86Interrupt(const char * name, const char * mnem, 150 const uint8_t _vector, uint64_t _errorCode = -1) : 151 X86FaultBase(name, mnem, _vector, _errorCode) 152 {} | 106 }; 107 108 // Base class for x86 faults which behave as if the underlying instruction 109 // didn't happen. 110 class X86Fault : public X86FaultBase 111 { 112 protected: 113 X86Fault(const char * name, const char * mnem, --- 34 unchanged lines hidden (view full) --- 148 // Base class for x86 interrupts. 149 class X86Interrupt : public X86FaultBase 150 { 151 protected: 152 X86Interrupt(const char * name, const char * mnem, 153 const uint8_t _vector, uint64_t _errorCode = -1) : 154 X86FaultBase(name, mnem, _vector, _errorCode) 155 {} |
153 154#if FULL_SYSTEM 155 void invoke(ThreadContext * tc); 156#endif | |
157 }; 158 159 class UnimpInstFault : public FaultBase 160 { 161 public: 162 const char * name() const 163 { 164 return "unimplemented_micro"; --- 151 unchanged lines hidden (view full) --- 316 BitUnion32(PageFaultErrorCode) 317 Bitfield<0> present; 318 Bitfield<1> write; 319 Bitfield<2> user; 320 Bitfield<3> reserved; 321 Bitfield<4> fetch; 322 EndBitUnion(PageFaultErrorCode) 323 | 156 }; 157 158 class UnimpInstFault : public FaultBase 159 { 160 public: 161 const char * name() const 162 { 163 return "unimplemented_micro"; --- 151 unchanged lines hidden (view full) --- 315 BitUnion32(PageFaultErrorCode) 316 Bitfield<0> present; 317 Bitfield<1> write; 318 Bitfield<2> user; 319 Bitfield<3> reserved; 320 Bitfield<4> fetch; 321 EndBitUnion(PageFaultErrorCode) 322 |
323 Addr addr; 324 |
|
324 public: | 325 public: |
325 PageFault(uint32_t _errorCode) : 326 X86Fault("Page-Fault", "#PF", 14, _errorCode) | 326 PageFault(Addr _addr, uint32_t _errorCode) : 327 X86Fault("Page-Fault", "#PF", 14, _errorCode), addr(_addr) |
327 {} | 328 {} |
328 PageFault(bool present, bool write, bool user, 329 bool reserved, bool fetch) : 330 X86Fault("Page-Fault", "#PF", 14, 0) | 329 330 PageFault(Addr _addr, bool present, bool write, 331 bool user, bool reserved, bool fetch) : 332 X86Fault("Page-Fault", "#PF", 14, 0), addr(_addr) |
331 { 332 PageFaultErrorCode code = 0; 333 code.present = present; 334 code.write = write; 335 code.user = user; 336 code.reserved = reserved; 337 code.fetch = fetch; 338 errorCode = code; 339 } | 333 { 334 PageFaultErrorCode code = 0; 335 code.present = present; 336 code.write = write; 337 code.user = user; 338 code.reserved = reserved; 339 code.fetch = fetch; 340 errorCode = code; 341 } |
342 343#if FULL_SYSTEM 344 void invoke(ThreadContext * tc); 345#endif |
|
340 }; 341 342 class X87FpExceptionPending : public X86Fault 343 { 344 public: 345 X87FpExceptionPending() : 346 X86Fault("x87 Floating-Point Exception Pending", "#MF", 16) 347 {} --- 57 unchanged lines hidden (view full) --- 405 }; 406 407 class SoftwareInterrupt : public X86Interrupt 408 { 409 public: 410 SoftwareInterrupt(uint8_t _vector) : 411 X86Interrupt("Software Interrupt", "INTn", _vector) 412 {} | 346 }; 347 348 class X87FpExceptionPending : public X86Fault 349 { 350 public: 351 X87FpExceptionPending() : 352 X86Fault("x87 Floating-Point Exception Pending", "#MF", 16) 353 {} --- 57 unchanged lines hidden (view full) --- 411 }; 412 413 class SoftwareInterrupt : public X86Interrupt 414 { 415 public: 416 SoftwareInterrupt(uint8_t _vector) : 417 X86Interrupt("Software Interrupt", "INTn", _vector) 418 {} |
419 420 bool isSoft() 421 { 422 return true; 423 } |
|
413 }; 414 415 // These faults aren't part of the ISA definition. They trigger filling 416 // the tlb on a miss and are to take the place of a hardware table walker. 417 class FakeITLBFault : public X86Fault 418 { 419 protected: 420 Addr vaddr; --- 24 unchanged lines hidden --- | 424 }; 425 426 // These faults aren't part of the ISA definition. They trigger filling 427 // the tlb on a miss and are to take the place of a hardware table walker. 428 class FakeITLBFault : public X86Fault 429 { 430 protected: 431 Addr vaddr; --- 24 unchanged lines hidden --- |