Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/50341 )


3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
Change subject: sim: Set up an SEWorkload pointer in the base Process class.
......................................................................

sim: Set up an SEWorkload pointer in the base Process class.

This will make it easier for the process object to access shared SE
level functionality and info.

Change-Id: I2cbddcabdf7264fde492b0566791d909ce2b10be
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50341
Reviewed-by: Matthew Poremba <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/sim/process.cc
M src/sim/process.hh
2 files changed, 8 insertions(+), 4 deletions(-)

Approvals:
  Matthew Poremba: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/sim/process.cc b/src/sim/process.cc
index 8d0a2af..8be5940 100644
--- a/src/sim/process.cc
+++ b/src/sim/process.cc
@@ -63,6 +63,7 @@
 #include "sim/fd_array.hh"
 #include "sim/fd_entry.hh"
 #include "sim/redirect_path.hh"
+#include "sim/se_workload.hh"
 #include "sim/syscall_desc.hh"
 #include "sim/system.hh"

@@ -112,6 +113,7 @@
 Process::Process(const ProcessParams &params, EmulationPageTable *pTable,
                  loader::ObjectFile *obj_file)
     : SimObject(params), system(params.system),
+      seWorkload(dynamic_cast<SEWorkload *>(system->workload)),
       useArchPT(params.useArchPT),
       kvmInSE(params.kvmInSE),
       useForClone(false),
@@ -132,12 +134,11 @@
       ADD_STAT(numSyscalls, statistics::units::Count::get(),
                "Number of system calls")
 {
-    if (_pid >= System::maxPID)
-        fatal("_pid is too large: %d", _pid);
+    fatal_if(!seWorkload, "Couldn't find appropriate workload object.");
+    fatal_if(_pid >= System::maxPID, "_pid is too large: %d", _pid);

     auto ret_pair = system->PIDs.emplace(_pid);
-    if (!ret_pair.second)
-        fatal("_pid %d is already used", _pid);
+    fatal_if(!ret_pair.second, "_pid %d is already used", _pid);

     /**
      * Linux bundles together processes into this concept called a thread
diff --git a/src/sim/process.hh b/src/sim/process.hh
index 34768a0..880b34b 100644
--- a/src/sim/process.hh
+++ b/src/sim/process.hh
@@ -59,6 +59,7 @@

 class EmulatedDriver;
 class EmulationPageTable;
+class SEWorkload;
 class SyscallDesc;
 class SyscallReturn;
 class System;
@@ -161,6 +162,8 @@
     // system object which owns this process
     System *system;

+    SEWorkload *seWorkload;
+
     // flag for using architecture specific page table
     bool useArchPT;
     // running KVM requires special initialization

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50341
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I2cbddcabdf7264fde492b0566791d909ce2b10be
Gerrit-Change-Number: 50341
Gerrit-PatchSet: 6
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Alex Dutu <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Matthew Poremba <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to