Moved the _stat for MachineCheckFault and AlignmentFault into the isa specific classe...
[gem5.git] / arch / alpha / faults.hh
1 /*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
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.
15 *
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.
27 */
28
29 #ifndef __ALPHA_FAULTS_HH__
30 #define __ALPHA_FAULTS_HH__
31
32 #include "sim/faults.hh"
33
34 // The design of the "name" and "vect" functions is in sim/faults.hh
35
36 namespace AlphaISA
37 {
38
39 typedef const Addr FaultVect;
40
41 class AlphaFault : public FaultBase
42 {
43 private:
44 static FaultName _name;
45 static FaultVect _vect;
46 static FaultStat _stat;
47 public:
48 FaultName name() {return _name;}
49 virtual FaultVect vect() {return _vect;}
50 virtual FaultStat & stat() {return _stat;}
51 };
52
53 class AlphaMachineCheckFault : public MachineCheckFault
54 {
55 private:
56 static FaultVect _vect;
57 static FaultStat _stat;
58 public:
59 FaultVect vect() {return _vect;}
60 FaultStat & stat() {return _stat;}
61 };
62
63 class AlphaAlignmentFault : public AlignmentFault
64 {
65 private:
66 static FaultVect _vect;
67 static FaultStat _stat;
68 public:
69 FaultVect vect() {return _vect;}
70 FaultStat & stat() {return _stat;}
71 };
72
73 static inline Fault genMachineCheckFault()
74 {
75 return new AlphaMachineCheckFault;
76 }
77
78 static inline Fault genAlignmentFault()
79 {
80 return new AlphaAlignmentFault;
81 }
82
83 class ResetFault : public AlphaFault
84 {
85 private:
86 static FaultName _name;
87 static FaultVect _vect;
88 static FaultStat _stat;
89 public:
90 FaultName name() {return _name;}
91 FaultVect vect() {return _vect;}
92 FaultStat & stat() {return _stat;}
93 };
94
95 class ArithmeticFault : public AlphaFault
96 {
97 private:
98 static FaultName _name;
99 static FaultVect _vect;
100 static FaultStat _stat;
101 public:
102 FaultName name() {return _name;}
103 FaultVect vect() {return _vect;}
104 FaultStat & stat() {return _stat;}
105 };
106
107 class InterruptFault : public AlphaFault
108 {
109 private:
110 static FaultName _name;
111 static FaultVect _vect;
112 static FaultStat _stat;
113 public:
114 FaultName name() {return _name;}
115 FaultVect vect() {return _vect;}
116 FaultStat & stat() {return _stat;}
117 };
118
119 class NDtbMissFault : public AlphaFault
120 {
121 private:
122 static FaultName _name;
123 static FaultVect _vect;
124 static FaultStat _stat;
125 public:
126 FaultName name() {return _name;}
127 FaultVect vect() {return _vect;}
128 FaultStat & stat() {return _stat;}
129 };
130
131 class PDtbMissFault : public AlphaFault
132 {
133 private:
134 static FaultName _name;
135 static FaultVect _vect;
136 static FaultStat _stat;
137 public:
138 FaultName name() {return _name;}
139 FaultVect vect() {return _vect;}
140 FaultStat & stat() {return _stat;}
141 };
142
143 class DtbPageFault : public AlphaFault
144 {
145 private:
146 static FaultName _name;
147 static FaultVect _vect;
148 static FaultStat _stat;
149 public:
150 FaultName name() {return _name;}
151 FaultVect vect() {return _vect;}
152 FaultStat & stat() {return _stat;}
153 };
154
155 class DtbAcvFault : public AlphaFault
156 {
157 private:
158 static FaultName _name;
159 static FaultVect _vect;
160 static FaultStat _stat;
161 public:
162 FaultName name() {return _name;}
163 FaultVect vect() {return _vect;}
164 FaultStat & stat() {return _stat;}
165 };
166
167 class ItbMissFault : public AlphaFault
168 {
169 private:
170 static FaultName _name;
171 static FaultVect _vect;
172 static FaultStat _stat;
173 public:
174 FaultName name() {return _name;}
175 FaultVect vect() {return _vect;}
176 FaultStat & stat() {return _stat;}
177 };
178
179 class ItbPageFault : public AlphaFault
180 {
181 private:
182 static FaultName _name;
183 static FaultVect _vect;
184 static FaultStat _stat;
185 public:
186 FaultName name() {return _name;}
187 FaultVect vect() {return _vect;}
188 FaultStat & stat() {return _stat;}
189 };
190
191 class ItbAcvFault : public AlphaFault
192 {
193 private:
194 static FaultName _name;
195 static FaultVect _vect;
196 static FaultStat _stat;
197 public:
198 FaultName name() {return _name;}
199 FaultVect vect() {return _vect;}
200 FaultStat & stat() {return _stat;}
201 };
202
203 class UnimplementedOpcodeFault : public AlphaFault
204 {
205 private:
206 static FaultName _name;
207 static FaultVect _vect;
208 static FaultStat _stat;
209 public:
210 FaultName name() {return _name;}
211 FaultVect vect() {return _vect;}
212 FaultStat & stat() {return _stat;}
213 };
214
215 class FloatEnableFault : public AlphaFault
216 {
217 private:
218 static FaultName _name;
219 static FaultVect _vect;
220 static FaultStat _stat;
221 public:
222 FaultName name() {return _name;}
223 FaultVect vect() {return _vect;}
224 FaultStat & stat() {return _stat;}
225 };
226
227 class PalFault : public AlphaFault
228 {
229 private:
230 static FaultName _name;
231 static FaultVect _vect;
232 static FaultStat _stat;
233 public:
234 FaultName name() {return _name;}
235 FaultVect vect() {return _vect;}
236 FaultStat & stat() {return _stat;}
237 };
238
239 class IntegerOverflowFault : public AlphaFault
240 {
241 private:
242 static FaultName _name;
243 static FaultVect _vect;
244 static FaultStat _stat;
245 public:
246 FaultName name() {return _name;}
247 FaultVect vect() {return _vect;}
248 FaultStat & stat() {return _stat;}
249 };
250
251 } // AlphaISA namespace
252
253 #endif // __FAULTS_HH__