summaryrefslogtreecommitdiff
path: root/src/dev/arm/base_gic.cc
diff options
context:
space:
mode:
authorAndreas Sandberg <Andreas.Sandberg@ARM.com>2015-02-16 03:34:18 -0500
committerAndreas Sandberg <Andreas.Sandberg@ARM.com>2015-02-16 03:34:18 -0500
commit0a2ee7761617355dd981ce255aa082102d7316b4 (patch)
tree9245ff7fdcc1f4f5f288b79ff4d50ee65d0f3c40 /src/dev/arm/base_gic.cc
parente17328a227a47089e6f3c8fd82cc988f03807549 (diff)
downloadgem5-0a2ee7761617355dd981ce255aa082102d7316b4.tar.xz
arm: Wire up the GIC with the platform in the base class
Move the (common) GIC initialization code that notifies the platform code of the new GIC to the base class (BaseGic) instead of the Pl390 implementation.
Diffstat (limited to 'src/dev/arm/base_gic.cc')
-rw-r--r--src/dev/arm/base_gic.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/dev/arm/base_gic.cc b/src/dev/arm/base_gic.cc
index 47e211077..ece8352d3 100644
--- a/src/dev/arm/base_gic.cc
+++ b/src/dev/arm/base_gic.cc
@@ -39,12 +39,21 @@
#include "dev/arm/base_gic.hh"
+#include "dev/arm/realview.hh"
#include "params/BaseGic.hh"
BaseGic::BaseGic(const Params *p)
: PioDevice(p),
platform(p->platform)
{
+ RealView *const rv(dynamic_cast<RealView*>(p->platform));
+ // The platform keeps track of the GIC that is hooked up to the
+ // system. Due to quirks in gem5's configuration system, the
+ // platform can't take a GIC as parameter. Instead, we need to
+ // register with the platform when a new GIC is created. If we
+ // can't find a platform, something is seriously wrong.
+ fatal_if(!rv, "GIC model can't register with platform code");
+ rv->setGic(this);
}
BaseGic::~BaseGic()