faults.cc revision 2255
12623SN/A/* 211147Smitch.hayenga@arm.com * Copyright (c) 2003-2005 The Regents of The University of Michigan 39442SAndreas.Sandberg@ARM.com * All rights reserved. 49442SAndreas.Sandberg@ARM.com * 59442SAndreas.Sandberg@ARM.com * Redistribution and use in source and binary forms, with or without 69442SAndreas.Sandberg@ARM.com * modification, are permitted provided that the following conditions are 79442SAndreas.Sandberg@ARM.com * met: redistributions of source code must retain the above copyright 89442SAndreas.Sandberg@ARM.com * notice, this list of conditions and the following disclaimer; 99442SAndreas.Sandberg@ARM.com * redistributions in binary form must reproduce the above copyright 109442SAndreas.Sandberg@ARM.com * notice, this list of conditions and the following disclaimer in the 119442SAndreas.Sandberg@ARM.com * documentation and/or other materials provided with the distribution; 129442SAndreas.Sandberg@ARM.com * neither the name of the copyright holders nor the names of its 139442SAndreas.Sandberg@ARM.com * contributors may be used to endorse or promote products derived from 142623SN/A * this software without specific prior written permission. 152623SN/A * 162623SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172623SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182623SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192623SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202623SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212623SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222623SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232623SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242623SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252623SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262623SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272623SN/A */ 282623SN/A 292623SN/A#include "sim/faults.hh" 302623SN/A#include "cpu/exec_context.hh" 312623SN/A#include "cpu/base.hh" 322623SN/A 332623SN/A#if !FULL_SYSTEM 342623SN/Avoid FaultBase::invoke(ExecContext * xc) 352623SN/A{ 362623SN/A fatal("fault (%s) detected @ PC 0x%08p", name(), xc->readPC()); 372623SN/A} 382623SN/A#else 392665Ssaidi@eecs.umich.eduvoid FaultBase::invoke(ExecContext * xc) 402665Ssaidi@eecs.umich.edu{ 412623SN/A DPRINTF(Fault, "Fault %s at PC: %#x\n", name(), xc->readPC()); 422623SN/A xc->getCpuPtr()->recordEvent(csprintf("Fault %s", name())); 432623SN/A 442623SN/A assert(!xc->misspeculating()); 452623SN/A} 462623SN/A#endif 4711147Smitch.hayenga@arm.com