summaryrefslogtreecommitdiff
path: root/cpu/exec_context.cc
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2003-10-24 23:02:36 -0700
committerSteve Reinhardt <stever@eecs.umich.edu>2003-10-24 23:02:36 -0700
commit91cb532f9f44874e768ba749df03ca1f4dc07bc9 (patch)
tree71e2b0173f5ed7c2e84968e525973f514fb9b1b8 /cpu/exec_context.cc
parentcd6b6df581f554805a5a1388ccd78044d91a2663 (diff)
downloadgem5-91cb532f9f44874e768ba749df03ca1f4dc07bc9.tar.xz
Make FullCPU schedule its TickEvent when one of its contexts becomes active.
This fixes detailed-mpboot, which was broken as of my last change. Also clean up some of the ExecContext status initialization. cpu/base_cpu.hh: CPU::execCtxStatusChg() now takes thread_num as an arg so the CPU knows which execContext had the status change. BaseCPU::registerExecContexts() no longer needs to be virtual. cpu/exec_context.cc: Initialize _status directly... don't use setStatus() as this will notify the CPU of the change before it is ready. CPU::execCtxStatusChg() now takes thread_num as an arg so the CPU knows which execContext had the status change. cpu/exec_context.hh: Don't need initStatus() any more. cpu/simple_cpu/simple_cpu.cc: Move execCtxStatusChg() from header to .cc file. No longer need specialized version of registerExecContexts to schedule TickEvent. cpu/simple_cpu/simple_cpu.hh: Move execCtxStatusChg() from header to .cc file. CPU::execCtxStatusChg() now takes thread_num as arg (must be 0 for SimpleCPU). No longer need specialized version of registerExecContexts to schedule TickEvent. kern/tru64/tru64_system.cc: Don't need initRegs; the PC etc. get initialized in the CPU constructor. ExecContexts start out as Unallocated, so no need to set them to Unallocated here. kern/tru64/tru64_system.hh: Don't need initRegs; the PC etc. get initialized in the CPU constructor. sim/prog.cc: ExecContexts start out as Unallocated, so no need to set them to Unallocated here. --HG-- extra : convert_revision : e960ebbeb845960344633798e251b6c8bf1c0378
Diffstat (limited to 'cpu/exec_context.cc')
-rw-r--r--cpu/exec_context.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/cpu/exec_context.cc b/cpu/exec_context.cc
index 6c24500cc..a4670f291 100644
--- a/cpu/exec_context.cc
+++ b/cpu/exec_context.cc
@@ -44,24 +44,22 @@ using namespace std;
ExecContext::ExecContext(BaseCPU *_cpu, int _thread_num, System *_sys,
AlphaItb *_itb, AlphaDtb *_dtb,
FunctionalMemory *_mem)
- : kernelStats(this, _cpu), cpu(_cpu), thread_num(_thread_num),
+ : _status(ExecContext::Unallocated),
+ kernelStats(this, _cpu), cpu(_cpu), thread_num(_thread_num),
cpu_id(-1), mem(_mem), itb(_itb), dtb(_dtb), system(_sys),
memCtrl(_sys->memCtrl), physmem(_sys->physmem),
func_exe_insn(0), storeCondFailures(0)
{
memset(&regs, 0, sizeof(RegFile));
- setStatus(ExecContext::Unallocated);
}
#else
ExecContext::ExecContext(BaseCPU *_cpu, int _thread_num,
Process *_process, int _asid)
- : cpu(_cpu), thread_num(_thread_num), cpu_id(-1),
- process(_process), asid (_asid),
+ : _status(ExecContext::Unallocated),
+ cpu(_cpu), thread_num(_thread_num), cpu_id(-1),
+ process(_process), mem(process->getMemory()), asid(_asid),
func_exe_insn(0), storeCondFailures(0)
{
- setStatus(ExecContext::Unallocated);
-
- mem = process->getMemory();
}
ExecContext::ExecContext(BaseCPU *_cpu, int _thread_num,
@@ -114,7 +112,7 @@ ExecContext::setStatus(Status new_status)
#endif
_status = new_status;
- cpu->execCtxStatusChg();
+ cpu->execCtxStatusChg(thread_num);
}
void