faults.hh (3415:72c48f292f6a) faults.hh (3524:e2c8710ca78b)
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 * Authors: Gabe Black
29 * Kevin Lim
30 */
31
32#ifndef __ALPHA_FAULTS_HH__
33#define __ALPHA_FAULTS_HH__
34
35#include "sim/faults.hh"
36
37// The design of the "name" and "vect" functions is in sim/faults.hh
38
39namespace SparcISA
40{
41
42typedef uint32_t TrapType;
43typedef uint32_t FaultPriority;
44
45class SparcFault : public FaultBase
46{
47 public:
48#if FULL_SYSTEM
49 void invoke(ThreadContext * tc);
50#endif
51 virtual TrapType trapType() = 0;
52 virtual FaultPriority priority() = 0;
53 virtual FaultStat & countStat() = 0;
54};
55
56class InternalProcessorError : public SparcFault
57{
58 private:
59 static FaultName _name;
60 static TrapType _trapType;
61 static FaultPriority _priority;
62 static FaultStat _count;
63 public:
64 FaultName name() {return _name;}
65 TrapType trapType() {return _trapType;}
66 FaultPriority priority() {return _priority;}
67 FaultStat & countStat() {return _count;}
68 bool isMachineCheckFault() {return true;}
69};
70
71class MemAddressNotAligned : public SparcFault
72{
73 private:
74 static FaultName _name;
75 static TrapType _trapType;
76 static FaultPriority _priority;
77 static FaultStat _count;
78 public:
79 FaultName name() {return _name;}
80 TrapType trapType() {return _trapType;}
81 FaultPriority priority() {return _priority;}
82 FaultStat & countStat() {return _count;}
83 bool isAlignmentFault() {return true;}
84};
85
86#if !FULL_SYSTEM
87class PageTableFault : public SparcFault
88{
89 private:
90 Addr vaddr;
91 static FaultName _name;
92 static TrapType _trapType;
93 static FaultPriority _priority;
94 static FaultStat _count;
95 public:
96 PageTableFault(Addr va)
97 : vaddr(va) {}
98 FaultName name() {return _name;}
99 TrapType trapType() {return _trapType;}
100 FaultPriority priority() {return _priority;}
101 FaultStat & countStat() {return _count;}
102 void invoke(ThreadContext * tc);
103};
104
105static inline Fault genPageTableFault(Addr va)
106{
107 return new PageTableFault(va);
108}
109#endif
110
111static inline Fault genMachineCheckFault()
112{
113 return new InternalProcessorError;
114}
115
116static inline Fault genAlignmentFault()
117{
118 return new MemAddressNotAligned;
119}
120
121class PowerOnReset : public SparcFault
122{
123 private:
124 static FaultName _name;
125 static TrapType _trapType;
126 static FaultPriority _priority;
127 static FaultStat _count;
128 public:
129 FaultName name() {return _name;}
130 TrapType trapType() {return _trapType;}
131 FaultPriority priority() {return _priority;}
132 FaultStat & countStat() {return _count;}
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 * Authors: Gabe Black
29 * Kevin Lim
30 */
31
32#ifndef __ALPHA_FAULTS_HH__
33#define __ALPHA_FAULTS_HH__
34
35#include "sim/faults.hh"
36
37// The design of the "name" and "vect" functions is in sim/faults.hh
38
39namespace SparcISA
40{
41
42typedef uint32_t TrapType;
43typedef uint32_t FaultPriority;
44
45class SparcFault : public FaultBase
46{
47 public:
48#if FULL_SYSTEM
49 void invoke(ThreadContext * tc);
50#endif
51 virtual TrapType trapType() = 0;
52 virtual FaultPriority priority() = 0;
53 virtual FaultStat & countStat() = 0;
54};
55
56class InternalProcessorError : public SparcFault
57{
58 private:
59 static FaultName _name;
60 static TrapType _trapType;
61 static FaultPriority _priority;
62 static FaultStat _count;
63 public:
64 FaultName name() {return _name;}
65 TrapType trapType() {return _trapType;}
66 FaultPriority priority() {return _priority;}
67 FaultStat & countStat() {return _count;}
68 bool isMachineCheckFault() {return true;}
69};
70
71class MemAddressNotAligned : public SparcFault
72{
73 private:
74 static FaultName _name;
75 static TrapType _trapType;
76 static FaultPriority _priority;
77 static FaultStat _count;
78 public:
79 FaultName name() {return _name;}
80 TrapType trapType() {return _trapType;}
81 FaultPriority priority() {return _priority;}
82 FaultStat & countStat() {return _count;}
83 bool isAlignmentFault() {return true;}
84};
85
86#if !FULL_SYSTEM
87class PageTableFault : public SparcFault
88{
89 private:
90 Addr vaddr;
91 static FaultName _name;
92 static TrapType _trapType;
93 static FaultPriority _priority;
94 static FaultStat _count;
95 public:
96 PageTableFault(Addr va)
97 : vaddr(va) {}
98 FaultName name() {return _name;}
99 TrapType trapType() {return _trapType;}
100 FaultPriority priority() {return _priority;}
101 FaultStat & countStat() {return _count;}
102 void invoke(ThreadContext * tc);
103};
104
105static inline Fault genPageTableFault(Addr va)
106{
107 return new PageTableFault(va);
108}
109#endif
110
111static inline Fault genMachineCheckFault()
112{
113 return new InternalProcessorError;
114}
115
116static inline Fault genAlignmentFault()
117{
118 return new MemAddressNotAligned;
119}
120
121class PowerOnReset : public SparcFault
122{
123 private:
124 static FaultName _name;
125 static TrapType _trapType;
126 static FaultPriority _priority;
127 static FaultStat _count;
128 public:
129 FaultName name() {return _name;}
130 TrapType trapType() {return _trapType;}
131 FaultPriority priority() {return _priority;}
132 FaultStat & countStat() {return _count;}
133 void invoke(ThreadContext * tc);
133};
134
135class WatchDogReset : public SparcFault
136{
137 private:
138 static FaultName _name;
139 static TrapType _trapType;
140 static FaultPriority _priority;
141 static FaultStat _count;
142 public:
143 FaultName name() {return _name;}
144 TrapType trapType() {return _trapType;}
145 FaultPriority priority() {return _priority;}
146 FaultStat & countStat() {return _count;}
147};
148
149class ExternallyInitiatedReset : public SparcFault
150{
151 private:
152 static FaultName _name;
153 static TrapType _trapType;
154 static FaultPriority _priority;
155 static FaultStat _count;
156 public:
157 FaultName name() {return _name;}
158 TrapType trapType() {return _trapType;}
159 FaultPriority priority() {return _priority;}
160 FaultStat & countStat() {return _count;}
161};
162
163class SoftwareInitiatedReset : public SparcFault
164{
165 private:
166 static FaultName _name;
167 static TrapType _trapType;
168 static FaultPriority _priority;
169 static FaultStat _count;
170 public:
171 FaultName name() {return _name;}
172 TrapType trapType() {return _trapType;}
173 FaultPriority priority() {return _priority;}
174 FaultStat & countStat() {return _count;}
175};
176
177class REDStateException : public SparcFault
178{
179 private:
180 static FaultName _name;
181 static TrapType _trapType;
182 static FaultPriority _priority;
183 static FaultStat _count;
184 public:
185 FaultName name() {return _name;}
186 TrapType trapType() {return _trapType;}
187 FaultPriority priority() {return _priority;}
188 FaultStat & countStat() {return _count;}
189};
190
191class InstructionAccessException : public SparcFault
192{
193 private:
194 static FaultName _name;
195 static TrapType _trapType;
196 static FaultPriority _priority;
197 static FaultStat _count;
198 public:
199 FaultName name() {return _name;}
200 TrapType trapType() {return _trapType;}
201 FaultPriority priority() {return _priority;}
202 FaultStat & countStat() {return _count;}
203};
204
205class InstructionAccessMMUMiss : public SparcFault
206{
207 private:
208 static FaultName _name;
209 static TrapType _trapType;
210 static FaultPriority _priority;
211 static FaultStat _count;
212 public:
213 FaultName name() {return _name;}
214 TrapType trapType() {return _trapType;}
215 FaultPriority priority() {return _priority;}
216 FaultStat & countStat() {return _count;}
217};
218
219class InstructionAccessError : public SparcFault
220{
221 private:
222 static FaultName _name;
223 static TrapType _trapType;
224 static FaultPriority _priority;
225 static FaultStat _count;
226 public:
227 FaultName name() {return _name;}
228 TrapType trapType() {return _trapType;}
229 FaultPriority priority() {return _priority;}
230 FaultStat & countStat() {return _count;}
231};
232
233class IllegalInstruction : public SparcFault
234{
235 private:
236 static FaultName _name;
237 static TrapType _trapType;
238 static FaultPriority _priority;
239 static FaultStat _count;
240 public:
241 FaultName name() {return _name;}
242 TrapType trapType() {return _trapType;}
243 FaultPriority priority() {return _priority;}
244 FaultStat & countStat() {return _count;}
245};
246
247class PrivilegedOpcode : public SparcFault
248{
249 private:
250 static FaultName _name;
251 static TrapType _trapType;
252 static FaultPriority _priority;
253 static FaultStat _count;
254 public:
255 FaultName name() {return _name;}
256 TrapType trapType() {return _trapType;}
257 FaultPriority priority() {return _priority;}
258 FaultStat & countStat() {return _count;}
259};
260
261class UnimplementedLDD : public SparcFault
262{
263 private:
264 static FaultName _name;
265 static TrapType _trapType;
266 static FaultPriority _priority;
267 static FaultStat _count;
268 public:
269 FaultName name() {return _name;}
270 TrapType trapType() {return _trapType;}
271 FaultPriority priority() {return _priority;}
272 FaultStat & countStat() {return _count;}
273};
274
275class UnimplementedSTD : public SparcFault
276{
277 private:
278 static FaultName _name;
279 static TrapType _trapType;
280 static FaultPriority _priority;
281 static FaultStat _count;
282 public:
283 FaultName name() {return _name;}
284 TrapType trapType() {return _trapType;}
285 FaultPriority priority() {return _priority;}
286 FaultStat & countStat() {return _count;}
287};
288
289class FpDisabled : public SparcFault
290{
291 private:
292 static FaultName _name;
293 static TrapType _trapType;
294 static FaultPriority _priority;
295 static FaultStat _count;
296 public:
297 FaultName name() {return _name;}
298 TrapType trapType() {return _trapType;}
299 FaultPriority priority() {return _priority;}
300 FaultStat & countStat() {return _count;}
301};
302
303class FpExceptionIEEE754 : public SparcFault
304{
305 private:
306 static FaultName _name;
307 static TrapType _trapType;
308 static FaultPriority _priority;
309 static FaultStat _count;
310 public:
311 FaultName name() {return _name;}
312 TrapType trapType() {return _trapType;}
313 FaultPriority priority() {return _priority;}
314 FaultStat & countStat() {return _count;}
315};
316
317class FpExceptionOther : public SparcFault
318{
319 private:
320 static FaultName _name;
321 static TrapType _trapType;
322 static FaultPriority _priority;
323 static FaultStat _count;
324 public:
325 FaultName name() {return _name;}
326 TrapType trapType() {return _trapType;}
327 FaultPriority priority() {return _priority;}
328 FaultStat & countStat() {return _count;}
329};
330
331class TagOverflow : public SparcFault
332{
333 private:
334 static FaultName _name;
335 static TrapType _trapType;
336 static FaultPriority _priority;
337 static FaultStat _count;
338 public:
339 FaultName name() {return _name;}
340 TrapType trapType() {return _trapType;}
341 FaultPriority priority() {return _priority;}
342 FaultStat & countStat() {return _count;}
343};
344
345class DivisionByZero : public SparcFault
346{
347 private:
348 static FaultName _name;
349 static TrapType _trapType;
350 static FaultPriority _priority;
351 static FaultStat _count;
352 public:
353 FaultName name() {return _name;}
354 TrapType trapType() {return _trapType;}
355 FaultPriority priority() {return _priority;}
356 FaultStat & countStat() {return _count;}
357};
358
359class DataAccessException : public SparcFault
360{
361 private:
362 static FaultName _name;
363 static TrapType _trapType;
364 static FaultPriority _priority;
365 static FaultStat _count;
366 public:
367 FaultName name() {return _name;}
368 TrapType trapType() {return _trapType;}
369 FaultPriority priority() {return _priority;}
370 FaultStat & countStat() {return _count;}
371};
372
373class DataAccessMMUMiss : public SparcFault
374{
375 private:
376 static FaultName _name;
377 static TrapType _trapType;
378 static FaultPriority _priority;
379 static FaultStat _count;
380 public:
381 FaultName name() {return _name;}
382 TrapType trapType() {return _trapType;}
383 FaultPriority priority() {return _priority;}
384 FaultStat & countStat() {return _count;}
385};
386
387class DataAccessError : public SparcFault
388{
389 private:
390 static FaultName _name;
391 static TrapType _trapType;
392 static FaultPriority _priority;
393 static FaultStat _count;
394 public:
395 FaultName name() {return _name;}
396 TrapType trapType() {return _trapType;}
397 FaultPriority priority() {return _priority;}
398 FaultStat & countStat() {return _count;}
399};
400
401class DataAccessProtection : public SparcFault
402{
403 private:
404 static FaultName _name;
405 static TrapType _trapType;
406 static FaultPriority _priority;
407 static FaultStat _count;
408 public:
409 FaultName name() {return _name;}
410 TrapType trapType() {return _trapType;}
411 FaultPriority priority() {return _priority;}
412 FaultStat & countStat() {return _count;}
413};
414
415class LDDFMemAddressNotAligned : public SparcFault
416{
417 private:
418 static FaultName _name;
419 static TrapType _trapType;
420 static FaultPriority _priority;
421 static FaultStat _count;
422 public:
423 FaultName name() {return _name;}
424 TrapType trapType() {return _trapType;}
425 FaultPriority priority() {return _priority;}
426 FaultStat & countStat() {return _count;}
427};
428
429class STDFMemAddressNotAligned : public SparcFault
430{
431 private:
432 static FaultName _name;
433 static TrapType _trapType;
434 static FaultPriority _priority;
435 static FaultStat _count;
436 public:
437 FaultName name() {return _name;}
438 TrapType trapType() {return _trapType;}
439 FaultPriority priority() {return _priority;}
440 FaultStat & countStat() {return _count;}
441};
442
443class PrivilegedAction : public SparcFault
444{
445 private:
446 static FaultName _name;
447 static TrapType _trapType;
448 static FaultPriority _priority;
449 static FaultStat _count;
450 public:
451 FaultName name() {return _name;}
452 TrapType trapType() {return _trapType;}
453 FaultPriority priority() {return _priority;}
454 FaultStat & countStat() {return _count;}
455};
456
457class LDQFMemAddressNotAligned : public SparcFault
458{
459 private:
460 static FaultName _name;
461 static TrapType _trapType;
462 static FaultPriority _priority;
463 static FaultStat _count;
464 public:
465 FaultName name() {return _name;}
466 TrapType trapType() {return _trapType;}
467 FaultPriority priority() {return _priority;}
468 FaultStat & countStat() {return _count;}
469};
470
471class STQFMemAddressNotAligned : public SparcFault
472{
473 private:
474 static FaultName _name;
475 static TrapType _trapType;
476 static FaultPriority _priority;
477 static FaultStat _count;
478 public:
479 FaultName name() {return _name;}
480 TrapType trapType() {return _trapType;}
481 FaultPriority priority() {return _priority;}
482 FaultStat & countStat() {return _count;}
483};
484
485class AsyncDataError : public SparcFault
486{
487 private:
488 static FaultName _name;
489 static TrapType _trapType;
490 static FaultPriority _priority;
491 static FaultStat _count;
492 public:
493 FaultName name() {return _name;}
494 TrapType trapType() {return _trapType;}
495 FaultPriority priority() {return _priority;}
496 FaultStat & countStat() {return _count;}
497};
498
499class CleanWindow : public SparcFault
500{
501 private:
502 static FaultName _name;
503 static TrapType _trapType;
504 static FaultPriority _priority;
505 static FaultStat _count;
506 public:
507 FaultName name() {return _name;}
508 TrapType trapType() {return _trapType;}
509 FaultPriority priority() {return _priority;}
510 FaultStat & countStat() {return _count;}
511};
512
513class EnumeratedFault : public SparcFault
514{
515 protected:
516 uint32_t _n;
517 virtual TrapType baseTrapType() = 0;
518 public:
519 EnumeratedFault(uint32_t n) : SparcFault() {_n = n;}
520 TrapType trapType() {return baseTrapType() + _n;}
521};
522
523class InterruptLevelN : public EnumeratedFault
524{
525 private:
526 static FaultName _name;
527 static TrapType _baseTrapType;
528 static FaultStat _count;
529 TrapType baseTrapType() {return _baseTrapType;}
530 public:
531 InterruptLevelN(uint32_t n) : EnumeratedFault(n) {;}
532 FaultName name() {return _name;}
533 FaultPriority priority() {return 32 - _n;}
534 FaultStat & countStat() {return _count;}
535};
536
537class SpillNNormal : public EnumeratedFault
538{
539 private:
540 static FaultName _name;
541 static TrapType _baseTrapType;
542 static FaultPriority _priority;
543 static FaultStat _count;
544 TrapType baseTrapType() {return _baseTrapType;}
545 public:
546 SpillNNormal(uint32_t n) : EnumeratedFault(n) {;}
547 FaultName name() {return _name;}
548 FaultPriority priority() {return _priority;}
549 FaultStat & countStat() {return _count;}
550 void invoke(ThreadContext * tc);
551};
552
553class SpillNOther : public EnumeratedFault
554{
555 private:
556 static FaultName _name;
557 static TrapType _baseTrapType;
558 static FaultPriority _priority;
559 static FaultStat _count;
560 TrapType baseTrapType() {return _baseTrapType;}
561 public:
562 SpillNOther(uint32_t n) : EnumeratedFault(n) {;}
563 FaultName name() {return _name;}
564 FaultPriority priority() {return _priority;}
565 FaultStat & countStat() {return _count;}
566};
567
568class FillNNormal : public EnumeratedFault
569{
570 private:
571 static FaultName _name;
572 static TrapType _baseTrapType;
573 static FaultPriority _priority;
574 static FaultStat _count;
575 TrapType baseTrapType() {return _baseTrapType;}
576 public:
577 FillNNormal(uint32_t n) : EnumeratedFault(n) {;}
578 FaultName name() {return _name;}
579 FaultPriority priority() {return _priority;}
580 FaultStat & countStat() {return _count;}
581 void invoke(ThreadContext * tc);
582};
583
584class FillNOther : public EnumeratedFault
585{
586 private:
587 static FaultName _name;
588 static TrapType _baseTrapType;
589 static FaultPriority _priority;
590 static FaultStat _count;
591 TrapType baseTrapType() {return _baseTrapType;}
592 public:
593 FillNOther(uint32_t n) : EnumeratedFault(n) {;}
594 FaultName name() {return _name;}
595 FaultPriority priority() {return _priority;}
596 FaultStat & countStat() {return _count;}
597};
598
599class TrapInstruction : public EnumeratedFault
600{
601 private:
602 static FaultName _name;
603 static TrapType _baseTrapType;
604 static FaultPriority _priority;
605 static FaultStat _count;
606 uint64_t syscall_num;
607 TrapType baseTrapType() {return _baseTrapType;}
608 public:
609 TrapInstruction(uint32_t n, uint64_t syscall) :
610 EnumeratedFault(n), syscall_num(syscall) {;}
611 FaultName name() {return _name;}
612 FaultPriority priority() {return _priority;}
613 FaultStat & countStat() {return _count;}
614#if !FULL_SYSTEM
615 void invoke(ThreadContext * tc);
616#endif
617};
618
619
620} // SparcISA namespace
621
622#endif // __FAULTS_HH__
134};
135
136class WatchDogReset : public SparcFault
137{
138 private:
139 static FaultName _name;
140 static TrapType _trapType;
141 static FaultPriority _priority;
142 static FaultStat _count;
143 public:
144 FaultName name() {return _name;}
145 TrapType trapType() {return _trapType;}
146 FaultPriority priority() {return _priority;}
147 FaultStat & countStat() {return _count;}
148};
149
150class ExternallyInitiatedReset : public SparcFault
151{
152 private:
153 static FaultName _name;
154 static TrapType _trapType;
155 static FaultPriority _priority;
156 static FaultStat _count;
157 public:
158 FaultName name() {return _name;}
159 TrapType trapType() {return _trapType;}
160 FaultPriority priority() {return _priority;}
161 FaultStat & countStat() {return _count;}
162};
163
164class SoftwareInitiatedReset : public SparcFault
165{
166 private:
167 static FaultName _name;
168 static TrapType _trapType;
169 static FaultPriority _priority;
170 static FaultStat _count;
171 public:
172 FaultName name() {return _name;}
173 TrapType trapType() {return _trapType;}
174 FaultPriority priority() {return _priority;}
175 FaultStat & countStat() {return _count;}
176};
177
178class REDStateException : public SparcFault
179{
180 private:
181 static FaultName _name;
182 static TrapType _trapType;
183 static FaultPriority _priority;
184 static FaultStat _count;
185 public:
186 FaultName name() {return _name;}
187 TrapType trapType() {return _trapType;}
188 FaultPriority priority() {return _priority;}
189 FaultStat & countStat() {return _count;}
190};
191
192class InstructionAccessException : public SparcFault
193{
194 private:
195 static FaultName _name;
196 static TrapType _trapType;
197 static FaultPriority _priority;
198 static FaultStat _count;
199 public:
200 FaultName name() {return _name;}
201 TrapType trapType() {return _trapType;}
202 FaultPriority priority() {return _priority;}
203 FaultStat & countStat() {return _count;}
204};
205
206class InstructionAccessMMUMiss : public SparcFault
207{
208 private:
209 static FaultName _name;
210 static TrapType _trapType;
211 static FaultPriority _priority;
212 static FaultStat _count;
213 public:
214 FaultName name() {return _name;}
215 TrapType trapType() {return _trapType;}
216 FaultPriority priority() {return _priority;}
217 FaultStat & countStat() {return _count;}
218};
219
220class InstructionAccessError : public SparcFault
221{
222 private:
223 static FaultName _name;
224 static TrapType _trapType;
225 static FaultPriority _priority;
226 static FaultStat _count;
227 public:
228 FaultName name() {return _name;}
229 TrapType trapType() {return _trapType;}
230 FaultPriority priority() {return _priority;}
231 FaultStat & countStat() {return _count;}
232};
233
234class IllegalInstruction : public SparcFault
235{
236 private:
237 static FaultName _name;
238 static TrapType _trapType;
239 static FaultPriority _priority;
240 static FaultStat _count;
241 public:
242 FaultName name() {return _name;}
243 TrapType trapType() {return _trapType;}
244 FaultPriority priority() {return _priority;}
245 FaultStat & countStat() {return _count;}
246};
247
248class PrivilegedOpcode : public SparcFault
249{
250 private:
251 static FaultName _name;
252 static TrapType _trapType;
253 static FaultPriority _priority;
254 static FaultStat _count;
255 public:
256 FaultName name() {return _name;}
257 TrapType trapType() {return _trapType;}
258 FaultPriority priority() {return _priority;}
259 FaultStat & countStat() {return _count;}
260};
261
262class UnimplementedLDD : public SparcFault
263{
264 private:
265 static FaultName _name;
266 static TrapType _trapType;
267 static FaultPriority _priority;
268 static FaultStat _count;
269 public:
270 FaultName name() {return _name;}
271 TrapType trapType() {return _trapType;}
272 FaultPriority priority() {return _priority;}
273 FaultStat & countStat() {return _count;}
274};
275
276class UnimplementedSTD : public SparcFault
277{
278 private:
279 static FaultName _name;
280 static TrapType _trapType;
281 static FaultPriority _priority;
282 static FaultStat _count;
283 public:
284 FaultName name() {return _name;}
285 TrapType trapType() {return _trapType;}
286 FaultPriority priority() {return _priority;}
287 FaultStat & countStat() {return _count;}
288};
289
290class FpDisabled : public SparcFault
291{
292 private:
293 static FaultName _name;
294 static TrapType _trapType;
295 static FaultPriority _priority;
296 static FaultStat _count;
297 public:
298 FaultName name() {return _name;}
299 TrapType trapType() {return _trapType;}
300 FaultPriority priority() {return _priority;}
301 FaultStat & countStat() {return _count;}
302};
303
304class FpExceptionIEEE754 : public SparcFault
305{
306 private:
307 static FaultName _name;
308 static TrapType _trapType;
309 static FaultPriority _priority;
310 static FaultStat _count;
311 public:
312 FaultName name() {return _name;}
313 TrapType trapType() {return _trapType;}
314 FaultPriority priority() {return _priority;}
315 FaultStat & countStat() {return _count;}
316};
317
318class FpExceptionOther : public SparcFault
319{
320 private:
321 static FaultName _name;
322 static TrapType _trapType;
323 static FaultPriority _priority;
324 static FaultStat _count;
325 public:
326 FaultName name() {return _name;}
327 TrapType trapType() {return _trapType;}
328 FaultPriority priority() {return _priority;}
329 FaultStat & countStat() {return _count;}
330};
331
332class TagOverflow : public SparcFault
333{
334 private:
335 static FaultName _name;
336 static TrapType _trapType;
337 static FaultPriority _priority;
338 static FaultStat _count;
339 public:
340 FaultName name() {return _name;}
341 TrapType trapType() {return _trapType;}
342 FaultPriority priority() {return _priority;}
343 FaultStat & countStat() {return _count;}
344};
345
346class DivisionByZero : public SparcFault
347{
348 private:
349 static FaultName _name;
350 static TrapType _trapType;
351 static FaultPriority _priority;
352 static FaultStat _count;
353 public:
354 FaultName name() {return _name;}
355 TrapType trapType() {return _trapType;}
356 FaultPriority priority() {return _priority;}
357 FaultStat & countStat() {return _count;}
358};
359
360class DataAccessException : public SparcFault
361{
362 private:
363 static FaultName _name;
364 static TrapType _trapType;
365 static FaultPriority _priority;
366 static FaultStat _count;
367 public:
368 FaultName name() {return _name;}
369 TrapType trapType() {return _trapType;}
370 FaultPriority priority() {return _priority;}
371 FaultStat & countStat() {return _count;}
372};
373
374class DataAccessMMUMiss : public SparcFault
375{
376 private:
377 static FaultName _name;
378 static TrapType _trapType;
379 static FaultPriority _priority;
380 static FaultStat _count;
381 public:
382 FaultName name() {return _name;}
383 TrapType trapType() {return _trapType;}
384 FaultPriority priority() {return _priority;}
385 FaultStat & countStat() {return _count;}
386};
387
388class DataAccessError : public SparcFault
389{
390 private:
391 static FaultName _name;
392 static TrapType _trapType;
393 static FaultPriority _priority;
394 static FaultStat _count;
395 public:
396 FaultName name() {return _name;}
397 TrapType trapType() {return _trapType;}
398 FaultPriority priority() {return _priority;}
399 FaultStat & countStat() {return _count;}
400};
401
402class DataAccessProtection : public SparcFault
403{
404 private:
405 static FaultName _name;
406 static TrapType _trapType;
407 static FaultPriority _priority;
408 static FaultStat _count;
409 public:
410 FaultName name() {return _name;}
411 TrapType trapType() {return _trapType;}
412 FaultPriority priority() {return _priority;}
413 FaultStat & countStat() {return _count;}
414};
415
416class LDDFMemAddressNotAligned : public SparcFault
417{
418 private:
419 static FaultName _name;
420 static TrapType _trapType;
421 static FaultPriority _priority;
422 static FaultStat _count;
423 public:
424 FaultName name() {return _name;}
425 TrapType trapType() {return _trapType;}
426 FaultPriority priority() {return _priority;}
427 FaultStat & countStat() {return _count;}
428};
429
430class STDFMemAddressNotAligned : public SparcFault
431{
432 private:
433 static FaultName _name;
434 static TrapType _trapType;
435 static FaultPriority _priority;
436 static FaultStat _count;
437 public:
438 FaultName name() {return _name;}
439 TrapType trapType() {return _trapType;}
440 FaultPriority priority() {return _priority;}
441 FaultStat & countStat() {return _count;}
442};
443
444class PrivilegedAction : public SparcFault
445{
446 private:
447 static FaultName _name;
448 static TrapType _trapType;
449 static FaultPriority _priority;
450 static FaultStat _count;
451 public:
452 FaultName name() {return _name;}
453 TrapType trapType() {return _trapType;}
454 FaultPriority priority() {return _priority;}
455 FaultStat & countStat() {return _count;}
456};
457
458class LDQFMemAddressNotAligned : public SparcFault
459{
460 private:
461 static FaultName _name;
462 static TrapType _trapType;
463 static FaultPriority _priority;
464 static FaultStat _count;
465 public:
466 FaultName name() {return _name;}
467 TrapType trapType() {return _trapType;}
468 FaultPriority priority() {return _priority;}
469 FaultStat & countStat() {return _count;}
470};
471
472class STQFMemAddressNotAligned : public SparcFault
473{
474 private:
475 static FaultName _name;
476 static TrapType _trapType;
477 static FaultPriority _priority;
478 static FaultStat _count;
479 public:
480 FaultName name() {return _name;}
481 TrapType trapType() {return _trapType;}
482 FaultPriority priority() {return _priority;}
483 FaultStat & countStat() {return _count;}
484};
485
486class AsyncDataError : public SparcFault
487{
488 private:
489 static FaultName _name;
490 static TrapType _trapType;
491 static FaultPriority _priority;
492 static FaultStat _count;
493 public:
494 FaultName name() {return _name;}
495 TrapType trapType() {return _trapType;}
496 FaultPriority priority() {return _priority;}
497 FaultStat & countStat() {return _count;}
498};
499
500class CleanWindow : public SparcFault
501{
502 private:
503 static FaultName _name;
504 static TrapType _trapType;
505 static FaultPriority _priority;
506 static FaultStat _count;
507 public:
508 FaultName name() {return _name;}
509 TrapType trapType() {return _trapType;}
510 FaultPriority priority() {return _priority;}
511 FaultStat & countStat() {return _count;}
512};
513
514class EnumeratedFault : public SparcFault
515{
516 protected:
517 uint32_t _n;
518 virtual TrapType baseTrapType() = 0;
519 public:
520 EnumeratedFault(uint32_t n) : SparcFault() {_n = n;}
521 TrapType trapType() {return baseTrapType() + _n;}
522};
523
524class InterruptLevelN : public EnumeratedFault
525{
526 private:
527 static FaultName _name;
528 static TrapType _baseTrapType;
529 static FaultStat _count;
530 TrapType baseTrapType() {return _baseTrapType;}
531 public:
532 InterruptLevelN(uint32_t n) : EnumeratedFault(n) {;}
533 FaultName name() {return _name;}
534 FaultPriority priority() {return 32 - _n;}
535 FaultStat & countStat() {return _count;}
536};
537
538class SpillNNormal : public EnumeratedFault
539{
540 private:
541 static FaultName _name;
542 static TrapType _baseTrapType;
543 static FaultPriority _priority;
544 static FaultStat _count;
545 TrapType baseTrapType() {return _baseTrapType;}
546 public:
547 SpillNNormal(uint32_t n) : EnumeratedFault(n) {;}
548 FaultName name() {return _name;}
549 FaultPriority priority() {return _priority;}
550 FaultStat & countStat() {return _count;}
551 void invoke(ThreadContext * tc);
552};
553
554class SpillNOther : public EnumeratedFault
555{
556 private:
557 static FaultName _name;
558 static TrapType _baseTrapType;
559 static FaultPriority _priority;
560 static FaultStat _count;
561 TrapType baseTrapType() {return _baseTrapType;}
562 public:
563 SpillNOther(uint32_t n) : EnumeratedFault(n) {;}
564 FaultName name() {return _name;}
565 FaultPriority priority() {return _priority;}
566 FaultStat & countStat() {return _count;}
567};
568
569class FillNNormal : public EnumeratedFault
570{
571 private:
572 static FaultName _name;
573 static TrapType _baseTrapType;
574 static FaultPriority _priority;
575 static FaultStat _count;
576 TrapType baseTrapType() {return _baseTrapType;}
577 public:
578 FillNNormal(uint32_t n) : EnumeratedFault(n) {;}
579 FaultName name() {return _name;}
580 FaultPriority priority() {return _priority;}
581 FaultStat & countStat() {return _count;}
582 void invoke(ThreadContext * tc);
583};
584
585class FillNOther : public EnumeratedFault
586{
587 private:
588 static FaultName _name;
589 static TrapType _baseTrapType;
590 static FaultPriority _priority;
591 static FaultStat _count;
592 TrapType baseTrapType() {return _baseTrapType;}
593 public:
594 FillNOther(uint32_t n) : EnumeratedFault(n) {;}
595 FaultName name() {return _name;}
596 FaultPriority priority() {return _priority;}
597 FaultStat & countStat() {return _count;}
598};
599
600class TrapInstruction : public EnumeratedFault
601{
602 private:
603 static FaultName _name;
604 static TrapType _baseTrapType;
605 static FaultPriority _priority;
606 static FaultStat _count;
607 uint64_t syscall_num;
608 TrapType baseTrapType() {return _baseTrapType;}
609 public:
610 TrapInstruction(uint32_t n, uint64_t syscall) :
611 EnumeratedFault(n), syscall_num(syscall) {;}
612 FaultName name() {return _name;}
613 FaultPriority priority() {return _priority;}
614 FaultStat & countStat() {return _count;}
615#if !FULL_SYSTEM
616 void invoke(ThreadContext * tc);
617#endif
618};
619
620
621} // SparcISA namespace
622
623#endif // __FAULTS_HH__