summaryrefslogtreecommitdiff
path: root/src/systemc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-10-09 16:21:34 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 01:15:51 +0000
commit96a88fbeddb354cddfbbbcc905ba5bb84cf4dde1 (patch)
treec4228afb476dde66fa07410a06cea69dcf5173da /src/systemc
parent137b4993a4710a247d79cdc0194dfa107b080f98 (diff)
downloadgem5-96a88fbeddb354cddfbbbcc905ba5bb84cf4dde1.tar.xz
systemc: Add an accessor for getting the current process.
This is to avoid having to expose the scheduler (which tracks the current process) to header files which should be independent of gem5 and the underlying implementation. Change-Id: I1b0810ab66c3ce52b5b94236d7df86da66a62472 Reviewed-on: https://gem5-review.googlesource.com/c/13335 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc')
-rw-r--r--src/systemc/core/scheduler.cc1
-rw-r--r--src/systemc/core/scheduler.hh3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/systemc/core/scheduler.cc b/src/systemc/core/scheduler.cc
index 52bf7ec31..5e96a47d5 100644
--- a/src/systemc/core/scheduler.cc
+++ b/src/systemc/core/scheduler.cc
@@ -457,6 +457,7 @@ Scheduler::trace(bool delta)
}
Scheduler scheduler;
+Process *getCurrentProcess() { return scheduler.current(); }
namespace {
diff --git a/src/systemc/core/scheduler.hh b/src/systemc/core/scheduler.hh
index 14dee2e6f..2ae03ea1b 100644
--- a/src/systemc/core/scheduler.hh
+++ b/src/systemc/core/scheduler.hh
@@ -491,6 +491,9 @@ class Scheduler
extern Scheduler scheduler;
+// A proxy function to avoid having to expose the scheduler in header files.
+Process *getCurrentProcess();
+
inline void
Scheduler::TimeSlot::process()
{