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>
This commit is contained in:
Gabe Black
2018-10-09 16:21:34 -07:00
parent 137b4993a4
commit 96a88fbedd
2 changed files with 4 additions and 0 deletions

View File

@@ -457,6 +457,7 @@ Scheduler::trace(bool delta)
}
Scheduler scheduler;
Process *getCurrentProcess() { return scheduler.current(); }
namespace {

View File

@@ -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()
{