From ae06e9a5c640e376d8997409180e4ac1d57838b2 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Fri, 21 Aug 2015 07:03:14 -0400 Subject: [PATCH] cpu: Move invldPid constant from Request to BaseCPU A more natural home for this constant. --- src/arch/arm/linux/system.cc | 2 +- src/cpu/base.cc | 2 +- src/cpu/base.hh | 5 +++++ src/mem/request.hh | 4 ---- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/arch/arm/linux/system.cc b/src/arch/arm/linux/system.cc index f6df6307a..fc13e8cf5 100644 --- a/src/arch/arm/linux/system.cc +++ b/src/arch/arm/linux/system.cc @@ -241,7 +241,7 @@ LinuxArmSystem::startup() for (int i = 0; i < _numContexts; i++) { ThreadContext *tc = threadContexts[i]; uint32_t pid = tc->getCpuPtr()->getPid(); - if (pid != Request::invldPid) { + if (pid != BaseCPU::invldPid) { mapPid(tc, pid); tc->getCpuPtr()->taskId(taskMap[pid]); } diff --git a/src/cpu/base.cc b/src/cpu/base.cc index 0b704c48b..eb5cadfcc 100644 --- a/src/cpu/base.cc +++ b/src/cpu/base.cc @@ -127,7 +127,7 @@ BaseCPU::BaseCPU(Params *p, bool is_checker) : MemObject(p), instCnt(0), _cpuId(p->cpu_id), _socketId(p->socket_id), _instMasterId(p->system->getMasterId(name() + ".inst")), _dataMasterId(p->system->getMasterId(name() + ".data")), - _taskId(ContextSwitchTaskId::Unknown), _pid(Request::invldPid), + _taskId(ContextSwitchTaskId::Unknown), _pid(invldPid), _switchedOut(p->switched_out), _cacheLineSize(p->system->cacheLineSize()), interrupts(p->interrupts), profileEvent(NULL), numThreads(p->numThreads), system(p->system), diff --git a/src/cpu/base.hh b/src/cpu/base.hh index 660f0278e..3a10841e0 100644 --- a/src/cpu/base.hh +++ b/src/cpu/base.hh @@ -263,6 +263,11 @@ class BaseCPU : public MemObject public: + + /** Invalid or unknown Pid. Possible when operating system is not present + * or has not assigned a pid yet */ + static const uint32_t invldPid = std::numeric_limits::max(); + // Mask to align PCs to MachInst sized boundaries static const Addr PCMask = ~((Addr)sizeof(TheISA::MachInst) - 1); diff --git a/src/mem/request.hh b/src/mem/request.hh index 0e2ece857..fb684ef2f 100644 --- a/src/mem/request.hh +++ b/src/mem/request.hh @@ -195,10 +195,6 @@ class Request }; /** @} */ - /** Invalid or unknown Pid. Possible when operating system is not present - * or has not assigned a pid yet */ - static const uint32_t invldPid = std::numeric_limits::max(); - private: typedef uint8_t PrivateFlagsType; typedef ::Flags PrivateFlags;