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