gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Functions
thread_context.hh File Reference
#include <iostream>
#include <string>
#include "arch/generic/isa.hh"
#include "arch/registers.hh"
#include "arch/types.hh"
#include "base/types.hh"
#include "config/the_isa.hh"
#include "cpu/pc_event.hh"
#include "cpu/reg_class.hh"

Go to the source code of this file.

Classes

class  ThreadContext
 ThreadContext is the external interface to all thread state for anything outside of the CPU. More...
 

Namespaces

 TheISA
 
 Kernel
 

Functions

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

Function Documentation

◆ serialize()

void serialize ( const 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 166 of file thread_context.cc.

References arrayParamOut(), ArmISA::i, AlphaISA::NumCCRegs, AlphaISA::NumFloatRegs, AlphaISA::NumIntRegs, AlphaISA::NumVecPredRegs, AlphaISA::NumVecRegs, ThreadContext::pcState(), ThreadContext::readCCRegFlat(), ThreadContext::readFloatRegFlat(), ThreadContext::readIntRegFlat(), ThreadContext::readVecPredRegFlat(), ThreadContext::readVecRegFlat(), SERIALIZE_ARRAY, and SERIALIZE_CONTAINER.

Referenced by BaseCPU::cacheLineSize(), NSGigE::cpuIntrAck(), ArmISA::EndBitUnion(), ThreadContext::exit(), PhysicalMemory::getBackingStore(), LocalSimLoopExitEvent::getCode(), IdeDisk::getLBABase(), Event::globalEvent(), Globals::Globals(), CPA::hwWe(), Serializable::ScopedCheckpointSection::nameOut(), AlphaISA::TlbEntry::pageStart(), ClockedObject::params(), AnnotateDumpCallback::process(), IdeController::serialize(), VGic::serialize(), GenericISA::UPCState< MachInst >::serialize(), X86ISA::PCState::serialize(), GenericISA::DelaySlotPCState< MachInst >::serialize(), GenericISA::DelaySlotUPCState< MachInst >::serialize(), Serializable::serializeSection(), SparcISA::TlbEntry::updateVaddr(), RiscvISA::PTE::Valid(), MipsISA::PTE::Valid(), PowerISA::PTE::Valid(), SimpleThread::~SimpleThread(), and VirtQueue::~VirtQueue().

◆ takeOverFrom()

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 250 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 ThreadContext::exit(), MemDepUnit< MemDepPred, Impl >::name(), BaseCPU::params(), O3ThreadContext< Impl >::setStatus(), O3ThreadContext< Impl >::takeOverFrom(), SimpleThread::~SimpleThread(), and ThreadContext::~ThreadContext().

◆ unserialize()

void unserialize ( ThreadContext tc,
CheckpointIn cp 
)

Generated on Fri Feb 28 2020 16:27:06 for gem5 by doxygen 1.8.13