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/arch/sparc/regfile.hh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src/arch/sparc/regfile.hh') diff --git a/src/arch/sparc/regfile.hh b/src/arch/sparc/regfile.hh index c69b9cee8..5322ffb37 100644 --- a/src/arch/sparc/regfile.hh +++ b/src/arch/sparc/regfile.hh @@ -33,7 +33,7 @@ #include "arch/sparc/faults.hh" #include "base/trace.hh" #include "sim/byteswap.hh" -#include "sim/eventq.hh" +#include "cpu/cpuevent.hh" #include "sim/host.hh" class Checkpoint; @@ -557,28 +557,31 @@ namespace SparcISA // These need to check the int_dis field and if 0 then // set appropriate bit in softint and checkinterrutps on the cpu - void processTickCompare() { panic("tick compare not implemented\n"); } - void processSTickCompare(){ panic("tick compare not implemented\n"); } - void processHSTickCompare(){ panic("tick compare not implemented\n"); } +#if FULL_SYSTEM + /** Process a tick compare event and generate an interrupt on the cpu if + * appropriate. */ + void processTickCompare(ExecContext *xc); + void processSTickCompare(ExecContext *xc); + void processHSTickCompare(ExecContext *xc); - typedef EventWrapper TickCompareEvent; - TickCompareEvent tickCompare; + TickCompareEvent *tickCompare; - typedef EventWrapper STickCompareEvent; - STickCompareEvent sTickCompare; + STickCompareEvent *sTickCompare; - typedef EventWrapper HSTickCompareEvent; - HSTickCompareEvent hSTickCompare; + HSTickCompareEvent *hSTickCompare; /** Fullsystem only register version of ReadRegWithEffect() */ MiscReg readFSRegWithEffect(int miscReg, Fault &fault, ExecContext *xc); /** Fullsystem only register version of SetRegWithEffect() */ Fault setFSRegWithEffect(int miscReg, const MiscReg &val, ExecContext * xc); - +#endif public: void reset() @@ -636,7 +639,6 @@ namespace SparcISA } MiscRegFile() - : tickCompare(this), sTickCompare(this), hSTickCompare(this) { reset(); } -- cgit v1.2.3