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
45 void invoke(ExecContext * xc);
47 virtual FaultVect vect() = 0;
50 class AlphaMachineCheckFault :
51 public MachineCheckFault,
55 static FaultVect _vect;
56 static FaultStat _stat;
58 FaultVect vect() {return _vect;}
59 FaultStat & stat() {return _stat;}
62 class AlphaAlignmentFault :
63 public AlignmentFault,
67 static FaultVect _vect;
68 static FaultStat _stat;
70 FaultVect vect() {return _vect;}
71 FaultStat & stat() {return _stat;}
74 static inline Fault genMachineCheckFault()
76 return new AlphaMachineCheckFault;
79 static inline Fault genAlignmentFault()
81 return new AlphaAlignmentFault;
84 class ResetFault : public AlphaFault
87 static FaultName _name;
88 static FaultVect _vect;
89 static FaultStat _stat;
91 FaultName name() {return _name;}
92 FaultVect vect() {return _vect;}
93 FaultStat & stat() {return _stat;}
96 class ArithmeticFault : public AlphaFault
99 static FaultName _name;
100 static FaultVect _vect;
101 static FaultStat _stat;
103 FaultName name() {return _name;}
104 FaultVect vect() {return _vect;}
105 FaultStat & stat() {return _stat;}
108 class InterruptFault : public AlphaFault
111 static FaultName _name;
112 static FaultVect _vect;
113 static FaultStat _stat;
115 FaultName name() {return _name;}
116 FaultVect vect() {return _vect;}
117 FaultStat & stat() {return _stat;}
120 class NDtbMissFault : public AlphaFault
123 static FaultName _name;
124 static FaultVect _vect;
125 static FaultStat _stat;
127 FaultName name() {return _name;}
128 FaultVect vect() {return _vect;}
129 FaultStat & stat() {return _stat;}
132 class PDtbMissFault : public AlphaFault
135 static FaultName _name;
136 static FaultVect _vect;
137 static FaultStat _stat;
139 FaultName name() {return _name;}
140 FaultVect vect() {return _vect;}
141 FaultStat & stat() {return _stat;}
144 class DtbPageFault : public AlphaFault
147 static FaultName _name;
148 static FaultVect _vect;
149 static FaultStat _stat;
151 FaultName name() {return _name;}
152 FaultVect vect() {return _vect;}
153 FaultStat & stat() {return _stat;}
156 class DtbAcvFault : public AlphaFault
159 static FaultName _name;
160 static FaultVect _vect;
161 static FaultStat _stat;
163 FaultName name() {return _name;}
164 FaultVect vect() {return _vect;}
165 FaultStat & stat() {return _stat;}
168 class ItbMissFault : public AlphaFault
171 static FaultName _name;
172 static FaultVect _vect;
173 static FaultStat _stat;
175 FaultName name() {return _name;}
176 FaultVect vect() {return _vect;}
177 FaultStat & stat() {return _stat;}
180 class ItbPageFault : public AlphaFault
183 static FaultName _name;
184 static FaultVect _vect;
185 static FaultStat _stat;
187 FaultName name() {return _name;}
188 FaultVect vect() {return _vect;}
189 FaultStat & stat() {return _stat;}
192 class ItbAcvFault : public AlphaFault
195 static FaultName _name;
196 static FaultVect _vect;
197 static FaultStat _stat;
199 FaultName name() {return _name;}
200 FaultVect vect() {return _vect;}
201 FaultStat & stat() {return _stat;}
204 class UnimplementedOpcodeFault : public AlphaFault
207 static FaultName _name;
208 static FaultVect _vect;
209 static FaultStat _stat;
211 FaultName name() {return _name;}
212 FaultVect vect() {return _vect;}
213 FaultStat & stat() {return _stat;}
216 class FloatEnableFault : public AlphaFault
219 static FaultName _name;
220 static FaultVect _vect;
221 static FaultStat _stat;
223 FaultName name() {return _name;}
224 FaultVect vect() {return _vect;}
225 FaultStat & stat() {return _stat;}
228 class PalFault : public AlphaFault
231 static FaultName _name;
232 static FaultVect _vect;
233 static FaultStat _stat;
235 FaultName name() {return _name;}
236 FaultVect vect() {return _vect;}
237 FaultStat & stat() {return _stat;}
240 class IntegerOverflowFault : public AlphaFault
243 static FaultName _name;
244 static FaultVect _vect;
245 static FaultStat _stat;
247 FaultName name() {return _name;}
248 FaultVect vect() {return _vect;}
249 FaultStat & stat() {return _stat;}
252 } // AlphaISA namespace
254 #endif // __FAULTS_HH__