summaryrefslogtreecommitdiff
path: root/sim/system.cc
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 /sim/system.cc
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 'sim/system.cc')
-rw-r--r--sim/system.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/sim/system.cc b/sim/system.cc
index 903362f0b..af4a4c151 100644
--- a/sim/system.cc
+++ b/sim/system.cc
@@ -56,16 +56,24 @@ System::~System()
}
-void
+int
System::registerExecContext(ExecContext *xc)
{
- if (xc->cpu_id >= 12/*MAX_CPUS*/)
- panic("Too many CPU's\n");
+ int myIndex = execContexts.size();
+ execContexts.push_back(xc);
+ return myIndex;
+}
+
- if (xc->cpu_id >= xcvec.size())
- xcvec.resize(xc->cpu_id + 1);
+void
+System::replaceExecContext(int xcIndex, ExecContext *xc)
+{
+ if (xcIndex >= execContexts.size()) {
+ panic("replaceExecContext: bad xcIndex, %d >= %d\n",
+ xcIndex, execContexts.size());
+ }
- xcvec[xc->cpu_id] = xc;
+ execContexts[xcIndex] = xc;
}