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
| 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__
| 32#ifndef __ARCH_ALPHA_FAULTS_HH__ 33#define __ARCH_ALPHA_FAULTS_HH__
|
34
| 34
|
| 35#include "arch/alpha/pagetable.hh"
|
35#include "config/full_system.hh" 36#include "sim/faults.hh" 37
| 36#include "config/full_system.hh" 37#include "sim/faults.hh" 38
|
38#include "arch/alpha/pagetable.hh" 39
| |
40// The design of the "name" and "vect" functions is in sim/faults.hh 41
| 39// The design of the "name" and "vect" functions is in sim/faults.hh 40
|
42namespace AlphaISA 43{
| 41namespace AlphaISA {
|
44 45typedef const Addr FaultVect; 46 47class AlphaFault : public FaultBase 48{ 49 protected: 50 virtual bool skipFaultingInstruction() {return false;} 51 virtual bool setRestartAddress() {return true;} 52 public: 53#if FULL_SYSTEM 54 void invoke(ThreadContext * tc); 55#endif 56 virtual FaultVect vect() = 0; 57 virtual FaultStat & countStat() = 0; 58}; 59 60class MachineCheckFault : public AlphaFault 61{ 62 private: 63 static FaultName _name; 64 static FaultVect _vect; 65 static FaultStat _count;
| 42 43typedef const Addr FaultVect; 44 45class AlphaFault : public FaultBase 46{ 47 protected: 48 virtual bool skipFaultingInstruction() {return false;} 49 virtual bool setRestartAddress() {return true;} 50 public: 51#if FULL_SYSTEM 52 void invoke(ThreadContext * tc); 53#endif 54 virtual FaultVect vect() = 0; 55 virtual FaultStat & countStat() = 0; 56}; 57 58class MachineCheckFault : public AlphaFault 59{ 60 private: 61 static FaultName _name; 62 static FaultVect _vect; 63 static FaultStat _count;
|
| 64
|
66 public: 67 FaultName name() const {return _name;} 68 FaultVect vect() {return _vect;} 69 FaultStat & countStat() {return _count;} 70 bool isMachineCheckFault() const {return true;} 71}; 72 73class AlignmentFault : public AlphaFault 74{ 75 private: 76 static FaultName _name; 77 static FaultVect _vect; 78 static FaultStat _count;
| 65 public: 66 FaultName name() const {return _name;} 67 FaultVect vect() {return _vect;} 68 FaultStat & countStat() {return _count;} 69 bool isMachineCheckFault() const {return true;} 70}; 71 72class AlignmentFault : public AlphaFault 73{ 74 private: 75 static FaultName _name; 76 static FaultVect _vect; 77 static FaultStat _count;
|
| 78
|
79 public: 80 FaultName name() const {return _name;} 81 FaultVect vect() {return _vect;} 82 FaultStat & countStat() {return _count;} 83 bool isAlignmentFault() const {return true;} 84}; 85 86static inline Fault genMachineCheckFault() 87{ 88 return new MachineCheckFault; 89} 90 91class ResetFault : public AlphaFault 92{ 93 private: 94 static FaultName _name; 95 static FaultVect _vect; 96 static FaultStat _count;
| 79 public: 80 FaultName name() const {return _name;} 81 FaultVect vect() {return _vect;} 82 FaultStat & countStat() {return _count;} 83 bool isAlignmentFault() const {return true;} 84}; 85 86static inline Fault genMachineCheckFault() 87{ 88 return new MachineCheckFault; 89} 90 91class ResetFault : public AlphaFault 92{ 93 private: 94 static FaultName _name; 95 static FaultVect _vect; 96 static FaultStat _count;
|
| 97
|
97 public: 98 FaultName name() const {return _name;} 99 FaultVect vect() {return _vect;} 100 FaultStat & countStat() {return _count;} 101}; 102 103class ArithmeticFault : public AlphaFault 104{
| 98 public: 99 FaultName name() const {return _name;} 100 FaultVect vect() {return _vect;} 101 FaultStat & countStat() {return _count;} 102}; 103 104class ArithmeticFault : public AlphaFault 105{
|
105 protected: 106 bool skipFaultingInstruction() {return true;}
| |
107 private: 108 static FaultName _name; 109 static FaultVect _vect; 110 static FaultStat _count;
| 106 private: 107 static FaultName _name; 108 static FaultVect _vect; 109 static FaultStat _count;
|
| 110 111 protected: 112 bool skipFaultingInstruction() {return true;} 113
|
111 public: 112 FaultName name() const {return _name;} 113 FaultVect vect() {return _vect;} 114 FaultStat & countStat() {return _count;} 115#if FULL_SYSTEM 116 void invoke(ThreadContext * tc); 117#endif 118}; 119 120class InterruptFault : public AlphaFault 121{
| 114 public: 115 FaultName name() const {return _name;} 116 FaultVect vect() {return _vect;} 117 FaultStat & countStat() {return _count;} 118#if FULL_SYSTEM 119 void invoke(ThreadContext * tc); 120#endif 121}; 122 123class InterruptFault : public AlphaFault 124{
|
122 protected: 123 bool setRestartAddress() {return false;}
| |
124 private: 125 static FaultName _name; 126 static FaultVect _vect; 127 static FaultStat _count;
| 125 private: 126 static FaultName _name; 127 static FaultVect _vect; 128 static FaultStat _count;
|
| 129 130 protected: 131 bool setRestartAddress() {return false;} 132
|
128 public: 129 FaultName name() const {return _name;} 130 FaultVect vect() {return _vect;} 131 FaultStat & countStat() {return _count;} 132}; 133 134class DtbFault : public AlphaFault 135{ 136 protected: 137 VAddr vaddr; 138 uint32_t reqFlags; 139 uint64_t flags;
| 133 public: 134 FaultName name() const {return _name;} 135 FaultVect vect() {return _vect;} 136 FaultStat & countStat() {return _count;} 137}; 138 139class DtbFault : public AlphaFault 140{ 141 protected: 142 VAddr vaddr; 143 uint32_t reqFlags; 144 uint64_t flags;
|
| 145
|
140 public: 141 DtbFault(VAddr _vaddr, uint32_t _reqFlags, uint64_t _flags) 142 : vaddr(_vaddr), reqFlags(_reqFlags), flags(_flags) 143 { } 144 FaultName name() const = 0; 145 FaultVect vect() = 0; 146 FaultStat & countStat() = 0; 147#if FULL_SYSTEM 148 void invoke(ThreadContext * tc); 149#endif 150}; 151 152class NDtbMissFault : public DtbFault 153{ 154 private: 155 static FaultName _name; 156 static FaultVect _vect; 157 static FaultStat _count;
| 146 public: 147 DtbFault(VAddr _vaddr, uint32_t _reqFlags, uint64_t _flags) 148 : vaddr(_vaddr), reqFlags(_reqFlags), flags(_flags) 149 { } 150 FaultName name() const = 0; 151 FaultVect vect() = 0; 152 FaultStat & countStat() = 0; 153#if FULL_SYSTEM 154 void invoke(ThreadContext * tc); 155#endif 156}; 157 158class NDtbMissFault : public DtbFault 159{ 160 private: 161 static FaultName _name; 162 static FaultVect _vect; 163 static FaultStat _count;
|
| 164
|
158 public: 159 NDtbMissFault(VAddr vaddr, uint32_t reqFlags, uint64_t flags) 160 : DtbFault(vaddr, reqFlags, flags) 161 { } 162 FaultName name() const {return _name;} 163 FaultVect vect() {return _vect;} 164 FaultStat & countStat() {return _count;} 165#if !FULL_SYSTEM 166 void invoke(ThreadContext * tc); 167#endif 168}; 169 170class PDtbMissFault : public DtbFault 171{ 172 private: 173 static FaultName _name; 174 static FaultVect _vect; 175 static FaultStat _count;
| 165 public: 166 NDtbMissFault(VAddr vaddr, uint32_t reqFlags, uint64_t flags) 167 : DtbFault(vaddr, reqFlags, flags) 168 { } 169 FaultName name() const {return _name;} 170 FaultVect vect() {return _vect;} 171 FaultStat & countStat() {return _count;} 172#if !FULL_SYSTEM 173 void invoke(ThreadContext * tc); 174#endif 175}; 176 177class PDtbMissFault : public DtbFault 178{ 179 private: 180 static FaultName _name; 181 static FaultVect _vect; 182 static FaultStat _count;
|
| 183
|
176 public: 177 PDtbMissFault(VAddr vaddr, uint32_t reqFlags, uint64_t flags) 178 : DtbFault(vaddr, reqFlags, flags) 179 { } 180 FaultName name() const {return _name;} 181 FaultVect vect() {return _vect;} 182 FaultStat & countStat() {return _count;} 183}; 184 185class DtbPageFault : public DtbFault 186{ 187 private: 188 static FaultName _name; 189 static FaultVect _vect; 190 static FaultStat _count;
| 184 public: 185 PDtbMissFault(VAddr vaddr, uint32_t reqFlags, uint64_t flags) 186 : DtbFault(vaddr, reqFlags, flags) 187 { } 188 FaultName name() const {return _name;} 189 FaultVect vect() {return _vect;} 190 FaultStat & countStat() {return _count;} 191}; 192 193class DtbPageFault : public DtbFault 194{ 195 private: 196 static FaultName _name; 197 static FaultVect _vect; 198 static FaultStat _count;
|
| 199
|
191 public: 192 DtbPageFault(VAddr vaddr, uint32_t reqFlags, uint64_t flags) 193 : DtbFault(vaddr, reqFlags, flags) 194 { } 195 FaultName name() const {return _name;} 196 FaultVect vect() {return _vect;} 197 FaultStat & countStat() {return _count;} 198}; 199 200class DtbAcvFault : public DtbFault 201{ 202 private: 203 static FaultName _name; 204 static FaultVect _vect; 205 static FaultStat _count;
| 200 public: 201 DtbPageFault(VAddr vaddr, uint32_t reqFlags, uint64_t flags) 202 : DtbFault(vaddr, reqFlags, flags) 203 { } 204 FaultName name() const {return _name;} 205 FaultVect vect() {return _vect;} 206 FaultStat & countStat() {return _count;} 207}; 208 209class DtbAcvFault : public DtbFault 210{ 211 private: 212 static FaultName _name; 213 static FaultVect _vect; 214 static FaultStat _count;
|
| 215
|
206 public: 207 DtbAcvFault(VAddr vaddr, uint32_t reqFlags, uint64_t flags) 208 : DtbFault(vaddr, reqFlags, flags) 209 { } 210 FaultName name() const {return _name;} 211 FaultVect vect() {return _vect;} 212 FaultStat & countStat() {return _count;} 213}; 214 215class DtbAlignmentFault : public DtbFault 216{ 217 private: 218 static FaultName _name; 219 static FaultVect _vect; 220 static FaultStat _count;
| 216 public: 217 DtbAcvFault(VAddr vaddr, uint32_t reqFlags, uint64_t flags) 218 : DtbFault(vaddr, reqFlags, flags) 219 { } 220 FaultName name() const {return _name;} 221 FaultVect vect() {return _vect;} 222 FaultStat & countStat() {return _count;} 223}; 224 225class DtbAlignmentFault : public DtbFault 226{ 227 private: 228 static FaultName _name; 229 static FaultVect _vect; 230 static FaultStat _count;
|
| 231
|
221 public: 222 DtbAlignmentFault(VAddr vaddr, uint32_t reqFlags, uint64_t flags) 223 : DtbFault(vaddr, reqFlags, flags) 224 { } 225 FaultName name() const {return _name;} 226 FaultVect vect() {return _vect;} 227 FaultStat & countStat() {return _count;} 228}; 229 230class ItbFault : public AlphaFault 231{ 232 protected: 233 Addr pc;
| 232 public: 233 DtbAlignmentFault(VAddr vaddr, uint32_t reqFlags, uint64_t flags) 234 : DtbFault(vaddr, reqFlags, flags) 235 { } 236 FaultName name() const {return _name;} 237 FaultVect vect() {return _vect;} 238 FaultStat & countStat() {return _count;} 239}; 240 241class ItbFault : public AlphaFault 242{ 243 protected: 244 Addr pc;
|
| 245
|
234 public:
| 246 public:
|
235 ItbFault(Addr _pc) 236 : pc(_pc) 237 { }
| 247 ItbFault(Addr _pc) : pc(_pc) { }
|
238 FaultName name() const = 0; 239 FaultVect vect() = 0; 240 FaultStat & countStat() = 0; 241#if FULL_SYSTEM 242 void invoke(ThreadContext * tc); 243#endif 244}; 245 246class ItbPageFault : public ItbFault 247{ 248 private: 249 static FaultName _name; 250 static FaultVect _vect; 251 static FaultStat _count;
| 248 FaultName name() const = 0; 249 FaultVect vect() = 0; 250 FaultStat & countStat() = 0; 251#if FULL_SYSTEM 252 void invoke(ThreadContext * tc); 253#endif 254}; 255 256class ItbPageFault : public ItbFault 257{ 258 private: 259 static FaultName _name; 260 static FaultVect _vect; 261 static FaultStat _count;
|
| 262
|
252 public:
| 263 public:
|
253 ItbPageFault(Addr pc) 254 : ItbFault(pc) 255 { }
| 264 ItbPageFault(Addr pc) : ItbFault(pc) { }
|
256 FaultName name() const {return _name;} 257 FaultVect vect() {return _vect;} 258 FaultStat & countStat() {return _count;} 259#if !FULL_SYSTEM 260 void invoke(ThreadContext * tc); 261#endif 262}; 263 264class ItbAcvFault : public ItbFault 265{ 266 private: 267 static FaultName _name; 268 static FaultVect _vect; 269 static FaultStat _count;
| 265 FaultName name() const {return _name;} 266 FaultVect vect() {return _vect;} 267 FaultStat & countStat() {return _count;} 268#if !FULL_SYSTEM 269 void invoke(ThreadContext * tc); 270#endif 271}; 272 273class ItbAcvFault : public ItbFault 274{ 275 private: 276 static FaultName _name; 277 static FaultVect _vect; 278 static FaultStat _count;
|
| 279
|
270 public:
| 280 public:
|
271 ItbAcvFault(Addr pc) 272 : ItbFault(pc) 273 { }
| 281 ItbAcvFault(Addr pc) : ItbFault(pc) { }
|
274 FaultName name() const {return _name;} 275 FaultVect vect() {return _vect;} 276 FaultStat & countStat() {return _count;} 277}; 278 279class UnimplementedOpcodeFault : public AlphaFault 280{ 281 private: 282 static FaultName _name; 283 static FaultVect _vect; 284 static FaultStat _count;
| 282 FaultName name() const {return _name;} 283 FaultVect vect() {return _vect;} 284 FaultStat & countStat() {return _count;} 285}; 286 287class UnimplementedOpcodeFault : public AlphaFault 288{ 289 private: 290 static FaultName _name; 291 static FaultVect _vect; 292 static FaultStat _count;
|
| 293
|
285 public: 286 FaultName name() const {return _name;} 287 FaultVect vect() {return _vect;} 288 FaultStat & countStat() {return _count;} 289}; 290 291class FloatEnableFault : public AlphaFault 292{ 293 private: 294 static FaultName _name; 295 static FaultVect _vect; 296 static FaultStat _count;
| 294 public: 295 FaultName name() const {return _name;} 296 FaultVect vect() {return _vect;} 297 FaultStat & countStat() {return _count;} 298}; 299 300class FloatEnableFault : public AlphaFault 301{ 302 private: 303 static FaultName _name; 304 static FaultVect _vect; 305 static FaultStat _count;
|
| 306
|
297 public: 298 FaultName name() const {return _name;} 299 FaultVect vect() {return _vect;} 300 FaultStat & countStat() {return _count;} 301}; 302 303class PalFault : public AlphaFault 304{
| 307 public: 308 FaultName name() const {return _name;} 309 FaultVect vect() {return _vect;} 310 FaultStat & countStat() {return _count;} 311}; 312 313class PalFault : public AlphaFault 314{
|
305 protected: 306 bool skipFaultingInstruction() {return true;}
| |
307 private: 308 static FaultName _name; 309 static FaultVect _vect; 310 static FaultStat _count;
| 315 private: 316 static FaultName _name; 317 static FaultVect _vect; 318 static FaultStat _count;
|
| 319 320 protected: 321 bool skipFaultingInstruction() {return true;} 322
|
311 public: 312 FaultName name() const {return _name;} 313 FaultVect vect() {return _vect;} 314 FaultStat & countStat() {return _count;} 315}; 316 317class IntegerOverflowFault : public AlphaFault 318{ 319 private: 320 static FaultName _name; 321 static FaultVect _vect; 322 static FaultStat _count;
| 323 public: 324 FaultName name() const {return _name;} 325 FaultVect vect() {return _vect;} 326 FaultStat & countStat() {return _count;} 327}; 328 329class IntegerOverflowFault : public AlphaFault 330{ 331 private: 332 static FaultName _name; 333 static FaultVect _vect; 334 static FaultStat _count;
|
| 335
|
323 public: 324 FaultName name() const {return _name;} 325 FaultVect vect() {return _vect;} 326 FaultStat & countStat() {return _count;} 327}; 328
| 336 public: 337 FaultName name() const {return _name;} 338 FaultVect vect() {return _vect;} 339 FaultStat & countStat() {return _count;} 340}; 341
|
329} // AlphaISA namespace
| 342} // namespace AlphaISA
|
330
| 343
|
331#endif // __FAULTS_HH__
| 344#endif // __ARCH_ALPHA_FAULTS_HH__
|
| |