O3ThreadState(O3CPU *_cpu, int _thread_num, Process *_process)
: ThreadState(_cpu, _thread_num, _process),
- cpu(_cpu), noSquashFromTC(false), trapPending(false)
+ cpu(_cpu), noSquashFromTC(false), trapPending(false),
+ tc(nullptr)
{
if (!FullSystem)
return;
profilePC = 3;
}
- void serialize(std::ostream &os)
+ void serialize(CheckpointOut &cp) const override
{
- ThreadState::serialize(os);
+ ThreadState::serialize(cp);
// Use the ThreadContext serialization helper to serialize the
// TC.
- ::serialize(*tc, os);
+ ::serialize(*tc, cp);
}
- void unserialize(Checkpoint *cp, const std::string §ion)
+ void unserialize(CheckpointIn &cp) override
{
// Prevent squashing - we don't have any instructions in
// flight that we need to squash since we just instantiated a
// clean system.
noSquashFromTC = true;
- ThreadState::unserialize(cp, section);
+ ThreadState::unserialize(cp);
// Use the ThreadContext serialization helper to unserialize
// the TC.
- ::unserialize(*tc, cp, section);
+ ::unserialize(*tc, cp);
noSquashFromTC = false;
}
ThreadContext *getTC() { return tc; }
/** Handles the syscall. */
- void syscall(int64_t callnum) { process->syscall(callnum, tc); }
+ void syscall(int64_t callnum, Fault *fault)
+ {
+ process->syscall(callnum, tc, fault);
+ }
void dumpFuncProfile()
{
- std::ostream *os = simout.create(csprintf("profile.%s.dat", cpu->name()));
- profile->dump(tc, *os);
+ OutputStream *os(
+ simout.create(csprintf("profile.%s.dat", cpu->name())));
+ profile->dump(tc, *os->stream());
+ simout.close(os);
}
};