summaryrefslogtreecommitdiff
path: root/sim/system.cc
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2003-10-13 17:24:27 -0400
committerNathan Binkert <binkertn@umich.edu>2003-10-13 17:24:27 -0400
commitf94ff9ace556d9aa1ac9d00b8b1dbc73e161d213 (patch)
tree353724806826d4faa7ad8c6b6b9f0ab658936dbb /sim/system.cc
parent2471c214bf85b1c0342f222a1a85ace110d76d16 (diff)
downloadgem5-f94ff9ace556d9aa1ac9d00b8b1dbc73e161d213.tar.xz
Split up kernel.cc into separate files for dump_mbuf and printf
cpu/exec_context.hh: dev/alpha_console.cc: sim/system.cc: sim/system.hh: Convert from fixed array to a vector arch/alpha/arguments.hh: now that CopyData and CopyString are in vtophys.hh, this include is not necessary arch/alpha/vtophys.hh: Include isa_traits.hh for Addr cpu/pc_event.cc: Temporarily get this working while we're changing things --HG-- extra : convert_revision : 9a7597b7bd5d050819766f8edf7a02f28447b9ca
Diffstat (limited to 'sim/system.cc')
-rw-r--r--sim/system.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/sim/system.cc b/sim/system.cc
index 74216176a..999782e48 100644
--- a/sim/system.cc
+++ b/sim/system.cc
@@ -114,11 +114,6 @@ System::System(const std::string _name,
#ifdef FULL_SYSTEM
Addr addr = 0;
- for(int i = 0; i < 12/*MAX_CPUS*/; i++)
- xc_array[i] = (ExecContext *) 0;
-
- num_cpus = 0;
-
if (kernelSymtab->findAddress("enable_async_printf", addr)) {
Addr paddr = vtophys(physmem, addr);
uint8_t *enable_async_printf =
@@ -204,10 +199,13 @@ System::initBootContext(ExecContext *xc)
void
System::registerExecContext(ExecContext *xc)
{
- if (num_cpus == 12/*MAX_CPUS*/)
+ if (xc->cpu_id >= 12/*MAX_CPUS*/)
panic("Too many CPU's\n");
- xc_array[xc->cpu_id] = xc;
- num_cpus++;
+
+ if (xc->cpu_id >= xcvec.size())
+ xcvec.resize(xc->cpu_id + 1);
+
+ xcvec[xc->cpu_id] = xc;
}