void
ISA::setIpr(int idx, uint64_t val, ThreadContext *tc)
{
+ auto *stats = dynamic_cast<AlphaISA::Kernel::Statistics *>(
+ tc->getKernelStats());
+ assert(stats || !tc->getKernelStats());
switch (idx) {
case IPR_PALtemp0:
case IPR_PALtemp1:
case IPR_PALtemp23:
// write entire quad w/ no side-effect
- if (tc->getKernelStats())
- tc->getKernelStats()->context(ipr[idx], val, tc);
+ if (stats)
+ stats->context(ipr[idx], val, tc);
ipr[idx] = val;
break;
case IPR_IPLR:
// only write least significant five bits - interrupt level
ipr[idx] = val & 0x1f;
- if (tc->getKernelStats())
- tc->getKernelStats()->swpipl(ipr[idx]);
+ if (stats)
+ stats->swpipl(ipr[idx]);
break;
case IPR_DTB_CM:
if (val & 0x18) {
- if (tc->getKernelStats())
- tc->getKernelStats()->mode(Kernel::user, tc);
+ if (stats)
+ stats->mode(Kernel::user, tc);
} else {
- if (tc->getKernelStats())
- tc->getKernelStats()->mode(Kernel::kernel, tc);
+ if (stats)
+ stats->mode(Kernel::kernel, tc);
}
M5_FALLTHROUGH;
Fault
SimpleThread::hwrei()
{
+ auto *stats = dynamic_cast<AlphaISA::Kernel::Statistics *>(kernelStats);
+ assert(stats || !kernelStats);
+
PCState pc = pcState();
if (!(pc.pc() & 0x3))
return std::make_shared<UnimplementedOpcodeFault>();
CPA::cpa()->swAutoBegin(this, pc.npc());
- if (kernelStats)
- kernelStats->hwrei();
+ if (stats)
+ stats->hwrei();
// FIXME: XXX check for interrupts? XXX
return NoFault;
bool
SimpleThread::simPalCheck(int palFunc)
{
- if (kernelStats)
- kernelStats->callpal(palFunc, this);
+ auto *stats = dynamic_cast<AlphaISA::Kernel::Statistics *>(kernelStats);
+ assert(stats || !kernelStats);
+
+ if (stats)
+ stats->callpal(palFunc, this);
switch (palFunc) {
case PAL::halt:
{
if (tc->getKernelStats()) {
RegVal val = tc->readMiscRegNoEffect(IPR_PALtemp23);
- tc->getKernelStats()->setIdleProcess(val, tc);
+ auto *stats = dynamic_cast<AlphaISA::Kernel::Statistics *>(
+ tc->getKernelStats());
+ assert(stats);
+ stats->setIdleProcess(val, tc);
}
remove();
}
#include <string>
#include "arch/generic/tlb.hh"
-#include "arch/kernel_stats.hh"
#include "arch/vtophys.hh"
#include "cpu/base.hh"
#include "cpu/simple_thread.hh"
#include "debug/Checker.hh"
class EndQuiesceEvent;
+namespace Kernel {
+ class Statistics;
+};
namespace TheISA {
- namespace Kernel {
- class Statistics;
- };
class Decoder;
};
System *getSystemPtr() override { return actualTC->getSystemPtr(); }
- TheISA::Kernel::Statistics *
+ ::Kernel::Statistics *
getKernelStats() override
{
return actualTC->getKernelStats();
// Need to clear the lock flag upon returning from an interrupt.
this->setMiscRegNoEffect(AlphaISA::MISCREG_LOCKFLAG, false, tid);
- this->thread[tid]->kernelStats->hwrei();
+ auto *stats = dynamic_cast<AlphaISA::Kernel::Statistics *>(
+ this->thread[tid]->kernelStats);
+ assert(stats);
+ stats->hwrei();
// FIXME: XXX check for interrupts? XXX
#endif
FullO3CPU<Impl>::simPalCheck(int palFunc, ThreadID tid)
{
#if THE_ISA == ALPHA_ISA
- if (this->thread[tid]->kernelStats)
- this->thread[tid]->kernelStats->callpal(palFunc,
- this->threadContexts[tid]);
+ auto *stats = dynamic_cast<AlphaISA::Kernel::Statistics *>(
+ this->thread[tid]->kernelStats);
+ if (stats)
+ stats->callpal(palFunc, this->threadContexts[tid]);
switch (palFunc) {
case PAL::halt:
#include <vector>
#include "arch/isa_traits.hh"
-#include "arch/kernel_stats.hh"
#include "arch/types.hh"
#include "base/trace.hh"
#include "config/the_isa.hh"
System *getSystemPtr() override { return cpu->system; }
/** Returns a pointer to this thread's kernel statistics. */
- TheISA::Kernel::Statistics *
+ ::Kernel::Statistics *
getKernelStats() override
{
return thread->kernelStats;
#include "cpu/simple/base.hh"
-#include "arch/kernel_stats.hh"
#include "arch/stacktrace.hh"
#include "arch/utility.hh"
#include "arch/vtophys.hh"
class FunctionProfile;
class ProfileNode;
-namespace TheISA {
- namespace Kernel {
- class Statistics;
- }
+namespace Kernel {
+ class Statistics;
}
/**
System *getSystemPtr() override { return system; }
- TheISA::Kernel::Statistics *
+ Kernel::Statistics *
getKernelStats() override
{
return ThreadState::getKernelStats();
#include "cpu/thread_context.hh"
#include "arch/generic/vec_pred_reg.hh"
-#include "arch/kernel_stats.hh"
#include "base/logging.hh"
#include "base/trace.hh"
#include "config/the_isa.hh"
#include "cpu/quiesce_event.hh"
#include "debug/Context.hh"
#include "debug/Quiesce.hh"
+#include "kern/kernel_stats.hh"
#include "params/BaseCPU.hh"
#include "sim/full_system.hh"
suspend();
if (getKernelStats())
- getKernelStats()->quiesce();
+ getKernelStats()->quiesce();
}
class PortProxy;
class Process;
class System;
-namespace TheISA {
- namespace Kernel {
- class Statistics;
- }
+namespace Kernel {
+ class Statistics;
}
/**
virtual System *getSystemPtr() = 0;
- virtual TheISA::Kernel::Statistics *getKernelStats() = 0;
+ virtual ::Kernel::Statistics *getKernelStats() = 0;
virtual PortProxy &getPhysProxy() = 0;
#include "cpu/thread_state.hh"
-#include "arch/kernel_stats.hh"
#include "base/output.hh"
#include "cpu/base.hh"
#include "cpu/profile.hh"
#include "cpu/quiesce_event.hh"
+#include "kern/kernel_stats.hh"
#include "mem/fs_translating_port_proxy.hh"
#include "mem/port.hh"
#include "mem/port_proxy.hh"
class EndQuiesceEvent;
class FunctionProfile;
class ProfileNode;
-namespace TheISA {
- namespace Kernel {
- class Statistics;
- }
+namespace Kernel {
+ class Statistics;
}
class Checkpoint;
void profileSample();
- TheISA::Kernel::Statistics *getKernelStats() { return kernelStats; }
+ Kernel::Statistics *getKernelStats() { return kernelStats; }
PortProxy &getPhysProxy();
Addr profilePC;
EndQuiesceEvent *quiesceEvent;
- TheISA::Kernel::Statistics *kernelStats;
+ Kernel::Statistics *kernelStats;
protected:
Process *process;
virtual ~Statistics() {}
const std::string name() const { return myname; }
- void regStats(const std::string &name);
+ virtual void regStats(const std::string &name);
public:
void arm() { _arm++; }
#include <gem5/asm/generic/m5ops.h>
-#include "arch/kernel_stats.hh"
#include "arch/pseudo_inst.hh"
#include "arch/utility.hh"
#include "arch/vtophys.hh"
#include "debug/Quiesce.hh"
#include "debug/WorkItems.hh"
#include "dev/net/dist_iface.hh"
+#include "kern/kernel_stats.hh"
#include "params/BaseCPU.hh"
#include "sim/full_system.hh"
#include "sim/initparam_keys.hh"