This abstracts away the raw PCEventQueue managed by the System.
Change-Id: I04d773e6be90a891884a76841f15c3eecd5796ed
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22101
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
// leads to non-intuitive behavior with --trace-start.
Addr addr = 0;
if (false && kernelSymtab->findAddress("alpha_switch_to", addr)) {
- printThreadEvent = new PrintThreadInfo(&pcEventQueue, "threadinfo",
+ printThreadEvent = new PrintThreadInfo(this, "threadinfo",
addr + sizeof(MachInst) * 6);
} else {
printThreadEvent = NULL;
HardBreakpoint *&bkpt = hardBreakMap[addr];
if (bkpt == 0)
- bkpt = new HardBreakpoint(this, &sys->pcEventQueue, addr);
+ bkpt = new HardBreakpoint(this, sys, addr);
bkpt->refcount++;
}
return id;
}
+#if THE_ISA != NULL_ISA
+bool
+System::schedule(PCEvent *event)
+{
+ return pcEventQueue.schedule(event);
+}
+
+bool
+System::remove(PCEvent *event)
+{
+ return pcEventQueue.remove(event);
+}
+#endif
+
int
System::numRunningContexts()
{
*/
#if THE_ISA != NULL_ISA
#include "cpu/pc_event.hh"
-
+#else
+class PCEvent;
#endif
class BaseRemoteGDB;
class ThreadContext;
class System : public SimObject
+#if THE_ISA != NULL_ISA
+ , public PCEventScope
+#endif
{
private:
std::vector<ThreadContext *> threadContexts;
const bool multiThread;
+ using SimObject::schedule;
+
+#if THE_ISA != NULL_ISA
+ bool schedule(PCEvent *event) override;
+ bool remove(PCEvent *event) override;
+#endif
+
ThreadContext *getThreadContext(ContextID tid) const
{
return threadContexts[tid];
#if THE_ISA != NULL_ISA
if (symtab->findAddress(lbl, addr)) {
- T *ev = new T(&pcEventQueue, desc, fixFuncEventAddr(addr),
+ T *ev = new T(this, desc, fixFuncEventAddr(addr),
std::forward<Args>(args)...);
return ev;
}