summaryrefslogtreecommitdiff
path: root/cpu/exec_context.hh
diff options
context:
space:
mode:
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); }