summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2006-02-23 15:06:06 -0500
committerAli Saidi <saidi@eecs.umich.edu>2006-02-23 15:06:06 -0500
commite1c3acd91c65ae7d51a7d0b3c0f7be764b2c8f79 (patch)
tree490fb46c6254fea699d419d58035a1e0b67eebdd /cpu
parent99484cfae81f3f01ccdfcd273ddc2bdb41e6456b (diff)
parent1166d4f0bfe67a9dc178be3454b4f0eac38663ad (diff)
downloadgem5-e1c3acd91c65ae7d51a7d0b3c0f7be764b2c8f79.tar.xz
Merge zizzer:/bk/m5
into zeep.eecs.umich.edu:/z/saidi/work/m5.head cpu/simple/cpu.cc: remove initCPU from constructor dev/alpha_console.cc: we are panicing, so no need to return a fault --HG-- extra : convert_revision : 72389ea0c96e91a55f35b884200325224bfb6ed9
Diffstat (limited to 'cpu')
-rw-r--r--cpu/o3/cpu.cc3
-rw-r--r--cpu/simple/cpu.cc17
-rw-r--r--cpu/simple/cpu.hh1
3 files changed, 17 insertions, 4 deletions
diff --git a/cpu/o3/cpu.cc b/cpu/o3/cpu.cc
index ffa157fbb..706657887 100644
--- a/cpu/o3/cpu.cc
+++ b/cpu/o3/cpu.cc
@@ -137,8 +137,6 @@ FullO3CPU<Impl>::FullO3CPU(Params &params)
system->execContexts[i] =
new ExecContext(this, i, system, itb, dtb, mem);
- // initialize CPU, including PC
- TheISA::initCPU(&system->execContexts[i]->regs);
execContexts.push_back(system->execContexts[i]);
#else
if (i < params.workload.size()) {
@@ -250,6 +248,7 @@ FullO3CPU<Impl>::init()
// that it can start properly.
#if FULL_SYSTEM
ExecContext *src_xc = system->execContexts[0];
+ TheISA::initCPU(&src_xc->regs, src_xc->cpu_id);
#else
ExecContext *src_xc = thread[0];
#endif
diff --git a/cpu/simple/cpu.cc b/cpu/simple/cpu.cc
index f7a6d2c21..944bdbb0a 100644
--- a/cpu/simple/cpu.cc
+++ b/cpu/simple/cpu.cc
@@ -84,6 +84,21 @@ SimpleCPU::TickEvent::TickEvent(SimpleCPU *c, int w)
{
}
+
+void
+SimpleCPU::init()
+{
+ BaseCPU::init();
+#if FULL_SYSTEM
+ for (int i = 0; i < execContexts.size(); ++i) {
+ ExecContext *xc = execContexts[i];
+
+ // initialize CPU, including PC
+ TheISA::initCPU(&xc->regs, xc->cpu_id);
+ }
+#endif
+}
+
void
SimpleCPU::TickEvent::process()
{
@@ -124,8 +139,6 @@ SimpleCPU::SimpleCPU(Params *p)
#if FULL_SYSTEM
xc = new ExecContext(this, 0, p->system, p->itb, p->dtb, p->mem);
- // initialize CPU, including PC
- initCPU(&xc->regs);
#else
xc = new ExecContext(this, /* thread_num */ 0, p->process, /* asid */ 0);
#endif // !FULL_SYSTEM
diff --git a/cpu/simple/cpu.hh b/cpu/simple/cpu.hh
index d3e0323b6..ed7b1e29b 100644
--- a/cpu/simple/cpu.hh
+++ b/cpu/simple/cpu.hh
@@ -68,6 +68,7 @@ class SimpleCPU : public BaseCPU
public:
// main simulation loop (one cycle)
void tick();
+ virtual void init();
private:
struct TickEvent : public Event