summaryrefslogtreecommitdiff
path: root/src/dev/arm/generic_timer.cc
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2016-10-07 14:14:44 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2016-10-07 14:14:44 +0100
commit8c5df4be2ed1b8e27815a641390826154b90debf (patch)
tree67496d4f4e4c0ca1eaf48c5b87275de154d3b051 /src/dev/arm/generic_timer.cc
parent22e6f65d7230e90f0a8032567f8c313d0e83a30c (diff)
downloadgem5-8c5df4be2ed1b8e27815a641390826154b90debf.tar.xz
dev, arm: Make GenericTimer param handling more robust
The generic timer needs a pointer to an ArmSystem to wire itself to the system register handler. This was previously specified as an instance of System that was later cast to ArmSystem. Make this more robust by specifying it as an ArmSystem in the Python interface and add a check to make sure that it is non-NULL. Change-Id: I989455e666f4ea324df28124edbbadfd094b0d02 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/dev/arm/generic_timer.cc')
-rw-r--r--src/dev/arm/generic_timer.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dev/arm/generic_timer.cc b/src/dev/arm/generic_timer.cc
index 173855b88..1b8d917e9 100644
--- a/src/dev/arm/generic_timer.cc
+++ b/src/dev/arm/generic_timer.cc
@@ -234,7 +234,8 @@ GenericTimer::GenericTimer(GenericTimerParams *p)
irqPhys(p->int_phys),
irqVirt(p->int_virt)
{
- dynamic_cast<ArmSystem &>(*p->system).setGenericTimer(this);
+ fatal_if(!p->system, "No system specified, can't instantiate timer.\n");
+ p->system->setGenericTimer(this);
}
void