diff options
author | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2013-04-22 13:20:31 -0400 |
---|---|---|
committer | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2013-04-22 13:20:31 -0400 |
commit | 5f2361f3afb5c8d15e0a5f262a0f8a7942084563 (patch) | |
tree | 7f8fc4f091569baeb0de62e3f081c28534aa6110 /src/cpu | |
parent | e8381142b061fbdf2f22d958f1c7559e9ffb3bd8 (diff) | |
download | gem5-5f2361f3afb5c8d15e0a5f262a0f8a7942084563.tar.xz |
arm: Enable support for triggering a sim panic on kernel panics
Add the options 'panic_on_panic' and 'panic_on_oops' to the
LinuxArmSystem SimObject. When these option are enabled, the simulator
panics when the guest kernel panics or oopses. Enable panic on panic
and panic on oops in ARM-based test cases.
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/pc_event.cc | 12 | ||||
-rw-r--r-- | src/cpu/pc_event.hh | 7 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/cpu/pc_event.cc b/src/cpu/pc_event.cc index c957fe4d5..837b17e34 100644 --- a/src/cpu/pc_event.cc +++ b/src/cpu/pc_event.cc @@ -158,3 +158,15 @@ sched_break_pc(Addr addr) } } + +PanicPCEvent::PanicPCEvent(PCEventQueue *q, const std::string &desc, Addr pc) + : PCEvent(q, desc, pc) +{ +} + +void +PanicPCEvent::process(ThreadContext *tc) +{ + StringWrap name(tc->getCpuPtr()->name() + ".panic_event"); + panic(descr()); +} diff --git a/src/cpu/pc_event.hh b/src/cpu/pc_event.hh index c73fc3c5a..11fce2ca0 100644 --- a/src/cpu/pc_event.hh +++ b/src/cpu/pc_event.hh @@ -146,4 +146,11 @@ void sched_break_pc_sys(System *sys, Addr addr); void sched_break_pc(Addr addr); +class PanicPCEvent : public PCEvent +{ + public: + PanicPCEvent(PCEventQueue *q, const std::string &desc, Addr pc); + virtual void process(ThreadContext *tc); +}; + #endif // __PC_EVENT_HH__ |