gem5: TrapListener implemented

The TrapListener works like in Bochs.
Instead of a number to a trap the offset is returned for GEM5.
See:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0211h/Babfeega.html

Conflicts:
	simulators/gem5/src/cpu/simple/atomic.cc

Change-Id: Ia8b2083e3c16315d9c577150f14f16995494b2e6
This commit is contained in:
Richard Hellwig
2014-01-17 13:13:02 +01:00
committed by Horst Schirmeier
parent fa1690bd1f
commit 5fbf13d07d
7 changed files with 30 additions and 53 deletions

View File

@ -49,6 +49,9 @@
#include "debug/Faults.hh"
#include "sim/full_system.hh"
#include "sal/SALInst.hpp"
#include "config/FailConfig.hpp"
namespace ArmISA
{
@ -95,9 +98,25 @@ ArmFault::getVector(ThreadContext *tc)
}
void
void
ArmFault::invoke(ThreadContext *tc, StaticInstPtr inst)
{
// DanceOS
#ifdef CONFIG_EVENT_TRAP
// GEM5 throws a reset trap during initialization.
// This happens before the startup function is called.
// This leads to problems because the startup function fills the m_CPUs list.
// m_CPUs is needed for the TrapListener.
// Therefore, we only react on traps after initialization.
// e.g. look at gem5/src/arch/arm/faults.cc -> ArmFault::invoke function.
if (fail::simulator.isInitialized()) {
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(tc->cpuId());
// Instead of a number to a trap the offset is returned for GEM5.
// see: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0211h/Babfeega.html
fail::simulator.onTrap(cpu, offset());
}
#endif
// ARM ARM B1.6.3
FaultBase::invoke(tc);
if (!FullSystem)