faults.hh (5124:3d8c50376609) faults.hh (5139:2422708d4fcb)
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 *

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

64namespace X86ISA
65{
66 // Base class for all x86 "faults" where faults is in the m5 sense
67 class X86FaultBase : public FaultBase
68 {
69 protected:
70 const char * faultName;
71 const char * mnem;
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 *

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

64namespace X86ISA
65{
66 // Base class for all x86 "faults" where faults is in the m5 sense
67 class X86FaultBase : public FaultBase
68 {
69 protected:
70 const char * faultName;
71 const char * mnem;
72 uint64_t errorCode;
72
73
73 X86FaultBase(const char * _faultName, const char * _mnem) :
74 faultName(_faultName), mnem(_mnem)
74 X86FaultBase(const char * _faultName, const char * _mnem,
75 uint64_t _errorCode = 0) :
76 faultName(_faultName), mnem(_mnem), errorCode(_errorCode)
75 {
76 }
77
78 const char * name() const
79 {
80 return faultName;
81 }
82

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

91 }
92 };
93
94 // Base class for x86 faults which behave as if the underlying instruction
95 // didn't happen.
96 class X86Fault : public X86FaultBase
97 {
98 protected:
77 {
78 }
79
80 const char * name() const
81 {
82 return faultName;
83 }
84

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

93 }
94 };
95
96 // Base class for x86 faults which behave as if the underlying instruction
97 // didn't happen.
98 class X86Fault : public X86FaultBase
99 {
100 protected:
99 X86Fault(const char * name, const char * mnem) :
100 X86FaultBase(name, mnem)
101 X86Fault(const char * name, const char * mnem,
102 uint64_t _errorCode = 0) :
103 X86FaultBase(name, mnem, _errorCode)
101 {}
102 };
103
104 // Base class for x86 traps which behave as if the underlying instruction
105 // completed.
106 class X86Trap : public X86FaultBase
107 {
108 protected:
104 {}
105 };
106
107 // Base class for x86 traps which behave as if the underlying instruction
108 // completed.
109 class X86Trap : public X86FaultBase
110 {
111 protected:
109 X86Trap(const char * name, const char * mnem) :
110 X86FaultBase(name, mnem)
112 X86Trap(const char * name, const char * mnem,
113 uint64_t _errorCode = 0) :
114 X86FaultBase(name, mnem, _errorCode)
111 {}
112
113#if FULL_SYSTEM
114 void invoke(ThreadContext * tc);
115#endif
116 };
117
118 // Base class for x86 aborts which seem to be catastrophic failures.
119 class X86Abort : public X86FaultBase
120 {
121 protected:
115 {}
116
117#if FULL_SYSTEM
118 void invoke(ThreadContext * tc);
119#endif
120 };
121
122 // Base class for x86 aborts which seem to be catastrophic failures.
123 class X86Abort : public X86FaultBase
124 {
125 protected:
122 X86Abort(const char * name, const char * mnem) :
123 X86FaultBase(name, mnem)
126 X86Abort(const char * name, const char * mnem,
127 uint64_t _errorCode = 0) :
128 X86FaultBase(name, mnem, _errorCode)
124 {}
125
126#if FULL_SYSTEM
127 void invoke(ThreadContext * tc);
128#endif
129 };
130
131 // Base class for x86 interrupts.
132 class X86Interrupt : public X86FaultBase
133 {
134 protected:
129 {}
130
131#if FULL_SYSTEM
132 void invoke(ThreadContext * tc);
133#endif
134 };
135
136 // Base class for x86 interrupts.
137 class X86Interrupt : public X86FaultBase
138 {
139 protected:
135 X86Interrupt(const char * name, const char * mnem) :
136 X86FaultBase(name, mnem)
140 X86Interrupt(const char * name, const char * mnem,
141 uint64_t _errorCode = 0) :
142 X86FaultBase(name, mnem, _errorCode)
137 {}
138
139#if FULL_SYSTEM
140 void invoke(ThreadContext * tc);
141#endif
142 };
143
144 class UnimpInstFault : public FaultBase

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

285 StackFault() :
286 X86Fault("Stack", "#SS")
287 {}
288 };
289
290 class GeneralProtection : public X86Fault
291 {
292 public:
143 {}
144
145#if FULL_SYSTEM
146 void invoke(ThreadContext * tc);
147#endif
148 };
149
150 class UnimpInstFault : public FaultBase

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

291 StackFault() :
292 X86Fault("Stack", "#SS")
293 {}
294 };
295
296 class GeneralProtection : public X86Fault
297 {
298 public:
293 GeneralProtection() :
294 X86Fault("General-Protection", "#GP")
299 GeneralProtection(uint64_t _errorCode) :
300 X86Fault("General-Protection", "#GP", _errorCode)
295 {}
296 };
297
298 class PageFault : public X86Fault
299 {
300 public:
301 PageFault() :
302 X86Fault("Page-Fault", "#PF")

--- 105 unchanged lines hidden ---
301 {}
302 };
303
304 class PageFault : public X86Fault
305 {
306 public:
307 PageFault() :
308 X86Fault("Page-Fault", "#PF")

--- 105 unchanged lines hidden ---