From 009970f59b86eac6c9a35eeb175dd9e3a3079d13 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Mon, 7 Jan 2013 13:05:52 -0500 Subject: cpu: Unify the serialization code for all of the CPU models Cleanup the serialization code for the simple CPUs and the O3 CPU. The CPU-specific code has been replaced with a (un)serializeThread that serializes the thread state / context of a specific thread. Assuming that the thread state class uses the CPU-specific thread state uses the base thread state serialization code, this allows us to restore a checkpoint with any of the CPU models. --- src/cpu/o3/cpu.hh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/cpu/o3/cpu.hh') diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh index 24c4b46a8..5dd0e222d 100644 --- a/src/cpu/o3/cpu.hh +++ b/src/cpu/o3/cpu.hh @@ -446,11 +446,10 @@ class FullO3CPU : public BaseO3CPU /** Is the CPU draining? */ bool isDraining() const { return getDrainState() == Drainable::Draining; } - /** Serialize state. */ - virtual void serialize(std::ostream &os); + void serializeThread(std::ostream &os, ThreadID tid); - /** Unserialize from a checkpoint. */ - virtual void unserialize(Checkpoint *cp, const std::string §ion); + void unserializeThread(Checkpoint *cp, const std::string §ion, + ThreadID tid); public: /** Executes a syscall. -- cgit v1.2.3