From c0cf76c837d03c0b2cdaf0876b6c42a408ed1509 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Mon, 29 May 2006 18:24:27 -0400 Subject: Create a new CpuEvent class that has a pointer to an execution context in the object and places itself on a global list so so the events can be migrated on cpu switches. Create a new wrapper classe called CpuEventWrapper that works like the old wrapper class but calls the function with the xc parameter Use new CpuEventWrapper class from tick compare events on sparc src/arch/sparc/regfile.hh: Use new CpuEventWrapper class from tick compare events src/arch/sparc/ua2005.cc: Move definition to to a fullsystem only file, since it is. src/cpu/base.cc: On switch from one cpu to another CpuEvent::replaceExecContext() needs to be called on all (oldxc,newxc) pairs. --HG-- extra : convert_revision : eecf4540427cc0ddf75e19a3371cf32b56cba0f5 --- src/cpu/base.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/cpu/base.cc') diff --git a/src/cpu/base.cc b/src/cpu/base.cc index 9ce458c64..fb6116fd4 100644 --- a/src/cpu/base.cc +++ b/src/cpu/base.cc @@ -35,6 +35,7 @@ #include "base/misc.hh" #include "base/output.hh" #include "cpu/base.hh" +#include "cpu/cpuevent.hh" #include "cpu/exec_context.hh" #include "cpu/profile.hh" #include "cpu/sampler/sampler.hh" @@ -259,6 +260,9 @@ BaseCPU::takeOverFrom(BaseCPU *oldCPU) ExecContext *oldXC = oldCPU->execContexts[i]; newXC->takeOverFrom(oldXC); + + CpuEvent::replaceExecContext(oldXC, newXC); + assert(newXC->readCpuId() == oldXC->readCpuId()); #if FULL_SYSTEM system->replaceExecContext(newXC, newXC->readCpuId()); -- cgit v1.2.3