summaryrefslogtreecommitdiff
path: root/cpu/cpu_exec_context.cc
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2006-03-07 19:59:12 -0500
committerKevin Lim <ktlim@umich.edu>2006-03-07 19:59:12 -0500
commit11aead894d4186916b587b1449075f276319a235 (patch)
tree23929a154420227f082432d2738b190685ab53ed /cpu/cpu_exec_context.cc
parent20eced3ea07f64e50444c00125012d6641416e4b (diff)
downloadgem5-11aead894d4186916b587b1449075f276319a235.tar.xz
Updates for the quiesceEvent that was added to the XC.
Also several files need to include system.hh or symtab.hh. This is because exec_context.hh has less #includes than before, requiring some of the files that include it to include some other files as well. arch/alpha/faults.cc: Avoid accessing XC directly. arch/alpha/stacktrace.cc: StackTrace needs to include system.hh. cpu/cpu_exec_context.cc: Update for change to CPUExecContext. cpu/cpu_exec_context.hh: Make quiesce events use CPUExecContext instead of ExecContext. Include functions to allow the quiesce event and last activate/suspend be accessed. cpu/exec_context.hh: Include functions for quiesceEvent. cpu/intr_control.cc: Needs to include cpu/exec_context.hh. cpu/profile.cc: Needs to include symtab.hh for the symbol table. cpu/profile.hh: Needs forward declare of ExecContext. cpu/simple/cpu.cc: Rename xc to cpuXC. dev/tsunami_cchip.cc: Needs to include exec_context.hh. kern/kernel_stats.cc: Needs to include system.hh. kern/linux/events.cc: Needs to include system.hh. Also avoid accessing objects directly from the XC. kern/tru64/dump_mbuf.cc: Include symtab.hh for the SymbolTable and system.hh. kern/tru64/tru64_events.cc: Include system.hh sim/pseudo_inst.cc: Avoid accessing objects directly within the XC. --HG-- extra : convert_revision : 78fe30d98cd20f7403fa216f772071458b675c84
Diffstat (limited to 'cpu/cpu_exec_context.cc')
-rw-r--r--cpu/cpu_exec_context.cc37
1 files changed, 20 insertions, 17 deletions
diff --git a/cpu/cpu_exec_context.cc b/cpu/cpu_exec_context.cc
index ae428646d..74b609764 100644
--- a/cpu/cpu_exec_context.cc
+++ b/cpu/cpu_exec_context.cc
@@ -57,8 +57,7 @@ CPUExecContext::CPUExecContext(BaseCPU *_cpu, int _thread_num, System *_sys,
: _status(ExecContext::Unallocated), cpu(_cpu), thread_num(_thread_num),
cpu_id(-1), lastActivate(0), lastSuspend(0), mem(_mem), itb(_itb),
dtb(_dtb), system(_sys), memctrl(_sys->memctrl), physmem(_sys->physmem),
- fnbin(kernelBinning->fnbin), profile(NULL), quiesceEvent(this),
- func_exe_inst(0), storeCondFailures(0)
+ profile(NULL), quiesceEvent(this), func_exe_inst(0), storeCondFailures(0)
{
proxy = new ProxyExecContext<CPUExecContext>(this);
@@ -119,21 +118,22 @@ void
CPUExecContext::dumpFuncProfile()
{
std::ostream *os = simout.create(csprintf("profile.%s.dat", cpu->name()));
+ profile->dump(proxy, *os);
}
-ExecContext::EndQuiesceEvent::EndQuiesceEvent(ExecContext *_xc)
- : Event(&mainEventQueue), xc(_xc)
+CPUExecContext::EndQuiesceEvent::EndQuiesceEvent(CPUExecContext *_cpuXC)
+ : Event(&mainEventQueue), cpuXC(_cpuXC)
{
}
void
-ExecContext::EndQuiesceEvent::process()
+CPUExecContext::EndQuiesceEvent::process()
{
- xc->activate();
+ cpuXC->activate();
}
const char*
-ExecContext::EndQuiesceEvent::description()
+CPUExecContext::EndQuiesceEvent::description()
{
return "End Quiesce Event.";
}
@@ -142,25 +142,25 @@ ExecContext::EndQuiesceEvent::description()
void
CPUExecContext::takeOverFrom(ExecContext *oldContext)
{
-/*
// some things should already be set up
- assert(mem == oldContext->mem);
+ assert(mem == oldContext->getMemPtr());
#if FULL_SYSTEM
- assert(system == oldContext->system);
+ assert(system == oldContext->getSystemPtr());
#else
- assert(process == oldContext->process);
+ assert(process == oldContext->getProcessPtr());
#endif
// copy over functional state
- _status = oldContext->_status;
- regs = oldContext->regs;
- cpu_id = oldContext->cpu_id;
- func_exe_inst = oldContext->func_exe_inst;
+ _status = oldContext->status();
+ copyArchRegs(oldContext);
+ cpu_id = oldContext->readCpuId();
+#if !FULL_SYSTEM
+ func_exe_inst = oldContext->readFuncExeInst();
+#endif
storeCondFailures = 0;
- oldContext->_status = CPUExecContext::Unallocated;
-*/
+ oldContext->setStatus(ExecContext::Unallocated);
}
void
@@ -281,6 +281,9 @@ CPUExecContext::copyArchRegs(ExecContext *xc)
setMiscReg(AlphaISA::Lock_Addr_DepTag,
xc->readMiscReg(AlphaISA::Lock_Addr_DepTag));
+ // Also need to copy all the IPRs. Probably should just have a copy misc
+ // regs function defined on the misc regs.
+
// Lastly copy PC/NPC
setPC(xc->readPC());
setNextPC(xc->readNextPC());