summaryrefslogtreecommitdiff
path: root/cpu/exec_context.hh
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/exec_context.hh
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/exec_context.hh')
-rw-r--r--cpu/exec_context.hh49
1 files changed, 28 insertions, 21 deletions
diff --git a/cpu/exec_context.hh b/cpu/exec_context.hh
index 9c96b5c42..b7653f121 100644
--- a/cpu/exec_context.hh
+++ b/cpu/exec_context.hh
@@ -42,6 +42,7 @@
class AlphaDTB;
class AlphaITB;
class BaseCPU;
+class Event;
class FunctionalMemory;
class PhysicalMemory;
class Process;
@@ -102,6 +103,8 @@ class ExecContext
virtual Status status() const = 0;
+ virtual void setStatus(Status new_status) = 0;
+
/// Set the status to Active. Optional delay indicates number of
/// cycles to wait before beginning execution.
virtual void activate(int delay = 1) = 0;
@@ -119,13 +122,22 @@ class ExecContext
virtual void dumpFuncProfile() = 0;
#endif
- virtual void takeOverFrom(ExecContext *oldContext) = 0;
+ virtual void takeOverFrom(ExecContext *old_context) = 0;
virtual void regStats(const std::string &name) = 0;
virtual void serialize(std::ostream &os) = 0;
virtual void unserialize(Checkpoint *cp, const std::string &section) = 0;
+#if FULL_SYSTEM
+ virtual Event *getQuiesceEvent() = 0;
+
+ // Not necessarily the best location for these...
+ // Having an extra function just to read these is obnoxious
+ virtual Tick readLastActivate() = 0;
+ virtual Tick readLastSuspend() = 0;
+#endif
+
virtual int getThreadNum() = 0;
virtual bool validInstAddr(Addr addr) = 0;
@@ -139,6 +151,7 @@ class ExecContext
virtual Fault translateDataWriteReq(MemReqPtr &req) = 0;
+ // Also somewhat obnoxious. Really only used for the TLB fault.
virtual TheISA::MachInst getInst() = 0;
virtual void copyArchRegs(ExecContext *xc) = 0;
@@ -180,6 +193,8 @@ class ExecContext
virtual Fault setMiscRegWithEffect(int misc_reg, const MiscReg &val) = 0;
+ // Also not necessarily the best location for these two. Hopefully will go
+ // away once we decide upon where st cond failures goes.
virtual unsigned readStCondFailures() = 0;
virtual void setStCondFailures(unsigned sc_failures) = 0;
@@ -189,20 +204,12 @@ class ExecContext
virtual void setIntrFlag(int val) = 0;
virtual Fault hwrei() = 0;
virtual bool inPalMode() = 0;
- virtual void ev5_trap(Fault fault) = 0;
virtual bool simPalCheck(int palFunc) = 0;
#endif
+ // Only really makes sense for old CPU model. Still could be useful though.
virtual bool misspeculating() = 0;
- /** Meant to be more generic trap function to be
- * called when an instruction faults.
- * @param fault The fault generated by executing the instruction.
- * @todo How to do this properly so it's dependent upon ISA only?
- */
-
- virtual void trap(Fault fault) = 0;
-
#if !FULL_SYSTEM
virtual IntReg getSyscallArg(int i) = 0;
@@ -213,6 +220,7 @@ class ExecContext
virtual void syscall() = 0;
+ // Same with st cond failures.
virtual Counter readFuncExeInst() = 0;
virtual void setFuncExeInst(Counter new_val) = 0;
@@ -253,6 +261,8 @@ class ProxyExecContext : public ExecContext
Status status() const { return actualXC->status(); }
+ void setStatus(Status new_status) { actualXC->setStatus(new_status); }
+
/// Set the status to Active. Optional delay indicates number of
/// cycles to wait before beginning execution.
void activate(int delay = 1) { actualXC->activate(delay); }
@@ -279,6 +289,13 @@ class ProxyExecContext : public ExecContext
void unserialize(Checkpoint *cp, const std::string &section)
{ actualXC->unserialize(cp, section); }
+#if FULL_SYSTEM
+ Event *getQuiesceEvent() { return actualXC->getQuiesceEvent(); }
+
+ Tick readLastActivate() { return actualXC->readLastActivate(); }
+ Tick readLastSuspend() { return actualXC->readLastSuspend(); }
+#endif
+
int getThreadNum() { return actualXC->getThreadNum(); }
bool validInstAddr(Addr addr) { return actualXC->validInstAddr(addr); }
@@ -365,21 +382,11 @@ class ProxyExecContext : public ExecContext
bool inPalMode() { return actualXC->inPalMode(); }
- void ev5_trap(Fault fault) { actualXC->ev5_trap(fault); }
-
bool simPalCheck(int palFunc) { return actualXC->simPalCheck(palFunc); }
#endif
// @todo: Fix this!
- bool misspeculating() { return false; }
-
- /** Meant to be more generic trap function to be
- * called when an instruction faults.
- * @param fault The fault generated by executing the instruction.
- * @todo How to do this properly so it's dependent upon ISA only?
- */
-
- void trap(Fault fault) { actualXC->trap(fault); }
+ bool misspeculating() { return actualXC->misspeculating(); }
#if !FULL_SYSTEM
IntReg getSyscallArg(int i) { return actualXC->getSyscallArg(i); }