faults.hh revision 2174
112840Sgabeblack@google.com/*
212840Sgabeblack@google.com * Copyright (c) 2003-2005 The Regents of The University of Michigan
312840Sgabeblack@google.com * All rights reserved.
412840Sgabeblack@google.com *
512840Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
612840Sgabeblack@google.com * modification, are permitted provided that the following conditions are
712840Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
812840Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
912840Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
1012840Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1112840Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1212840Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1312840Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1412840Sgabeblack@google.com * this software without specific prior written permission.
1512840Sgabeblack@google.com *
1612840Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1712840Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1812840Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1912840Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2012840Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2112840Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2212840Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2312840Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2412840Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2512840Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2612840Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2712840Sgabeblack@google.com */
2812840Sgabeblack@google.com
2912840Sgabeblack@google.com#ifndef __ALPHA_FAULTS_HH__
3012840Sgabeblack@google.com#define __ALPHA_FAULTS_HH__
3112840Sgabeblack@google.com
3212840Sgabeblack@google.com#include "sim/faults.hh"
3312840Sgabeblack@google.com
3412840Sgabeblack@google.com// The design of the "name" and "vect" functions is in sim/faults.hh
3512840Sgabeblack@google.com
3612840Sgabeblack@google.comnamespace AlphaISA
3712840Sgabeblack@google.com{
3812840Sgabeblack@google.com
3912840Sgabeblack@google.comtypedef const Addr FaultVect;
4012840Sgabeblack@google.com
4112840Sgabeblack@google.comclass AlphaFault : public FaultBase
4212840Sgabeblack@google.com{
4312840Sgabeblack@google.com  private:
4412840Sgabeblack@google.com    static FaultName _name;
4512940Sgabeblack@google.com    static FaultVect _vect;
4612840Sgabeblack@google.com    static FaultStat _stat;
4712840Sgabeblack@google.com  public:
4812840Sgabeblack@google.com#if FULL_SYSTEM
4912840Sgabeblack@google.com    void ev5_trap(ExecContext * xc);
50#endif
51    FaultName name() {return _name;}
52    virtual FaultVect vect() {return _vect;}
53    virtual FaultStat & stat() {return _stat;}
54};
55
56class AlphaMachineCheckFault : public MachineCheckFault
57{
58  private:
59    static FaultVect _vect;
60    static FaultStat _stat;
61  public:
62#if FULL_SYSTEM
63    void ev5_trap(ExecContext * xc);
64#endif
65    FaultVect vect() {return _vect;}
66    FaultStat & stat() {return _stat;}
67};
68
69class AlphaAlignmentFault : public AlignmentFault
70{
71  private:
72    static FaultVect _vect;
73    static FaultStat _stat;
74  public:
75#if FULL_SYSTEM
76    void ev5_trap(ExecContext * xc);
77#endif
78    FaultVect vect() {return _vect;}
79    FaultStat & stat() {return _stat;}
80};
81
82static inline Fault genMachineCheckFault()
83{
84    return new AlphaMachineCheckFault;
85}
86
87static inline Fault genAlignmentFault()
88{
89    return new AlphaAlignmentFault;
90}
91
92class ResetFault : public AlphaFault
93{
94  private:
95    static FaultName _name;
96    static FaultVect _vect;
97    static FaultStat _stat;
98  public:
99    FaultName name() {return _name;}
100    FaultVect vect() {return _vect;}
101    FaultStat & stat() {return _stat;}
102};
103
104class ArithmeticFault : public AlphaFault
105{
106  private:
107    static FaultName _name;
108    static FaultVect _vect;
109    static FaultStat _stat;
110  public:
111    FaultName name() {return _name;}
112    FaultVect vect() {return _vect;}
113    FaultStat & stat() {return _stat;}
114};
115
116class InterruptFault : public AlphaFault
117{
118  private:
119    static FaultName _name;
120    static FaultVect _vect;
121    static FaultStat _stat;
122  public:
123    FaultName name() {return _name;}
124    FaultVect vect() {return _vect;}
125    FaultStat & stat() {return _stat;}
126};
127
128class NDtbMissFault : public AlphaFault
129{
130  private:
131    static FaultName _name;
132    static FaultVect _vect;
133    static FaultStat _stat;
134  public:
135    FaultName name() {return _name;}
136    FaultVect vect() {return _vect;}
137    FaultStat & stat() {return _stat;}
138};
139
140class PDtbMissFault : public AlphaFault
141{
142  private:
143    static FaultName _name;
144    static FaultVect _vect;
145    static FaultStat _stat;
146  public:
147    FaultName name() {return _name;}
148    FaultVect vect() {return _vect;}
149    FaultStat & stat() {return _stat;}
150};
151
152class DtbPageFault : public AlphaFault
153{
154  private:
155    static FaultName _name;
156    static FaultVect _vect;
157    static FaultStat _stat;
158  public:
159    FaultName name() {return _name;}
160    FaultVect vect() {return _vect;}
161    FaultStat & stat() {return _stat;}
162};
163
164class DtbAcvFault : public AlphaFault
165{
166  private:
167    static FaultName _name;
168    static FaultVect _vect;
169    static FaultStat _stat;
170  public:
171    FaultName name() {return _name;}
172    FaultVect vect() {return _vect;}
173    FaultStat & stat() {return _stat;}
174};
175
176class ItbMissFault : public AlphaFault
177{
178  private:
179    static FaultName _name;
180    static FaultVect _vect;
181    static FaultStat _stat;
182  public:
183    FaultName name() {return _name;}
184    FaultVect vect() {return _vect;}
185    FaultStat & stat() {return _stat;}
186};
187
188class ItbPageFault : public AlphaFault
189{
190  private:
191    static FaultName _name;
192    static FaultVect _vect;
193    static FaultStat _stat;
194  public:
195    FaultName name() {return _name;}
196    FaultVect vect() {return _vect;}
197    FaultStat & stat() {return _stat;}
198};
199
200class ItbAcvFault : public AlphaFault
201{
202  private:
203    static FaultName _name;
204    static FaultVect _vect;
205    static FaultStat _stat;
206  public:
207    FaultName name() {return _name;}
208    FaultVect vect() {return _vect;}
209    FaultStat & stat() {return _stat;}
210};
211
212class UnimplementedOpcodeFault : public AlphaFault
213{
214  private:
215    static FaultName _name;
216    static FaultVect _vect;
217    static FaultStat _stat;
218  public:
219    FaultName name() {return _name;}
220    FaultVect vect() {return _vect;}
221    FaultStat & stat() {return _stat;}
222};
223
224class FloatEnableFault : public AlphaFault
225{
226  private:
227    static FaultName _name;
228    static FaultVect _vect;
229    static FaultStat _stat;
230  public:
231    FaultName name() {return _name;}
232    FaultVect vect() {return _vect;}
233    FaultStat & stat() {return _stat;}
234};
235
236class PalFault : public AlphaFault
237{
238  private:
239    static FaultName _name;
240    static FaultVect _vect;
241    static FaultStat _stat;
242  public:
243    FaultName name() {return _name;}
244    FaultVect vect() {return _vect;}
245    FaultStat & stat() {return _stat;}
246};
247
248class IntegerOverflowFault : public AlphaFault
249{
250  private:
251    static FaultName _name;
252    static FaultVect _vect;
253    static FaultStat _stat;
254  public:
255    FaultName name() {return _name;}
256    FaultVect vect() {return _vect;}
257    FaultStat & stat() {return _stat;}
258};
259
260} // AlphaISA namespace
261
262#endif // __FAULTS_HH__
263