Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/50341 )
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
---
M src/sim/process.cc
M src/sim/process.hh
2 files changed, 8 insertions(+), 4 deletions(-)
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 ¶ms, 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: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s