summaryrefslogtreecommitdiff
path: root/cpu/exec_context.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2003-10-23 19:09:18 -0700
committerSteve Reinhardt <stever@eecs.umich.edu>2003-10-23 19:09:18 -0700
commitcc9a838f4c5a5bf5e8951bdb351fc7d4b74661fb (patch)
tree1bae8b1b09fcc39d04631c84beaf51f830938372 /cpu/exec_context.hh
parent320540829d62f9c5a5290a8c9bd991fda297a210 (diff)
parent6e2fc8ce766d1f9cb601b4a2a15d1ba294ce97a5 (diff)
downloadgem5-cc9a838f4c5a5bf5e8951bdb351fc7d4b74661fb.tar.xz
Merge stever@zizzer:/bk/m5 into isabel.reinhardt.house:/z/stever/bk/m5
--HG-- extra : convert_revision : b0f93bd35d767fd3a520a9fed70a71d40b0056db
Diffstat (limited to 'cpu/exec_context.hh')
-rw-r--r--cpu/exec_context.hh20
1 files changed, 14 insertions, 6 deletions
diff --git a/cpu/exec_context.hh b/cpu/exec_context.hh
index bd7f6fad9..5c6e84cee 100644
--- a/cpu/exec_context.hh
+++ b/cpu/exec_context.hh
@@ -67,6 +67,11 @@ class ExecContext
public:
Status status() const { return _status; }
+
+ // Unlike setStatus(), initStatus() has no side effects other than
+ // setting the _status variable.
+ void initStatus(Status init_status) { _status = init_status; }
+
void setStatus(Status new_status);
#ifdef FULL_SYSTEM
@@ -83,12 +88,15 @@ class ExecContext
// Index of hardware thread context on the CPU that this represents.
int thread_num;
+ // ID of this context w.r.t. the System or Process object to which
+ // it belongs. For full-system mode, this is the system CPU ID.
+ int cpu_id;
+
#ifdef FULL_SYSTEM
FunctionalMemory *mem;
AlphaItb *itb;
AlphaDtb *dtb;
- int cpu_id;
System *system;
// the following two fields are redundant, since we can always
@@ -124,8 +132,7 @@ class ExecContext
// constructor: initialize context from given process structure
#ifdef FULL_SYSTEM
ExecContext(BaseCPU *_cpu, int _thread_num, System *_system,
- AlphaItb *_itb, AlphaDtb *_dtb, FunctionalMemory *_dem,
- int _cpu_id);
+ AlphaItb *_itb, AlphaDtb *_dtb, FunctionalMemory *_dem);
#else
ExecContext(BaseCPU *_cpu, int _thread_num, Process *_process, int _asid);
ExecContext(BaseCPU *_cpu, int _thread_num, FunctionalMemory *_mem,
@@ -133,6 +140,8 @@ class ExecContext
#endif
virtual ~ExecContext() {}
+ virtual void takeOverFrom(ExecContext *oldContext);
+
void regStats(const std::string &name);
#ifdef FULL_SYSTEM
@@ -156,7 +165,6 @@ class ExecContext
return dtb->translate(req, true);
}
-
#else
bool validInstAddr(Addr addr)
{ return process->validInstAddr(addr); }
@@ -244,8 +252,8 @@ class ExecContext
// and all other stores (WH64?). Unsuccessful Store
// Conditionals would have returned above, and wouldn't fall
// through.
- for (int i = 0; i < system->xcvec.size(); i++){
- cregs = &system->xcvec[i]->regs.miscRegs;
+ for (int i = 0; i < system->execContexts.size(); i++){
+ cregs = &system->execContexts[i]->regs.miscRegs;
if ((cregs->lock_addr & ~0xf) == (req->paddr & ~0xf)) {
cregs->lock_flag = false;
}