setNextPC(readMiscReg(AlphaISA::IPR_EXC_ADDR));
if (!misspeculating()) {
- kernelStats->hwrei();
+ if (kernelStats)
+ kernelStats->hwrei();
cpu->checkInterrupts = true;
}
if (val & 0x18) {
if (xc->getKernelStats())
xc->getKernelStats()->mode(Kernel::user, xc);
- else {
- if (xc->getKernelStats())
- xc->getKernelStats()->mode(Kernel::kernel, xc);
- }
+ } else {
+ if (xc->getKernelStats())
+ xc->getKernelStats()->mode(Kernel::kernel, xc);
}
case AlphaISA::IPR_ICM:
bool
CPUExecContext::simPalCheck(int palFunc)
{
- kernelStats->callpal(palFunc, proxy);
+ if (kernelStats)
+ kernelStats->callpal(palFunc, proxy);
switch (palFunc) {
case PAL::halt:
execContexts.push_back(xcProxy);
#else
if (systemPtr) {
- cpuXC = new CPUExecContext(this, 0, systemPtr, itb, dtb, memPtr);
+ cpuXC = new CPUExecContext(this, 0, systemPtr, itb, dtb, memPtr, false);
cpuXC->setStatus(ExecContext::Suspended);
xcProxy = cpuXC->getProxy();
systemPtr = system;
if (memPtr) {
- cpuXC = new CPUExecContext(this, 0, systemPtr, itb, dtb, memPtr);
+ cpuXC = new CPUExecContext(this, 0, systemPtr, itb, dtb, memPtr, false);
cpuXC->setStatus(ExecContext::Suspended);
xcProxy = cpuXC->getProxy();
// constructor
#if FULL_SYSTEM
CPUExecContext::CPUExecContext(BaseCPU *_cpu, int _thread_num, System *_sys,
- AlphaITB *_itb, AlphaDTB *_dtb,
- FunctionalMemory *_mem)
+ AlphaITB *_itb, AlphaDTB *_dtb,
+ FunctionalMemory *_mem,
+ bool use_kernel_stats)
: _status(ExecContext::Unallocated), cpu(_cpu), thread_num(_thread_num),
cpu_id(-1), lastActivate(0), lastSuspend(0), mem(_mem), itb(_itb),
dtb(_dtb), system(_sys), memctrl(_sys->memctrl), physmem(_sys->physmem),
static ProfileNode dummyNode;
profileNode = &dummyNode;
profilePC = 3;
+
+ if (use_kernel_stats) {
+ kernelStats = new Kernel::Statistics(system);
+ } else {
+ kernelStats = NULL;
+ }
}
#else
CPUExecContext::CPUExecContext(BaseCPU *_cpu, int _thread_num,
CPUExecContext::regStats(const string &name)
{
#if FULL_SYSTEM
- kernelStats = new Kernel::Statistics(system);
- kernelStats->regStats(name + ".kern");
+ if (kernelStats)
+ kernelStats->regStats(name + ".kern");
#endif
}
// constructor: initialize context from given process structure
#if FULL_SYSTEM
CPUExecContext(BaseCPU *_cpu, int _thread_num, System *_system,
- AlphaITB *_itb, AlphaDTB *_dtb, FunctionalMemory *_dem);
+ AlphaITB *_itb, AlphaDTB *_dtb, FunctionalMemory *_mem,
+ bool use_kernel_stats = true);
#else
CPUExecContext(BaseCPU *_cpu, int _thread_num, Process *_process, int _asid);
CPUExecContext(BaseCPU *_cpu, int _thread_num, FunctionalMemory *_mem,