changeset aaa0f985da8e in /z/repo/gem5 details: http://repo.gem5.org/gem5?cmd=changeset;node=aaa0f985da8e description: 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: src/dev/arm/base_gic.cc | 9 +++++++++ src/dev/arm/gic_pl390.cc | 6 ------ 2 files changed, 9 insertions(+), 6 deletions(-) diffs (48 lines): diff -r 417ba77dedb4 -r aaa0f985da8e src/dev/arm/base_gic.cc --- a/src/dev/arm/base_gic.cc Mon Feb 16 03:33:47 2015 -0500 +++ b/src/dev/arm/base_gic.cc Mon Feb 16 03:34:18 2015 -0500 @@ -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() diff -r 417ba77dedb4 -r aaa0f985da8e src/dev/arm/gic_pl390.cc --- a/src/dev/arm/gic_pl390.cc Mon Feb 16 03:33:47 2015 -0500 +++ b/src/dev/arm/gic_pl390.cc Mon Feb 16 03:34:18 2015 -0500 @@ -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 @@ bankedIntPriority[i][j] = 0; } } - - RealView *rv = dynamic_cast<RealView*>(p->platform); - assert(rv); - rv->setGic(this); - } Tick _______________________________________________ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev