faults.hh revision 2221
12SN/A/* 21762SN/A * Copyright (c) 2003-2005 The Regents of The University of Michigan 32SN/A * All rights reserved. 42SN/A * 52SN/A * Redistribution and use in source and binary forms, with or without 62SN/A * modification, are permitted provided that the following conditions are 72SN/A * met: redistributions of source code must retain the above copyright 82SN/A * notice, this list of conditions and the following disclaimer; 92SN/A * redistributions in binary form must reproduce the above copyright 102SN/A * notice, this list of conditions and the following disclaimer in the 112SN/A * documentation and/or other materials provided with the distribution; 122SN/A * neither the name of the copyright holders nor the names of its 132SN/A * contributors may be used to endorse or promote products derived from 142SN/A * this software without specific prior written permission. 152SN/A * 162SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu */ 282665Ssaidi@eecs.umich.edu 292665Ssaidi@eecs.umich.edu#ifndef __ALPHA_FAULTS_HH__ 302665Ssaidi@eecs.umich.edu#define __ALPHA_FAULTS_HH__ 312665Ssaidi@eecs.umich.edu 322SN/A#include "sim/faults.hh" 332SN/A 342SN/A// The design of the "name" and "vect" functions is in sim/faults.hh 352SN/A 367349SAli.Saidi@ARM.comnamespace AlphaISA 377680Sgblack@eecs.umich.edu{ 3856SN/A 398229Snate@binkert.orgtypedef const Addr FaultVect; 401717SN/A 412518SN/Aclass AlphaFault : public virtual FaultBase 4256SN/A{ 434776Sgblack@eecs.umich.edu protected: 448232Snate@binkert.org virtual bool skipFaultingInstruction() {return false;} 454762Snate@binkert.org virtual bool setRestartAddress() {return true;} 463065Sgblack@eecs.umich.edu public: 472SN/A#if FULL_SYSTEM 482973Sgblack@eecs.umich.edu void invoke(ExecContext * xc); 492SN/A#endif 503506Ssaidi@eecs.umich.edu virtual FaultVect vect() = 0; 514054Sbinkertn@umich.edu}; 524054Sbinkertn@umich.edu 535866Sksewell@umich.educlass MachineCheckFault : public AlphaFault 545866Sksewell@umich.edu{ 555866Sksewell@umich.edu private: 565866Sksewell@umich.edu static FaultName _name; 575866Sksewell@umich.edu static FaultVect _vect; 585866Sksewell@umich.edu static FaultStat _stat; 5910417Sandreas.hansson@arm.com public: 604054Sbinkertn@umich.edu FaultName name() {return _name;} 614776Sgblack@eecs.umich.edu FaultVect vect() {return _vect;} 624054Sbinkertn@umich.edu FaultStat & stat() {return _stat;} 638300Schander.sudanthi@arm.com bool isMachineCheckFault() {return true;} 648300Schander.sudanthi@arm.com}; 658300Schander.sudanthi@arm.com 668300Schander.sudanthi@arm.comclass AlignmentFault : public AlphaFault 678300Schander.sudanthi@arm.com{ 688300Schander.sudanthi@arm.com private: 698232Snate@binkert.org static FaultName _name; 705866Sksewell@umich.edu static FaultVect _vect; 714054Sbinkertn@umich.edu static FaultStat _stat; 724776Sgblack@eecs.umich.edu public: 734054Sbinkertn@umich.edu FaultName name() {return _name;} 748300Schander.sudanthi@arm.com FaultVect vect() {return _vect;} 758300Schander.sudanthi@arm.com FaultStat & stat() {return _stat;} 768300Schander.sudanthi@arm.com bool isAlignmentFault() {return true;} 778232Snate@binkert.org}; 785715Shsul@eecs.umich.edu 794776Sgblack@eecs.umich.edustatic inline Fault genMachineCheckFault() 804776Sgblack@eecs.umich.edu{ 814776Sgblack@eecs.umich.edu return new MachineCheckFault; 827720Sgblack@eecs.umich.edu} 839809Sumesh.b2006@gmail.com 849809Sumesh.b2006@gmail.comstatic inline Fault genAlignmentFault() 859809Sumesh.b2006@gmail.com{ 867349SAli.Saidi@ARM.com return new AlignmentFault; 877349SAli.Saidi@ARM.com} 885784Sgblack@eecs.umich.edu 897720Sgblack@eecs.umich.educlass ResetFault : public AlphaFault 907349SAli.Saidi@ARM.com{ 914776Sgblack@eecs.umich.edu private: 924776Sgblack@eecs.umich.edu static FaultName _name; 935784Sgblack@eecs.umich.edu static FaultVect _vect; 947720Sgblack@eecs.umich.edu static FaultStat _stat; 955784Sgblack@eecs.umich.edu public: 965784Sgblack@eecs.umich.edu FaultName name() {return _name;} 975784Sgblack@eecs.umich.edu FaultVect vect() {return _vect;} 985784Sgblack@eecs.umich.edu FaultStat & stat() {return _stat;} 995784Sgblack@eecs.umich.edu}; 1005784Sgblack@eecs.umich.edu 1014776Sgblack@eecs.umich.educlass ArithmeticFault : public AlphaFault 1024776Sgblack@eecs.umich.edu{ 1034776Sgblack@eecs.umich.edu protected: 1044776Sgblack@eecs.umich.edu bool skipFaultingInstruction() {return true;} 1054776Sgblack@eecs.umich.edu private: 1067349SAli.Saidi@ARM.com static FaultName _name; 1074776Sgblack@eecs.umich.edu static FaultVect _vect; 1085784Sgblack@eecs.umich.edu static FaultStat _stat; 1095784Sgblack@eecs.umich.edu public: 1105784Sgblack@eecs.umich.edu FaultName name() {return _name;} 1118232Snate@binkert.org FaultVect vect() {return _vect;} 1125784Sgblack@eecs.umich.edu FaultStat & stat() {return _stat;} 1135784Sgblack@eecs.umich.edu#if FULL_SYSTEM 1145784Sgblack@eecs.umich.edu void invoke(ExecContext * xc); 11510231Ssteve.reinhardt@amd.com#endif 1167600Sminkyu.jeong@arm.com}; 1177600Sminkyu.jeong@arm.com 1187600Sminkyu.jeong@arm.comclass InterruptFault : public AlphaFault 1198232Snate@binkert.org{ 1205784Sgblack@eecs.umich.edu protected: 1215784Sgblack@eecs.umich.edu bool setRestartAddress() {return false;} 1225784Sgblack@eecs.umich.edu private: 12310665SAli.Saidi@ARM.com static FaultName _name; 1245784Sgblack@eecs.umich.edu static FaultVect _vect; 1255784Sgblack@eecs.umich.edu static FaultStat _stat; 1268232Snate@binkert.org public: 1275784Sgblack@eecs.umich.edu FaultName name() {return _name;} 1285784Sgblack@eecs.umich.edu FaultVect vect() {return _vect;} 1298232Snate@binkert.org FaultStat & stat() {return _stat;} 1305784Sgblack@eecs.umich.edu}; 13110383Smitch.hayenga@arm.com 13210383Smitch.hayenga@arm.comclass NDtbMissFault : public AlphaFault 13310383Smitch.hayenga@arm.com{ 13410383Smitch.hayenga@arm.com private: 13510383Smitch.hayenga@arm.com static FaultName _name; 13610383Smitch.hayenga@arm.com static FaultVect _vect; 1374776Sgblack@eecs.umich.edu static FaultStat _stat; 1384776Sgblack@eecs.umich.edu public: 1394776Sgblack@eecs.umich.edu FaultName name() {return _name;} 1404776Sgblack@eecs.umich.edu FaultVect vect() {return _vect;} 1414776Sgblack@eecs.umich.edu FaultStat & stat() {return _stat;} 1424776Sgblack@eecs.umich.edu}; 1433506Ssaidi@eecs.umich.edu 1443506Ssaidi@eecs.umich.educlass PDtbMissFault : public AlphaFault 1455784Sgblack@eecs.umich.edu{ 1465784Sgblack@eecs.umich.edu private: 1475784Sgblack@eecs.umich.edu static FaultName _name; 1485784Sgblack@eecs.umich.edu static FaultVect _vect; 1495784Sgblack@eecs.umich.edu static FaultStat _stat; 1505784Sgblack@eecs.umich.edu public: 1515784Sgblack@eecs.umich.edu FaultName name() {return _name;} 1525784Sgblack@eecs.umich.edu FaultVect vect() {return _vect;} 1535784Sgblack@eecs.umich.edu FaultStat & stat() {return _stat;} 1545784Sgblack@eecs.umich.edu}; 1555784Sgblack@eecs.umich.edu 1568232Snate@binkert.orgclass DtbPageFault : public AlphaFault 1578232Snate@binkert.org{ 1588232Snate@binkert.org private: 1598232Snate@binkert.org static FaultName _name; 1605791Srstrong@cs.ucsd.edu static FaultVect _vect; 1615784Sgblack@eecs.umich.edu static FaultStat _stat; 1625784Sgblack@eecs.umich.edu public: 1638232Snate@binkert.org FaultName name() {return _name;} 1645784Sgblack@eecs.umich.edu FaultVect vect() {return _vect;} 1655784Sgblack@eecs.umich.edu FaultStat & stat() {return _stat;} 1665784Sgblack@eecs.umich.edu}; 1675784Sgblack@eecs.umich.edu 1687811Ssteve.reinhardt@amd.comclass DtbAcvFault : public AlphaFault 1694776Sgblack@eecs.umich.edu{ 1702SN/A private: 1712SN/A static FaultName _name; 1724776Sgblack@eecs.umich.edu static FaultVect _vect; 1732SN/A static FaultStat _stat; 1744776Sgblack@eecs.umich.edu public: 1754776Sgblack@eecs.umich.edu FaultName name() {return _name;} 1763748Sgblack@eecs.umich.edu FaultVect vect() {return _vect;} 1775034Smilesck@eecs.umich.edu FaultStat & stat() {return _stat;} 1788902Sandreas.hansson@arm.com}; 179 180class ItbMissFault : public AlphaFault 181{ 182 private: 183 static FaultName _name; 184 static FaultVect _vect; 185 static FaultStat _stat; 186 public: 187 FaultName name() {return _name;} 188 FaultVect vect() {return _vect;} 189 FaultStat & stat() {return _stat;} 190}; 191 192class ItbPageFault : public AlphaFault 193{ 194 private: 195 static FaultName _name; 196 static FaultVect _vect; 197 static FaultStat _stat; 198 public: 199 FaultName name() {return _name;} 200 FaultVect vect() {return _vect;} 201 FaultStat & stat() {return _stat;} 202}; 203 204class ItbAcvFault : public AlphaFault 205{ 206 private: 207 static FaultName _name; 208 static FaultVect _vect; 209 static FaultStat _stat; 210 public: 211 FaultName name() {return _name;} 212 FaultVect vect() {return _vect;} 213 FaultStat & stat() {return _stat;} 214}; 215 216class UnimplementedOpcodeFault : public AlphaFault 217{ 218 private: 219 static FaultName _name; 220 static FaultVect _vect; 221 static FaultStat _stat; 222 public: 223 FaultName name() {return _name;} 224 FaultVect vect() {return _vect;} 225 FaultStat & stat() {return _stat;} 226}; 227 228class FloatEnableFault : public AlphaFault 229{ 230 private: 231 static FaultName _name; 232 static FaultVect _vect; 233 static FaultStat _stat; 234 public: 235 FaultName name() {return _name;} 236 FaultVect vect() {return _vect;} 237 FaultStat & stat() {return _stat;} 238}; 239 240class PalFault : public AlphaFault 241{ 242 protected: 243 bool skipFaultingInstruction() {return true;} 244 private: 245 static FaultName _name; 246 static FaultVect _vect; 247 static FaultStat _stat; 248 public: 249 FaultName name() {return _name;} 250 FaultVect vect() {return _vect;} 251 FaultStat & stat() {return _stat;} 252}; 253 254class IntegerOverflowFault : public AlphaFault 255{ 256 private: 257 static FaultName _name; 258 static FaultVect _vect; 259 static FaultStat _stat; 260 public: 261 FaultName name() {return _name;} 262 FaultVect vect() {return _vect;} 263 FaultStat & stat() {return _stat;} 264}; 265 266} // AlphaISA namespace 267 268#endif // __FAULTS_HH__ 269