From: Andreas Sandberg Date: Mon, 16 Feb 2015 08:34:18 +0000 (-0500) Subject: arm: Wire up the GIC with the platform in the base class X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0a2ee7761617355dd981ce255aa082102d7316b4;p=gem5.git 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. --- 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(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() diff --git a/src/dev/arm/gic_pl390.cc b/src/dev/arm/gic_pl390.cc index 019b3ee8b..e0d75dc6b 100644 --- a/src/dev/arm/gic_pl390.cc +++ b/src/dev/arm/gic_pl390.cc @@ -47,7 +47,6 @@ #include "debug/IPI.hh" #include "debug/Interrupt.hh" #include "dev/arm/gic_pl390.hh" -#include "dev/arm/realview.hh" #include "dev/terminal.hh" #include "mem/packet.hh" #include "mem/packet_access.hh" @@ -102,11 +101,6 @@ Pl390::Pl390(const Params *p) bankedIntPriority[i][j] = 0; } } - - RealView *rv = dynamic_cast(p->platform); - assert(rv); - rv->setGic(this); - } Tick