2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #ifndef __ALPHA_FAULTS_HH__
30 #define __ALPHA_FAULTS_HH__
32 #include "sim/faults.hh"
34 // The design of the "name" and "vect" functions is in sim/faults.hh
39 typedef const Addr FaultVect;
41 class AlphaFault : public virtual FaultBase
44 virtual bool skipFaultingInstruction() {return false;}
45 virtual bool setRestartAddress() {return true;}
48 void invoke(ExecContext * xc);
50 virtual FaultVect vect() = 0;
53 class AlphaMachineCheckFault :
54 public MachineCheckFault,
58 static FaultVect _vect;
59 static FaultStat _stat;
61 FaultVect vect() {return _vect;}
62 FaultStat & stat() {return _stat;}
65 class AlphaAlignmentFault :
66 public AlignmentFault,
70 static FaultVect _vect;
71 static FaultStat _stat;
73 FaultVect vect() {return _vect;}
74 FaultStat & stat() {return _stat;}
77 static inline Fault genMachineCheckFault()
79 return new AlphaMachineCheckFault;
82 static inline Fault genAlignmentFault()
84 return new AlphaAlignmentFault;
87 class ResetFault : public AlphaFault
90 static FaultName _name;
91 static FaultVect _vect;
92 static FaultStat _stat;
94 FaultName name() {return _name;}
95 FaultVect vect() {return _vect;}
96 FaultStat & stat() {return _stat;}
99 class ArithmeticFault : public AlphaFault
102 bool skipFaultingInstruction() {return true;}
104 static FaultName _name;
105 static FaultVect _vect;
106 static FaultStat _stat;
108 FaultName name() {return _name;}
109 FaultVect vect() {return _vect;}
110 FaultStat & stat() {return _stat;}
111 void invoke(ExecContext * xc);
114 class InterruptFault : public AlphaFault
117 bool setRestartAddress() {return false;}
119 static FaultName _name;
120 static FaultVect _vect;
121 static FaultStat _stat;
123 FaultName name() {return _name;}
124 FaultVect vect() {return _vect;}
125 FaultStat & stat() {return _stat;}
128 class NDtbMissFault : public AlphaFault
131 static FaultName _name;
132 static FaultVect _vect;
133 static FaultStat _stat;
135 FaultName name() {return _name;}
136 FaultVect vect() {return _vect;}
137 FaultStat & stat() {return _stat;}
140 class PDtbMissFault : public AlphaFault
143 static FaultName _name;
144 static FaultVect _vect;
145 static FaultStat _stat;
147 FaultName name() {return _name;}
148 FaultVect vect() {return _vect;}
149 FaultStat & stat() {return _stat;}
152 class DtbPageFault : public AlphaFault
155 static FaultName _name;
156 static FaultVect _vect;
157 static FaultStat _stat;
159 FaultName name() {return _name;}
160 FaultVect vect() {return _vect;}
161 FaultStat & stat() {return _stat;}
164 class DtbAcvFault : public AlphaFault
167 static FaultName _name;
168 static FaultVect _vect;
169 static FaultStat _stat;
171 FaultName name() {return _name;}
172 FaultVect vect() {return _vect;}
173 FaultStat & stat() {return _stat;}
176 class ItbMissFault : public AlphaFault
179 static FaultName _name;
180 static FaultVect _vect;
181 static FaultStat _stat;
183 FaultName name() {return _name;}
184 FaultVect vect() {return _vect;}
185 FaultStat & stat() {return _stat;}
188 class ItbPageFault : public AlphaFault
191 static FaultName _name;
192 static FaultVect _vect;
193 static FaultStat _stat;
195 FaultName name() {return _name;}
196 FaultVect vect() {return _vect;}
197 FaultStat & stat() {return _stat;}
200 class ItbAcvFault : public AlphaFault
203 static FaultName _name;
204 static FaultVect _vect;
205 static FaultStat _stat;
207 FaultName name() {return _name;}
208 FaultVect vect() {return _vect;}
209 FaultStat & stat() {return _stat;}
212 class UnimplementedOpcodeFault : public AlphaFault
215 static FaultName _name;
216 static FaultVect _vect;
217 static FaultStat _stat;
219 FaultName name() {return _name;}
220 FaultVect vect() {return _vect;}
221 FaultStat & stat() {return _stat;}
224 class FloatEnableFault : public AlphaFault
227 static FaultName _name;
228 static FaultVect _vect;
229 static FaultStat _stat;
231 FaultName name() {return _name;}
232 FaultVect vect() {return _vect;}
233 FaultStat & stat() {return _stat;}
236 class PalFault : public AlphaFault
239 bool skipFaultingInstruction() {return true;}
241 static FaultName _name;
242 static FaultVect _vect;
243 static FaultStat _stat;
245 FaultName name() {return _name;}
246 FaultVect vect() {return _vect;}
247 FaultStat & stat() {return _stat;}
250 class IntegerOverflowFault : public AlphaFault
253 static FaultName _name;
254 static FaultVect _vect;
255 static FaultStat _stat;
257 FaultName name() {return _name;}
258 FaultVect vect() {return _vect;}
259 FaultStat & stat() {return _stat;}
262 } // AlphaISA namespace
264 #endif // __FAULTS_HH__