From f94ff9ace556d9aa1ac9d00b8b1dbc73e161d213 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 13 Oct 2003 17:24:27 -0400 Subject: 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 --- sim/system.cc | 14 ++++++-------- sim/system.hh | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'sim') 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; } diff --git a/sim/system.hh b/sim/system.hh index 830e78f4a..3ab514bfa 100644 --- a/sim/system.hh +++ b/sim/system.hh @@ -30,6 +30,7 @@ #define __SYSTEM_HH__ #include +#include #include "sim/sim_object.hh" #include "cpu/pc_event.hh" @@ -72,8 +73,7 @@ class System : public SimObject PCEventQueue pcEventQueue; - ExecContext *xc_array[12/*MAX_CPUS*/]; - int num_cpus; + std::vector xcvec; RemoteGDB *remoteGDB; GDBListener *gdbListen; -- cgit v1.2.3