From d270ea851a92e98d3efe30774f31f935d846dcd3 Mon Sep 17 00:00:00 2001 From: Andrew Schultz Date: Fri, 4 Jun 2004 15:12:27 -0400 Subject: 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 --- dev/pcidev.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'dev/pcidev.cc') 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 §ion) { + 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(BARAddrs[i], + BARAddrs[i] + + BARSize[i] - 1)); + } } #ifndef DOXYGEN_SHOULD_SKIP_THIS -- cgit v1.2.3