faults.hh revision 7811
11689SN/A/* 22329SN/A * Copyright (c) 2003-2005 The Regents of The University of Michigan 31689SN/A * Copyright (c) 2009 The University of Edinburgh 41689SN/A * All rights reserved. 51689SN/A * 61689SN/A * Redistribution and use in source and binary forms, with or without 71689SN/A * modification, are permitted provided that the following conditions are 81689SN/A * met: redistributions of source code must retain the above copyright 91689SN/A * notice, this list of conditions and the following disclaimer; 101689SN/A * redistributions in binary form must reproduce the above copyright 111689SN/A * notice, this list of conditions and the following disclaimer in the 121689SN/A * documentation and/or other materials provided with the distribution; 131689SN/A * neither the name of the copyright holders nor the names of its 141689SN/A * contributors may be used to endorse or promote products derived from 151689SN/A * this software without specific prior written permission. 161689SN/A * 171689SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 181689SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 191689SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 201689SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 211689SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 221689SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 231689SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 241689SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 251689SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 261689SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 272665Ssaidi@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 282665Ssaidi@eecs.umich.edu * 291689SN/A * Authors: Gabe Black 301689SN/A * Timothy M. Jones 312292SN/A */ 322292SN/A 331060SN/A#ifndef __ARCH_POWER_FAULTS_HH__ 341061SN/A#define __ARCH_POWER_FAULTS_HH__ 351684SN/A 367720Sgblack@eecs.umich.edu#include "sim/faults.hh" 376216Snate@binkert.org 386216Snate@binkert.orgnamespace PowerISA 392980Sgblack@eecs.umich.edu{ 401060SN/A 412292SN/Aclass PowerFault : public FaultBase 422292SN/A{ 432292SN/A protected: 441060SN/A FaultName _name; 451060SN/A 462348SN/A PowerFault(FaultName name) 471060SN/A : _name(name) 482292SN/A { 492292SN/A } 502292SN/A 512292SN/A FaultName 522292SN/A name() const 532292SN/A { 542292SN/A return _name; 552292SN/A } 562292SN/A}; 572292SN/A 582292SN/A 592348SN/Aclass UnimplementedOpcodeFault : public PowerFault 602292SN/A{ 612292SN/A public: 621061SN/A UnimplementedOpcodeFault() 631061SN/A : PowerFault("Unimplemented Opcode") 641061SN/A { 651061SN/A } 661461SN/A}; 671060SN/A 681060SN/A 692348SN/Aclass MachineCheckFault : public PowerFault 701060SN/A{ 712292SN/A public: 721061SN/A MachineCheckFault() 731061SN/A : PowerFault("Machine Check") 741061SN/A { 751061SN/A } 761461SN/A}; 771060SN/A 781060SN/A 792348SN/Aclass AlignmentFault : public PowerFault 801060SN/A{ 812292SN/A public: 821061SN/A AlignmentFault() 831061SN/A : PowerFault("Alignment") 841061SN/A { 851061SN/A } 861461SN/A 871062SN/A bool 882292SN/A isAlignmentFault() const 892292SN/A { 907851SMatt.Horsnell@arm.com return true; 912292SN/A } 924636Sgblack@eecs.umich.edu}; 937720Sgblack@eecs.umich.edu 942292SN/A 952292SN/Astatic inline Fault 962292SN/AgenMachineCheckFault() 971060SN/A{ 981060SN/A return new MachineCheckFault(); 991060SN/A} 1001060SN/A 1011061SN/A} // namespace PowerISA 1021061SN/A 1031061SN/A#endif // __ARCH_POWER_FAULTS_HH__ 1041061SN/A