diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2009-12-31 15:30:50 -0500 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2009-12-31 15:30:50 -0500 |
commit | cc07dcf02654267227d9de6ae0898d39d5ea5438 (patch) | |
tree | 1bec0ecf7c702aab29993e59ca0a496716b225f4 /src/arch/mips/isa.cc | |
parent | 1261f1d8db6134d47ccf27bb9b2bbb275deb6b84 (diff) | |
download | gem5-cc07dcf02654267227d9de6ae0898d39d5ea5438.tar.xz |
MIPS: Extract CPU pointer from the thread context in scheduleCP0 setMiscReg.
The MIPS ISA object expects to be constructed with a CPU pointer it uses to
look at other thread contexts and allow them to be manipulated with control
registers. Unfortunately, that differs from all the other ISA classes and
would complicate their implementation.
This change makes the event constructor use a CPU pointer pulled out of the
thread context passed to setMiscReg instead.
Diffstat (limited to 'src/arch/mips/isa.cc')
-rw-r--r-- | src/arch/mips/isa.cc | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/arch/mips/isa.cc b/src/arch/mips/isa.cc index 3c8c9a986..1cad7e4be 100644 --- a/src/arch/mips/isa.cc +++ b/src/arch/mips/isa.cc @@ -91,12 +91,6 @@ ISA::ISA() init(); } -ISA::ISA(BaseCPU *_cpu) -{ - cpu = _cpu; - init(); -} - void ISA::init() { @@ -173,11 +167,10 @@ ISA::expandForMultithreading(ThreadID num_threads, unsigned num_vpes) //@TODO: Use MIPS STYLE CONSTANTS (e.g. TCHALT_H instead of TCH_H) void ISA::reset(std::string core_name, ThreadID num_threads, - unsigned num_vpes, BaseCPU *_cpu) + unsigned num_vpes, BaseCPU *cpu) { DPRINTF(MipsPRA, "Resetting CP0 State with %i TCs and %i VPEs\n", num_threads, num_vpes); - cpu = _cpu; MipsISA::CoreSpecific &cp = cpu->coreParams; @@ -499,7 +492,7 @@ ISA::setMiscReg(int misc_reg, const MiscReg &val, miscRegFile[misc_reg][reg_sel] = cp0_val; - scheduleCP0Update(1); + scheduleCP0Update(tc->getCpuPtr(), 1); } /** @@ -528,7 +521,7 @@ ISA::filterCP0Write(int misc_reg, int reg_sel, const MiscReg &val) } void -ISA::scheduleCP0Update(int delay) +ISA::scheduleCP0Update(BaseCPU *cpu, int delay) { if (!cp0Updated) { cp0Updated = true; @@ -540,7 +533,7 @@ ISA::scheduleCP0Update(int delay) } void -ISA::updateCPU() +ISA::updateCPU(BaseCPU *cpu) { /////////////////////////////////////////////////////////////////// // @@ -578,7 +571,7 @@ ISA::CP0Event::process() switch (cp0EventType) { case UpdateCP0: - cp0->updateCPU(); + cp0->updateCPU(cpu); break; } } |