faults.cc (2665:a124942bacb8) faults.cc (2680:246e7104f744)
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;

--- 17 unchanged lines hidden (view full) ---

26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Nathan Binkert
29 * Gabe Black
30 */
31
32#include "base/misc.hh"
33#include "sim/faults.hh"
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;

--- 17 unchanged lines hidden (view full) ---

26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Nathan Binkert
29 * Gabe Black
30 */
31
32#include "base/misc.hh"
33#include "sim/faults.hh"
34#include "cpu/exec_context.hh"
34#include "cpu/thread_context.hh"
35#include "cpu/base.hh"
36
37#if !FULL_SYSTEM
35#include "cpu/base.hh"
36
37#if !FULL_SYSTEM
38void FaultBase::invoke(ExecContext * xc)
38void FaultBase::invoke(ThreadContext * tc)
39{
39{
40 fatal("fault (%s) detected @ PC 0x%08p", name(), xc->readPC());
40 fatal("fault (%s) detected @ PC 0x%08p", name(), tc->readPC());
41}
42#else
41}
42#else
43void FaultBase::invoke(ExecContext * xc)
43void FaultBase::invoke(ThreadContext * tc)
44{
44{
45 DPRINTF(Fault, "Fault %s at PC: %#x\n", name(), xc->readPC());
46 xc->getCpuPtr()->recordEvent(csprintf("Fault %s", name()));
45 DPRINTF(Fault, "Fault %s at PC: %#x\n", name(), tc->readPC());
46 tc->getCpuPtr()->recordEvent(csprintf("Fault %s", name()));
47
47
48 assert(!xc->misspeculating());
48 assert(!tc->misspeculating());
49}
50#endif
51
49}
50#endif
51
52void UnimpFault::invoke(ExecContext * xc)
52void UnimpFault::invoke(ThreadContext * tc)
53{
54 panic("Unimpfault: %s\n", panicStr.c_str());
55}
53{
54 panic("Unimpfault: %s\n", panicStr.c_str());
55}