faults.hh revision 2239
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 __MIPS_FAULTS_HH__
30#define __MIPS_FAULTS_HH__
31
32#include "sim/faults.hh"
33#include "arch/isa_traits.hh" //For the Addr type
34
35class MipsFault : public FaultBase
36{
37  public:
38    MipsFault(char * newName, int newId, Addr newVect)
39        : FaultBase(newName, newId), vect(newVect)
40    {;}
41
42    Addr vect;
43};
44
45extern class ResetFaultType : public MipsFault
46{
47  public:
48    ResetFaultType(char * newName, int newId, Addr newVect)
49        : MipsFault(newName, newId, newVect)
50    {;}
51} * const ResetFault;
52
53extern class ArithmeticFaultType : public MipsFault
54{
55  public:
56    ArithmeticFaultType(char * newName, int newId, Addr newVect)
57        : MipsFault(newName, newId, newVect)
58    {;}
59} * const ArithmeticFault;
60
61extern class InterruptFaultType : public MipsFault
62{
63  public:
64    InterruptFaultType(char * newName, int newId, Addr newVect)
65        : MipsFault(newName, newId, newVect)
66    {;}
67} * const InterruptFault;
68
69extern class NDtbMissFaultType : public MipsFault
70{
71  public:
72    NDtbMissFaultType(char * newName, int newId, Addr newVect)
73        : MipsFault(newName, newId, newVect)
74    {;}
75} * const NDtbMissFault;
76
77extern class PDtbMissFaultType : public MipsFault
78{
79  public:
80    PDtbMissFaultType(char * newName, int newId, Addr newVect)
81        : MipsFault(newName, newId, newVect)
82    {;}
83} * const PDtbMissFault;
84
85extern class DtbPageFaultType : public MipsFault
86{
87  public:
88    DtbPageFaultType(char * newName, int newId, Addr newVect)
89        : MipsFault(newName, newId, newVect)
90    {;}
91} * const DtbPageFault;
92
93extern class DtbAcvFaultType : public MipsFault
94{
95  public:
96    DtbAcvFaultType(char * newName, int newId, Addr newVect)
97        : MipsFault(newName, newId, newVect)
98    {;}
99} * const DtbAcvFault;
100
101extern class ItbMissFaultType : public MipsFault
102{
103  public:
104    ItbMissFaultType(char * newName, int newId, Addr newVect)
105        : MipsFault(newName, newId, newVect)
106    {;}
107} * const ItbMissFault;
108
109extern class ItbPageFaultType : public MipsFault
110{
111  public:
112    ItbPageFaultType(char * newName, int newId, Addr newVect)
113        : MipsFault(newName, newId, newVect)
114    {;}
115} * const ItbPageFault;
116
117extern class ItbAcvFaultType : public MipsFault
118{
119  public:
120    ItbAcvFaultType(char * newName, int newId, Addr newVect)
121        : MipsFault(newName, newId, newVect)
122    {;}
123} * const ItbAcvFault;
124
125extern class UnimplementedOpcodeFaultType : public MipsFault
126{
127  public:
128    UnimplementedOpcodeFaultType(char * newName, int newId, Addr newVect)
129        : MipsFault(newName, newId, newVect)
130    {;}
131} * const UnimplementedOpcodeFault;
132
133extern class FloatEnableFaultType : public MipsFault
134{
135  public:
136    FloatEnableFaultType(char * newName, int newId, Addr newVect)
137        : MipsFault(newName, newId, newVect)
138    {;}
139} * const FloatEnableFault;
140
141extern class PalFaultType : public MipsFault
142{
143  public:
144    PalFaultType(char * newName, int newId, Addr newVect)
145        : MipsFault(newName, newId, newVect)
146    {;}
147} * const PalFault;
148
149extern class IntegerOverflowFaultType : public MipsFault
150{
151  public:
152    IntegerOverflowFaultType(char * newName, int newId, Addr newVect)
153        : MipsFault(newName, newId, newVect)
154    {;}
155} * const IntegerOverflowFault;
156
157extern Fault ** ListOfFaults[];
158extern int NumFaults;
159
160#endif // __FAULTS_HH__
161