X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcpu%2Fcpuevent.hh;h=77b1d9138acfe6b264d87be09196cde66ee01e68;hb=a384525355c37f8776e03c78e12279c38c5c3097;hp=11ac7aafbab5c020d210b62d85a10eaef1e03649;hpb=eb0e416998ce2546c768d2b9d9d8bf3a387a87be;p=gem5.git diff --git a/src/cpu/cpuevent.hh b/src/cpu/cpuevent.hh index 11ac7aafb..77b1d9138 100644 --- a/src/cpu/cpuevent.hh +++ b/src/cpu/cpuevent.hh @@ -32,19 +32,22 @@ #define __CPU_CPUEVENT_HH__ #include + #include "sim/eventq.hh" class ThreadContext; -/** This class creates a global list of events than need a pointer to an - * thread context. When a switchover takes place the events can be migrated - * to the new thread context, otherwise you could have a wake timer interrupt - * go off on a switched out cpu or other unfortunate events. This object MUST be - * dynamically allocated to avoid it being deleted after a cpu switch happens. - * */ +/** + * This class creates a global list of events that need a pointer to a + * thread context. When a switchover takes place the events can be + * migrated to the new thread context, otherwise you could have a wake + * timer interrupt go off on a switched out cpu or other unfortunate + * events. This object MUST be dynamically allocated to avoid it being + * deleted after a cpu switch happens. + */ class CpuEvent : public Event { - private: + protected: /** type of global list of cpu events. */ typedef std::vector CpuEventList; @@ -56,8 +59,8 @@ class CpuEvent : public Event ThreadContext *tc; public: - CpuEvent(EventQueue *q, ThreadContext *_tc, Priority p = Default_Pri) - : Event(q, p), tc(_tc) + CpuEvent(ThreadContext *_tc, Priority p = Default_Pri) + : Event(p), tc(_tc) { cpuEventList.push_back(this); } /** delete the cpu event from the global list. */ @@ -69,6 +72,7 @@ class CpuEvent : public Event */ static void replaceThreadContext(ThreadContext *oldTc, ThreadContext *newTc); + ThreadContext* getTC() { return tc; } }; template @@ -78,9 +82,8 @@ class CpuEventWrapper : public CpuEvent T *object; public: - CpuEventWrapper(T *obj, ThreadContext *_tc, EventQueue *q = &mainEventQueue, - Priority p = Default_Pri) - : CpuEvent(q, _tc, p), object(obj) + CpuEventWrapper(T *obj, ThreadContext *_tc, Priority p = Default_Pri) + : CpuEvent(_tc, p), object(obj) { } void process() { (object->*F)(tc); } };