From b0b1c0205c438d382aaec54ee4b79b92e1a5e285 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Thu, 11 Jul 2013 21:56:24 -0500 Subject: devices: make more classes derive from BasicPioDevice A couple of devices that have single fixed memory mapped regions were not derived from BasicPioDevice, when that's exactly the functionality that BasicPioDevice provides. This patch gets rid of a little bit of redundant code by making those devices actually do so. Also fixed the weird case of X86ISA::Interrupts, where the class already did derive from BasicPioDevice but didn't actually use all the features it could have. Committed by: Nilay Vaish --- src/dev/pciconfigall.cc | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/dev/pciconfigall.cc') diff --git a/src/dev/pciconfigall.cc b/src/dev/pciconfigall.cc index 4fe3b4641..d5ebb7d57 100644 --- a/src/dev/pciconfigall.cc +++ b/src/dev/pciconfigall.cc @@ -44,9 +44,13 @@ #include "sim/system.hh" PciConfigAll::PciConfigAll(const Params *p) - : PioDevice(p) + : BasicPioDevice(p) { + // the pio_addr Python parameter is ignored, and overridden by + // this caluclated value pioAddr = p->platform->calcPciConfigAddr(params()->bus,0,0); + + pioSize = params()->size; } @@ -73,26 +77,17 @@ PciConfigAll::read(PacketPtr pkt) panic("invalid access size(?) for PCI configspace!\n"); } pkt->makeAtomicResponse(); - return params()->pio_latency; + return pioDelay; } Tick PciConfigAll::write(PacketPtr pkt) { - panic("Attempting to write to config space on non-existant device\n"); + panic("Attempting to write to config space on non-existent device\n"); M5_DUMMY_RETURN } -AddrRangeList -PciConfigAll::getAddrRanges() const -{ - AddrRangeList ranges; - ranges.push_back(RangeSize(pioAddr, params()->size)); - return ranges; -} - - #ifndef DOXYGEN_SHOULD_SKIP_THIS PciConfigAll * -- cgit v1.2.3