diff options
Diffstat (limited to 'src/dev/sparc')
-rw-r--r-- | src/dev/sparc/dtod.cc | 4 | ||||
-rw-r--r-- | src/dev/sparc/dtod.hh | 16 | ||||
-rw-r--r-- | src/dev/sparc/iob.cc | 34 | ||||
-rw-r--r-- | src/dev/sparc/iob.hh | 5 | ||||
-rw-r--r-- | src/dev/sparc/mm_disk.cc | 2 | ||||
-rw-r--r-- | src/dev/sparc/mm_disk.hh | 2 |
6 files changed, 26 insertions, 37 deletions
diff --git a/src/dev/sparc/dtod.cc b/src/dev/sparc/dtod.cc index 3853abb16..5b74bbcb7 100644 --- a/src/dev/sparc/dtod.cc +++ b/src/dev/sparc/dtod.cc @@ -79,13 +79,13 @@ DumbTOD::write(PacketPtr pkt) } void -DumbTOD::serialize(std::ostream &os) +DumbTOD::serialize(CheckpointOut &cp) const { SERIALIZE_SCALAR(todTime); } void -DumbTOD::unserialize(Checkpoint *cp, const std::string §ion) +DumbTOD::unserialize(CheckpointIn &cp) { UNSERIALIZE_SCALAR(todTime); } diff --git a/src/dev/sparc/dtod.hh b/src/dev/sparc/dtod.hh index a5b2dfaff..a7b451364 100644 --- a/src/dev/sparc/dtod.hh +++ b/src/dev/sparc/dtod.hh @@ -63,20 +63,8 @@ class DumbTOD : public BasicPioDevice virtual Tick read(PacketPtr pkt); virtual Tick write(PacketPtr pkt); - /** - * Serialize this object to the given output stream. - * @param os The stream to serialize to. - */ - virtual void serialize(std::ostream &os); - - /** - * Reconstruct the state of this object from a checkpoint. - * @param cp The checkpoint use. - * @param section The section name of this object - */ - virtual void unserialize(Checkpoint *cp, const std::string §ion); - - + void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE; + void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE; }; #endif // __DEV_BADDEV_HH__ diff --git a/src/dev/sparc/iob.cc b/src/dev/sparc/iob.cc index c71edd9f0..bee0323c8 100644 --- a/src/dev/sparc/iob.cc +++ b/src/dev/sparc/iob.cc @@ -334,41 +334,43 @@ Iob::getAddrRanges() const void -Iob::serialize(std::ostream &os) +Iob::serialize(CheckpointOut &cp) const { SERIALIZE_SCALAR(jIntVec); SERIALIZE_ARRAY(jBusData0, MaxNiagaraProcs); SERIALIZE_ARRAY(jBusData1, MaxNiagaraProcs); for (int x = 0; x < NumDeviceIds; x++) { - nameOut(os, csprintf("%s.Int%d", name(), x)); - paramOut(os, "cpu", intMan[x].cpu); - paramOut(os, "vector", intMan[x].vector); - paramOut(os, "mask", intCtl[x].mask); - paramOut(os, "pend", intCtl[x].pend); + ScopedCheckpointSection sec(cp, csprintf("Int%d", x)); + paramOut(cp, "cpu", intMan[x].cpu); + paramOut(cp, "vector", intMan[x].vector); + paramOut(cp, "mask", intCtl[x].mask); + paramOut(cp, "pend", intCtl[x].pend); }; for (int x = 0; x < MaxNiagaraProcs; x++) { - nameOut(os, csprintf("%s.jIntBusy%d", name(), x)); - paramOut(os, "busy", jIntBusy[x].busy); - paramOut(os, "source", jIntBusy[x].source); + ScopedCheckpointSection sec(cp, csprintf("jIntBusy%d", x)); + paramOut(cp, "busy", jIntBusy[x].busy); + paramOut(cp, "source", jIntBusy[x].source); }; } void -Iob::unserialize(Checkpoint *cp, const std::string §ion) +Iob::unserialize(CheckpointIn &cp) { UNSERIALIZE_SCALAR(jIntVec); UNSERIALIZE_ARRAY(jBusData0, MaxNiagaraProcs); UNSERIALIZE_ARRAY(jBusData1, MaxNiagaraProcs); for (int x = 0; x < NumDeviceIds; x++) { - paramIn(cp, csprintf("%s.Int%d", name(), x), "cpu", intMan[x].cpu); - paramIn(cp, csprintf("%s.Int%d", name(), x), "vector", intMan[x].vector); - paramIn(cp, csprintf("%s.Int%d", name(), x), "mask", intCtl[x].mask); - paramIn(cp, csprintf("%s.Int%d", name(), x), "pend", intCtl[x].pend); + ScopedCheckpointSection sec(cp, csprintf("Int%d", x)); + paramIn(cp, "cpu", intMan[x].cpu); + paramIn(cp, "vector", intMan[x].vector); + paramIn(cp, "mask", intCtl[x].mask); + paramIn(cp, "pend", intCtl[x].pend); }; for (int x = 0; x < MaxNiagaraProcs; x++) { - paramIn(cp, csprintf("%s.jIntBusy%d", name(), x), "busy", jIntBusy[x].busy); - paramIn(cp, csprintf("%s.jIntBusy%d", name(), x), "source", jIntBusy[x].source); + ScopedCheckpointSection sec(cp, csprintf("jIntBusy%d", x)); + paramIn(cp, "busy", jIntBusy[x].busy); + paramIn(cp, "source", jIntBusy[x].source); }; } diff --git a/src/dev/sparc/iob.hh b/src/dev/sparc/iob.hh index fc5e61092..033ee3867 100644 --- a/src/dev/sparc/iob.hh +++ b/src/dev/sparc/iob.hh @@ -142,9 +142,8 @@ class Iob : public PioDevice AddrRangeList getAddrRanges() const; - virtual void serialize(std::ostream &os); - virtual void unserialize(Checkpoint *cp, const std::string §ion); - + void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE; + void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE; }; #endif //__DEV_SPARC_IOB_HH__ diff --git a/src/dev/sparc/mm_disk.cc b/src/dev/sparc/mm_disk.cc index 0a6d14445..5fe9157bc 100644 --- a/src/dev/sparc/mm_disk.cc +++ b/src/dev/sparc/mm_disk.cc @@ -170,7 +170,7 @@ MmDisk::write(PacketPtr pkt) } void -MmDisk::serialize(std::ostream &os) +MmDisk::serialize(CheckpointOut &cp) const { // just write any dirty changes to the cow layer it will take care of // serialization diff --git a/src/dev/sparc/mm_disk.hh b/src/dev/sparc/mm_disk.hh index d14e1d4a4..2de3cac7d 100644 --- a/src/dev/sparc/mm_disk.hh +++ b/src/dev/sparc/mm_disk.hh @@ -61,7 +61,7 @@ class MmDisk : public BasicPioDevice virtual Tick read(PacketPtr pkt); virtual Tick write(PacketPtr pkt); - virtual void serialize(std::ostream &os); + void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE; }; #endif //__DEV_SPARC_MM_DISK_HH__ |