gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
thread_context.cc File Reference
#include "cpu/thread_context.hh"
#include "arch/kernel_stats.hh"
#include "base/misc.hh"
#include "base/trace.hh"
#include "config/the_isa.hh"
#include "cpu/base.hh"
#include "cpu/quiesce_event.hh"
#include "debug/Context.hh"
#include "debug/Quiesce.hh"
#include "params/BaseCPU.hh"
#include "sim/full_system.hh"

Go to the source code of this file.

Functions

void serialize (ThreadContext &tc, CheckpointOut &cp)
 Thread context serialization helpers. More...
 
void unserialize (ThreadContext &tc, CheckpointIn &cp)
 
void takeOverFrom (ThreadContext &ntc, ThreadContext &otc)
 Copy state between thread contexts in preparation for CPU handover. More...
 

Function Documentation

void serialize ( ThreadContext tc,
CheckpointOut cp 
)

Thread context serialization helpers.

These helper functions provide a way to the data in a ThreadContext. They are provided as separate helper function since implementing them as members of the ThreadContext interface would be confusing when the ThreadContext is exported via a proxy.

Definition at line 144 of file thread_context.cc.

References arrayParamOut(), ArmISA::i, AlphaISA::NumCCRegs, AlphaISA::NumFloatRegs, AlphaISA::NumIntRegs, ThreadContext::pcState(), ThreadContext::readCCRegFlat(), ThreadContext::readFloatRegBitsFlat(), ThreadContext::readIntRegFlat(), and SERIALIZE_ARRAY.

void takeOverFrom ( ThreadContext new_tc,
ThreadContext old_tc 
)

Copy state between thread contexts in preparation for CPU handover.

Note
This method modifies the old thread contexts as well as the new thread context. The old thread context will have its quiesce event descheduled if it is scheduled and its status set to halted.
Parameters
new_tcDestination ThreadContext.
old_tcSource ThreadContext.

Definition at line 204 of file thread_context.cc.

References ThreadContext::contextId(), ThreadContext::copyArchRegs(), FullSystem, ThreadContext::getCpuPtr(), ThreadContext::getProcessPtr(), ThreadContext::getQuiesceEvent(), ThreadContext::getSystemPtr(), ThreadContext::Halted, ThreadContext::setContextId(), ThreadContext::setStatus(), ThreadContext::setThreadId(), ThreadContext::status(), and ThreadContext::threadId().

Referenced by BaseKvmCPU::takeOverFrom(), O3ThreadContext< class >::takeOverFrom(), MinorCPU::takeOverFrom(), AtomicSimpleCPU::takeOverFrom(), TimingSimpleCPU::takeOverFrom(), and FullO3CPU< Impl >::takeOverFrom().

void unserialize ( ThreadContext tc,
CheckpointIn cp 
)

Generated on Fri Jun 9 2017 13:03:57 for gem5 by doxygen 1.8.6