faults.hh (9873:530a50b10ebe) faults.hh (10417:710ee116eb68)
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

--- 71 unchanged lines hidden (view full) ---

80 return mnem;
81 }
82
83 virtual bool isSoft()
84 {
85 return false;
86 }
87
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

--- 71 unchanged lines hidden (view full) ---

80 return mnem;
81 }
82
83 virtual bool isSoft()
84 {
85 return false;
86 }
87
88 void invoke(ThreadContext * tc,
89 StaticInstPtr inst = StaticInst::nullStaticInstPtr);
88 void invoke(ThreadContext * tc, const StaticInstPtr &inst =
89 StaticInst::nullStaticInstPtr);
90
91 virtual std::string describe() const;
92
93 public:
94 /**
95 * Get the vector of an interrupt.
96 *
97 * @return interrupt vector number.

--- 17 unchanged lines hidden (view full) ---

115 class X86Trap : public X86FaultBase
116 {
117 protected:
118 X86Trap(const char * name, const char * mnem,
119 const uint8_t vector, uint64_t _errorCode = (uint64_t)-1)
120 : X86FaultBase(name, mnem, vector, _errorCode)
121 {}
122
90
91 virtual std::string describe() const;
92
93 public:
94 /**
95 * Get the vector of an interrupt.
96 *
97 * @return interrupt vector number.

--- 17 unchanged lines hidden (view full) ---

115 class X86Trap : public X86FaultBase
116 {
117 protected:
118 X86Trap(const char * name, const char * mnem,
119 const uint8_t vector, uint64_t _errorCode = (uint64_t)-1)
120 : X86FaultBase(name, mnem, vector, _errorCode)
121 {}
122
123 void invoke(ThreadContext * tc,
124 StaticInstPtr inst = StaticInst::nullStaticInstPtr);
123 void invoke(ThreadContext * tc, const StaticInstPtr &inst =
124 StaticInst::nullStaticInstPtr);
125 };
126
127 // Base class for x86 aborts which seem to be catastrophic failures.
128 class X86Abort : public X86FaultBase
129 {
130 protected:
131 X86Abort(const char * name, const char * mnem,
132 const uint8_t vector, uint64_t _errorCode = (uint64_t)-1)
133 : X86FaultBase(name, mnem, vector, _errorCode)
134 {}
135
125 };
126
127 // Base class for x86 aborts which seem to be catastrophic failures.
128 class X86Abort : public X86FaultBase
129 {
130 protected:
131 X86Abort(const char * name, const char * mnem,
132 const uint8_t vector, uint64_t _errorCode = (uint64_t)-1)
133 : X86FaultBase(name, mnem, vector, _errorCode)
134 {}
135
136 void invoke(ThreadContext * tc,
137 StaticInstPtr inst = StaticInst::nullStaticInstPtr);
136 void invoke(ThreadContext * tc, const StaticInstPtr &inst =
137 StaticInst::nullStaticInstPtr);
138 };
139
140 // Base class for x86 interrupts.
141 class X86Interrupt : public X86FaultBase
142 {
143 protected:
144 X86Interrupt(const char * name, const char * mnem,
145 const uint8_t _vector, uint64_t _errorCode = (uint64_t)-1)

--- 4 unchanged lines hidden (view full) ---

150 class UnimpInstFault : public FaultBase
151 {
152 public:
153 const char * name() const
154 {
155 return "unimplemented_micro";
156 }
157
138 };
139
140 // Base class for x86 interrupts.
141 class X86Interrupt : public X86FaultBase
142 {
143 protected:
144 X86Interrupt(const char * name, const char * mnem,
145 const uint8_t _vector, uint64_t _errorCode = (uint64_t)-1)

--- 4 unchanged lines hidden (view full) ---

150 class UnimpInstFault : public FaultBase
151 {
152 public:
153 const char * name() const
154 {
155 return "unimplemented_micro";
156 }
157
158 void invoke(ThreadContext * tc,
159 StaticInstPtr inst = StaticInst::nullStaticInstPtr)
158 void invoke(ThreadContext * tc, const StaticInstPtr &inst =
159 StaticInst::nullStaticInstPtr)
160 {
161 panic("Unimplemented instruction!");
162 }
163 };
164
165 // Below is a summary of the interrupt/exception information in the
166 // architecture manuals.
167

--- 75 unchanged lines hidden (view full) ---

243
244 class InvalidOpcode : public X86Fault
245 {
246 public:
247 InvalidOpcode() :
248 X86Fault("Invalid-Opcode", "#UD", 6)
249 {}
250
160 {
161 panic("Unimplemented instruction!");
162 }
163 };
164
165 // Below is a summary of the interrupt/exception information in the
166 // architecture manuals.
167

--- 75 unchanged lines hidden (view full) ---

243
244 class InvalidOpcode : public X86Fault
245 {
246 public:
247 InvalidOpcode() :
248 X86Fault("Invalid-Opcode", "#UD", 6)
249 {}
250
251 void invoke(ThreadContext * tc,
252 StaticInstPtr inst = StaticInst::nullStaticInstPtr);
251 void invoke(ThreadContext * tc, const StaticInstPtr &inst =
252 StaticInst::nullStaticInstPtr);
253 };
254
255 class DeviceNotAvailable : public X86Fault
256 {
257 public:
258 DeviceNotAvailable() :
259 X86Fault("Device-Not-Available", "#NM", 7)
260 {}

--- 65 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
253 };
254
255 class DeviceNotAvailable : public X86Fault
256 {
257 public:
258 DeviceNotAvailable() :
259 X86Fault("Device-Not-Available", "#NM", 7)
260 {}

--- 65 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
334 void invoke(ThreadContext * tc,
335 StaticInstPtr inst = StaticInst::nullStaticInstPtr);
334 void invoke(ThreadContext * tc, const StaticInstPtr &inst =
335 StaticInst::nullStaticInstPtr);
336
337 virtual std::string describe() const;
338 };
339
340 class X87FpExceptionPending : public X86Fault
341 {
342 public:
343 X87FpExceptionPending() :

--- 51 unchanged lines hidden (view full) ---

395
396 class InitInterrupt : public X86Interrupt
397 {
398 public:
399 InitInterrupt(uint8_t _vector) :
400 X86Interrupt("INIT Interrupt", "#INIT", _vector)
401 {}
402
336
337 virtual std::string describe() const;
338 };
339
340 class X87FpExceptionPending : public X86Fault
341 {
342 public:
343 X87FpExceptionPending() :

--- 51 unchanged lines hidden (view full) ---

395
396 class InitInterrupt : public X86Interrupt
397 {
398 public:
399 InitInterrupt(uint8_t _vector) :
400 X86Interrupt("INIT Interrupt", "#INIT", _vector)
401 {}
402
403 void invoke(ThreadContext * tc,
404 StaticInstPtr inst = StaticInst::nullStaticInstPtr);
403 void invoke(ThreadContext * tc, const StaticInstPtr &inst =
404 StaticInst::nullStaticInstPtr);
405 };
406
407 class StartupInterrupt : public X86Interrupt
408 {
409 public:
410 StartupInterrupt(uint8_t _vector) :
411 X86Interrupt("Startup Interrupt", "#SIPI", _vector)
412 {}
413
405 };
406
407 class StartupInterrupt : public X86Interrupt
408 {
409 public:
410 StartupInterrupt(uint8_t _vector) :
411 X86Interrupt("Startup Interrupt", "#SIPI", _vector)
412 {}
413
414 void invoke(ThreadContext * tc,
415 StaticInstPtr inst = StaticInst::nullStaticInstPtr);
414 void invoke(ThreadContext * tc, const StaticInstPtr &inst =
415 StaticInst::nullStaticInstPtr);
416 };
417
418 class SoftwareInterrupt : public X86Interrupt
419 {
420 public:
421 SoftwareInterrupt(uint8_t _vector) :
422 X86Interrupt("Software Interrupt", "#INTR", _vector)
423 {}
424
425 bool isSoft()
426 {
427 return true;
428 }
429 };
430}
431
432#endif // __ARCH_X86_FAULTS_HH__
416 };
417
418 class SoftwareInterrupt : public X86Interrupt
419 {
420 public:
421 SoftwareInterrupt(uint8_t _vector) :
422 X86Interrupt("Software Interrupt", "#INTR", _vector)
423 {}
424
425 bool isSoft()
426 {
427 return true;
428 }
429 };
430}
431
432#endif // __ARCH_X86_FAULTS_HH__