alpha: Move some initialization logic from loadState into unserialize.

The primary difference between loadState and unserialize, at least when
eventually using the default SimObject implementation of loadState, is that
unserialize is called only if there's a corresponding section in the
checkpoint being restored. In this particular case, the AlphaProcess class
calls the generic Process unserialize function, and that does other critical
initialization like set up the processes page table. If the unserialize
function isn't called, other serious problems would break the simulation
anyway.

This removes the final custom implementation of loadState.

Change-Id: If50062392196bd37efd5ba04fd7aee6907b00dc6
Reviewed-on: https://gem5-review.googlesource.com/4741
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
Gabe Black
2017-09-18 17:53:29 -07:00
parent f1b3b2837d
commit 0658925a8f
2 changed files with 3 additions and 3 deletions

View File

@@ -189,9 +189,9 @@ AlphaProcess::setupASNReg()
void
AlphaProcess::loadState(CheckpointIn &cp)
AlphaProcess::unserialize(CheckpointIn &cp)
{
Process::loadState(cp);
Process::unserialize(cp);
// need to set up ASN after unserialization since _pid value may
// come from checkpoint
setupASNReg();

View File

@@ -43,7 +43,7 @@ class AlphaProcess : public Process
protected:
AlphaProcess(ProcessParams *params, ObjectFile *objFile);
void loadState(CheckpointIn &cp) override;
void unserialize(CheckpointIn &cp) override;
void initState() override;
void argsInit(int intSize, int pageSize);