summaryrefslogtreecommitdiff
path: root/dev/pcidev.cc
diff options
context:
space:
mode:
authorAndrew Schultz <alschult@umich.edu>2004-06-04 15:12:27 -0400
committerAndrew Schultz <alschult@umich.edu>2004-06-04 15:12:27 -0400
commitd270ea851a92e98d3efe30774f31f935d846dcd3 (patch)
treed98e78985475699374e471dfbd689bb79587732d /dev/pcidev.cc
parent0408051f201cb5b19c4f8d5ec1d6e96de4a9aa3f (diff)
downloadgem5-d270ea851a92e98d3efe30774f31f935d846dcd3.tar.xz
Changes to support serialization with PCI devices
dev/ide_ctrl.cc: Properly serialize/unserialize the PciDev base class to get it to remap the MMU dev/ns_gige.cc: dev/ns_gige.hh: Remove the "addr" paramter from the constructor and change the device to use PCI based MMU mappings only dev/pciconfigall.cc: Change comments dev/pcidev.cc: Properly setup the MMU after a serialize --HG-- extra : convert_revision : 4b2e7ba58e3c24fac1ff6f80635e704d6ecc0eff
Diffstat (limited to 'dev/pcidev.cc')
-rw-r--r--dev/pcidev.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/dev/pcidev.cc b/dev/pcidev.cc
index 8d2828809..67a8cc673 100644
--- a/dev/pcidev.cc
+++ b/dev/pcidev.cc
@@ -256,13 +256,26 @@ PciDev::WriteConfig(int offset, int size, uint32_t data)
void
PciDev::serialize(ostream &os)
{
+ SERIALIZE_ARRAY(BARSize, 6);
+ SERIALIZE_ARRAY(BARAddrs, 6);
SERIALIZE_ARRAY(config.data, 64);
}
void
PciDev::unserialize(Checkpoint *cp, const std::string &section)
{
+ UNSERIALIZE_ARRAY(BARSize, 6);
+ UNSERIALIZE_ARRAY(BARAddrs, 6);
UNSERIALIZE_ARRAY(config.data, 64);
+
+ // Add the MMU mappings for the BARs
+ for (int i=0; i < 6; i++) {
+ if (BARAddrs[i] != 0)
+ mmu->add_child((FunctionalMemory *)this,
+ Range<Addr>(BARAddrs[i],
+ BARAddrs[i] +
+ BARSize[i] - 1));
+ }
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS