gem5  v21.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
process.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2016 Advanced Micro Devices, Inc.
3  * Copyright (c) 2012 ARM Limited
4  * All rights reserved
5  *
6  * The license below extends only to copyright in the software and shall
7  * not be construed as granting a license to any other intellectual
8  * property including but not limited to intellectual property relating
9  * to a hardware implementation of the functionality of the software
10  * licensed hereunder. You may use the software subject to the license
11  * terms below provided that you ensure that this notice is replicated
12  * unmodified and in its entirety in all distributions of the software,
13  * modified or unmodified, in source code or in binary form.
14  *
15  * Copyright (c) 2001-2005 The Regents of The University of Michigan
16  * All rights reserved.
17  *
18  * Redistribution and use in source and binary forms, with or without
19  * modification, are permitted provided that the following conditions are
20  * met: redistributions of source code must retain the above copyright
21  * notice, this list of conditions and the following disclaimer;
22  * redistributions in binary form must reproduce the above copyright
23  * notice, this list of conditions and the following disclaimer in the
24  * documentation and/or other materials provided with the distribution;
25  * neither the name of the copyright holders nor the names of its
26  * contributors may be used to endorse or promote products derived from
27  * this software without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #include "sim/process.hh"
43 
44 #include <fcntl.h>
45 #include <unistd.h>
46 
47 #include <array>
48 #include <climits>
49 #include <csignal>
50 #include <map>
51 #include <string>
52 #include <vector>
53 
54 #include "base/intmath.hh"
56 #include "base/loader/symtab.hh"
57 #include "base/statistics.hh"
58 #include "config/the_isa.hh"
59 #include "cpu/thread_context.hh"
60 #include "mem/page_table.hh"
62 #include "params/Process.hh"
63 #include "sim/emul_driver.hh"
64 #include "sim/fd_array.hh"
65 #include "sim/fd_entry.hh"
66 #include "sim/redirect_path.hh"
67 #include "sim/syscall_desc.hh"
68 #include "sim/system.hh"
69 
70 namespace
71 {
72 
73 typedef std::vector<Process::Loader *> LoaderList;
74 
75 LoaderList &
76 process_loaders()
77 {
78  static LoaderList loaders;
79  return loaders;
80 }
81 
82 } // anonymous namespace
83 
85 {
86  process_loaders().emplace_back(this);
87 }
88 
89 Process *
90 Process::tryLoaders(const ProcessParams &params,
91  ::Loader::ObjectFile *obj_file)
92 {
93  for (auto &loader: process_loaders()) {
94  Process *p = loader->load(params, obj_file);
95  if (p)
96  return p;
97  }
98 
99  return nullptr;
100 }
101 
102 static std::string
103 normalize(const std::string& directory)
104 {
105  if (directory.back() != '/')
106  return directory + '/';
107  return directory;
108 }
109 
111  ::Loader::ObjectFile *obj_file)
115  useForClone(false),
116  pTable(pTable),
117  objFile(obj_file),
118  argv(params.cmd), envp(params.env),
120  tgtCwd(normalize(params.cwd)),
127  fds(std::make_shared<FDArray>(
128  params.input, params.output, params.errout)),
129  childClearTID(0),
130  ADD_STAT(numSyscalls, UNIT_COUNT, "Number of system calls")
131 {
132  if (_pid >= System::maxPID)
133  fatal("_pid is too large: %d", _pid);
134 
135  auto ret_pair = system->PIDs.emplace(_pid);
136  if (!ret_pair.second)
137  fatal("_pid %d is already used", _pid);
138 
151  _tgid = params.pid;
152 
153  exitGroup = new bool();
154  sigchld = new bool();
155 
156  image = objFile->buildImage();
157 
158  if (::Loader::debugSymbolTable.empty())
160 }
161 
162 void
164  Process *np, RegVal flags)
165 {
166 #ifndef CLONE_VM
167 #define CLONE_VM 0
168 #endif
169 #ifndef CLONE_FILES
170 #define CLONE_FILES 0
171 #endif
172 #ifndef CLONE_THREAD
173 #define CLONE_THREAD 0
174 #endif
175  if (CLONE_VM & flags) {
181  delete np->pTable;
182  np->pTable = pTable;
183 
184  np->memState = memState;
185  } else {
190  typedef std::vector<std::pair<Addr,Addr>> MapVec;
191  MapVec mappings;
192  pTable->getMappings(&mappings);
193 
194  for (auto map : mappings) {
195  Addr paddr, vaddr = map.first;
196  bool alloc_page = !(np->pTable->translate(vaddr, paddr));
197  np->replicatePage(vaddr, paddr, otc, ntc, alloc_page);
198  }
199 
200  *np->memState = *memState;
201  }
202 
203  if (CLONE_FILES & flags) {
209  np->fds = fds;
210  } else {
218  std::shared_ptr<FDArray> nfds = np->fds;
219  for (int tgt_fd = 0; tgt_fd < fds->getSize(); tgt_fd++) {
220  std::shared_ptr<FDEntry> this_fde = (*fds)[tgt_fd];
221  if (!this_fde) {
222  nfds->setFDEntry(tgt_fd, nullptr);
223  continue;
224  }
225  nfds->setFDEntry(tgt_fd, this_fde->clone());
226 
227  auto this_hbfd = std::dynamic_pointer_cast<HBFDEntry>(this_fde);
228  if (!this_hbfd)
229  continue;
230 
231  int this_sim_fd = this_hbfd->getSimFD();
232  if (this_sim_fd <= 2)
233  continue;
234 
235  int np_sim_fd = dup(this_sim_fd);
236  assert(np_sim_fd != -1);
237 
238  auto nhbfd = std::dynamic_pointer_cast<HBFDEntry>((*nfds)[tgt_fd]);
239  nhbfd->setSimFD(np_sim_fd);
240  }
241  }
242 
243  if (CLONE_THREAD & flags) {
244  np->_tgid = _tgid;
245  delete np->exitGroup;
246  np->exitGroup = exitGroup;
247  }
248 
249  np->argv.insert(np->argv.end(), argv.begin(), argv.end());
250  np->envp.insert(np->envp.end(), envp.begin(), envp.end());
251 }
252 
253 void
255 {
257  for (it = contextIds.begin(); it != contextIds.end(); it++) {
258  if (*it == context_id) {
259  contextIds.erase(it);
260  return;
261  }
262  }
263  warn("Unable to find thread context to revoke");
264 }
265 
266 void
268 {
269  // Patch the ld_bias for dynamic executables.
270  updateBias();
271 
272  if (objFile->getInterpreter())
274 }
275 
276 void
278 {
279  if (contextIds.empty())
280  fatal("Process %s is not associated with any HW contexts!\n", name());
281 
282  // first thread context for this process... initialize & enable
284 
285  // mark this context as active so it will start ticking.
286  tc->activate();
287 
288  pTable->initState();
289 
292 
293  // load object file into target memory
296 }
297 
300 {
301  fds->updateFileOffsets();
302  return DrainState::Drained;
303 }
304 
305 void
306 Process::allocateMem(Addr vaddr, int64_t size, bool clobber)
307 {
308  // Check if the page has been mapped by other cores if not to clobber.
309  // When running multithreaded programs in SE-mode with DerivO3CPU model,
310  // there are cases where two or more cores have page faults on the same
311  // page in nearby ticks. When the cores try to handle the faults at the
312  // commit stage (also in nearby ticks/cycles), the first core will ask for
313  // a physical page frame to map with the virtual page. Other cores can
314  // return if the page has been mapped and `!clobber`.
315  if (!clobber) {
317  if (pte) {
318  warn("Process::allocateMem: addr %#x already mapped\n", vaddr);
319  return;
320  }
321  }
322 
323  int npages = divCeil(size, pTable->pageSize());
324  Addr paddr = system->allocPhysPages(npages);
325  pTable->map(vaddr, paddr, size,
326  clobber ? EmulationPageTable::Clobber :
328 }
329 
330 void
332  ThreadContext *new_tc, bool allocate_page)
333 {
334  if (allocate_page)
335  new_paddr = system->allocPhysPages(1);
336 
337  // Read from old physical page.
338  uint8_t buf_p[pTable->pageSize()];
339  old_tc->getVirtProxy().readBlob(vaddr, buf_p, sizeof(buf_p));
340 
341  // Create new mapping in process address space by clobbering existing
342  // mapping (if any existed) and then write to the new physical page.
343  bool clobber = true;
344  pTable->map(vaddr, new_paddr, sizeof(buf_p), clobber);
345  new_tc->getVirtProxy().writeBlob(vaddr, buf_p, sizeof(buf_p));
346 }
347 
348 bool
350 {
351  return memState->fixupFault(vaddr);
352 }
353 
354 void
356 {
357  memState->serialize(cp);
358  pTable->serialize(cp);
364  warn("Checkpoints for file descriptors currently do not work.");
365 }
366 
367 void
369 {
370  memState->unserialize(cp);
376  warn("Checkpoints for file descriptors currently do not work.");
377  // The above returns a bool so that you could do something if you don't
378  // find the param in the checkpoint if you wanted to, like set a default
379  // but in this case we'll just stick with the instantiated value if not
380  // found.
381 }
382 
383 bool
384 Process::map(Addr vaddr, Addr paddr, int size, bool cacheable)
385 {
386  pTable->map(vaddr, paddr, size,
387  cacheable ? EmulationPageTable::MappingFlags(0) :
389  return true;
390 }
391 
393 Process::findDriver(std::string filename)
394 {
395  for (EmulatedDriver *d : drivers) {
396  if (d->match(filename))
397  return d;
398  }
399 
400  return nullptr;
401 }
402 
403 std::string
404 Process::checkPathRedirect(const std::string &filename)
405 {
406  // If the input parameter contains a relative path, convert it.
407  // The target version of the current working directory is fine since
408  // we immediately convert it using redirect paths into a host version.
409  auto abs_path = absolutePath(filename, false);
410 
411  for (auto path : system->redirectPaths) {
412  // Search through the redirect paths to see if a starting substring of
413  // our path falls into any buckets which need to redirected.
414  if (startswith(abs_path, path->appPath())) {
415  std::string tail = abs_path.substr(path->appPath().size());
416 
417  // If this path needs to be redirected, search through a list
418  // of targets to see if we can match a valid file (or directory).
419  for (auto host_path : path->hostPaths()) {
420  if (access((host_path + tail).c_str(), R_OK) == 0) {
421  // Return the valid match.
422  return host_path + tail;
423  }
424  }
425  // The path needs to be redirected, but the file or directory
426  // does not exist on the host filesystem. Return the first
427  // host path as a default.
428  return path->hostPaths()[0] + tail;
429  }
430  }
431 
432  // The path does not need to be redirected.
433  return abs_path;
434 }
435 
436 void
438 {
439  auto *interp = objFile->getInterpreter();
440 
441  if (!interp || !interp->relocatable())
442  return;
443 
444  // Determine how large the interpreters footprint will be in the process
445  // address space.
446  Addr interp_mapsize = roundUp(interp->mapSize(), pTable->pageSize());
447 
448  // We are allocating the memory area; set the bias to the lowest address
449  // in the allocated memory region.
450  Addr mmap_end = memState->getMmapEnd();
451  Addr ld_bias = mmapGrowsDown() ? mmap_end - interp_mapsize : mmap_end;
452 
453  // Adjust the process mmap area to give the interpreter room; the real
454  // execve system call would just invoke the kernel's internal mmap
455  // functions to make these adjustments.
456  mmap_end = mmapGrowsDown() ? ld_bias : mmap_end + interp_mapsize;
457  memState->setMmapEnd(mmap_end);
458 
459  interp->updateBias(ld_bias);
460 }
461 
464 {
465  return objFile->getInterpreter();
466 }
467 
468 Addr
470 {
471  auto *interp = getInterpreter();
472 
473  return interp ? interp->bias() : objFile->bias();
474 }
475 
476 Addr
478 {
479  auto *interp = getInterpreter();
480 
481  return interp ? interp->entryPoint() : objFile->entryPoint();
482 }
483 
484 std::string
485 Process::absolutePath(const std::string &filename, bool host_filesystem)
486 {
487  if (filename.empty() || startswith(filename, "/"))
488  return filename;
489 
490  // Construct the absolute path given the current working directory for
491  // either the host filesystem or target filesystem. The distinction only
492  // matters if filesystem redirection is utilized in the simulation.
493  auto path_base = std::string();
494  if (host_filesystem) {
495  path_base = hostCwd;
496  assert(!hostCwd.empty());
497  } else {
498  path_base = tgtCwd;
499  assert(!tgtCwd.empty());
500  }
501 
502  // Add a trailing '/' if the current working directory did not have one.
503  normalize(path_base);
504 
505  // Append the filename onto the current working path.
506  auto absolute_path = path_base + filename;
507 
508  return absolute_path;
509 }
510 
511 Process *
512 ProcessParams::create() const
513 {
514  // If not specified, set the executable parameter equal to the
515  // simulated system's zeroth command line parameter
516  const std::string &exec = (executable == "") ? cmd[0] : executable;
517 
518  auto *obj_file = Loader::createObjectFile(exec);
519  fatal_if(!obj_file, "Cannot load object file %s.", exec);
520 
521  Process *process = Process::tryLoaders(*this, obj_file);
522  fatal_if(!process, "Unknown error creating process object.");
523 
524  return process;
525 }
System::PIDs
std::set< int > PIDs
Process set to track which PIDs have already been allocated.
Definition: system.hh:610
Process::_egid
uint64_t _egid
Definition: process.hh:260
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:183
output
static void output(const char *filename)
Definition: debug.cc:60
warn
#define warn(...)
Definition: logging.hh:239
Process::kvmInSE
bool kvmInSE
Definition: process.hh:165
EmulationPageTable::Entry
Definition: page_table.hh:52
SETranslatingPortProxy
Definition: se_translating_port_proxy.hh:46
Process::updateBias
void updateBias()
Definition: process.cc:437
system.hh
Process::tgtCwd
std::string tgtCwd
The cwd members are used to track changes to the current working directory for the purpose of executi...
Definition: process.hh:250
Process::pgid
uint64_t pgid()
Definition: process.hh:86
Process::envp
std::vector< std::string > envp
Definition: process.hh:212
ThreadContext::activate
virtual void activate()=0
Set the status to Active.
fd_entry.hh
Loader::ObjectFile::bias
virtual Addr bias() const
Definition: object_file.hh:99
Loader::MemoryImage::write
bool write(const PortProxy &proxy) const
Definition: memory_image.cc:50
Process::useForClone
bool useForClone
Definition: process.hh:167
Process::fds
std::shared_ptr< FDArray > fds
Definition: process.hh:271
Process::gid
uint64_t gid()
Definition: process.hh:82
EmulationPageTable::Uncacheable
@ Uncacheable
Definition: page_table.hh:94
CLONE_VM
#define CLONE_VM
Process
Definition: process.hh:65
Process::executable
std::string executable
Definition: process.hh:213
Process::ppid
uint64_t ppid()
Definition: process.hh:85
Process::_gid
uint64_t _gid
Definition: process.hh:259
EmulationPageTable::initState
virtual void initState()
Definition: page_table.hh:101
Process::argv
std::vector< std::string > argv
Definition: process.hh:211
redirect_path.hh
Loader::createObjectFile
ObjectFile * createObjectFile(const std::string &fname, bool raw)
Definition: object_file.cc:115
System::redirectPaths
std::vector< RedirectPath * > redirectPaths
Definition: system.hh:619
Process::pTable
EmulationPageTable * pTable
Definition: process.hh:169
System::maxPID
static const int maxPID
Definition: system.hh:607
Loader::ImageFile::buildImage
virtual MemoryImage buildImage() const =0
std::vector
STL vector class.
Definition: stl.hh:37
FDArray
Definition: fd_array.hh:44
Process::initVirtMem
std::unique_ptr< SETranslatingPortProxy > initVirtMem
Definition: process.hh:172
fd_array.hh
Process::exitGroup
bool * exitGroup
Definition: process.hh:273
Process::egid
uint64_t egid()
Definition: process.hh:83
EmulationPageTable::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: page_table.cc:186
Process::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: process.cc:368
EmulationPageTable::lookup
const Entry * lookup(Addr vaddr)
Lookup function.
Definition: page_table.cc:130
Process::numSyscalls
Stats::Scalar numSyscalls
Definition: process.hh:285
DrainState::Drained
@ Drained
Buffers drained, ready for serialization/handover.
PortProxy::writeBlob
void writeBlob(Addr addr, const void *p, int size) const
Same as tryWriteBlob, but insists on success.
Definition: port_proxy.hh:187
EmulationPageTable::getMappings
void getMappings(std::vector< std::pair< Addr, Addr >> *addr_mappings)
Definition: page_table.cc:94
EmulationPageTable::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: page_table.cc:169
DrainState
DrainState
Object drain/handover states.
Definition: drain.hh:71
Process::getInterpreter
::Loader::ObjectFile * getInterpreter()
Definition: process.cc:463
Process::revokeThreadContext
void revokeThreadContext(int context_id)
After delegating a thread context to a child process no longer should relate to the ThreadContext.
Definition: process.cc:254
Loader::ObjectFile
Definition: object_file.hh:74
EmulatedDriver
EmulatedDriver is an abstract base class for fake SE-mode device drivers.
Definition: emul_driver.hh:52
Loader::debugSymbolTable
SymbolTable debugSymbolTable
Global unified debugging symbol table (for target).
Definition: symtab.cc:40
divCeil
T divCeil(const T &a, const U &b)
Definition: intmath.hh:114
cp
Definition: cprintf.cc:37
Loader::ObjectFile::entryPoint
Addr entryPoint() const
Definition: object_file.hh:112
Loader::ObjectFile::symtab
const SymbolTable & symtab() const
Definition: object_file.hh:106
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
Process::clone
virtual void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *new_p, RegVal flags)
Definition: process.cc:163
EmulationPageTable
Definition: page_table.hh:49
Process::checkPathRedirect
std::string checkPathRedirect(const std::string &filename)
Redirect file path if it matches any keys initialized by system object.
Definition: process.cc:404
ADD_STAT
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
Definition: group.hh:71
SETranslatingPortProxy::Always
@ Always
Definition: se_translating_port_proxy.hh:51
Process::tryLoaders
static Process * tryLoaders(const ProcessParams &params, ::Loader::ObjectFile *obj_file)
Definition: process.cc:90
ArmISA::d
Bitfield< 9 > d
Definition: miscregs_types.hh:60
MipsISA::vaddr
vaddr
Definition: pra_constants.hh:275
Process::allocateMem
void allocateMem(Addr vaddr, int64_t size, bool clobber=false)
Definition: process.cc:306
statistics.hh
Process::sigchld
bool * sigchld
Definition: process.hh:283
Process::Loader::Loader
Loader()
Definition: process.cc:84
process.hh
EmulationPageTable::Clobber
@ Clobber
Definition: page_table.hh:93
Process::init
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: process.cc:267
Process::hostCwd
std::string hostCwd
Definition: process.hh:251
Process::_euid
uint64_t _euid
Definition: process.hh:258
Process::image
::Loader::MemoryImage image
Definition: process.hh:209
UNIT_COUNT
#define UNIT_COUNT
Definition: units.hh:49
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:148
Process::objFile
::Loader::ObjectFile * objFile
Definition: process.hh:208
Process::getBias
Addr getBias()
Definition: process.cc:469
Process::_uid
uint64_t _uid
Definition: process.hh:257
Process::contextIds
std::vector< ContextID > contextIds
Definition: process.hh:157
Process::interpImage
::Loader::MemoryImage interpImage
Definition: process.hh:210
CLONE_FILES
#define CLONE_FILES
Process::drivers
std::vector< EmulatedDriver * > drivers
Definition: process.hh:269
Process::drain
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
Definition: process.cc:299
EmulationPageTable::MappingFlags
MappingFlags
Definition: page_table.hh:92
SimObject::name
virtual const std::string name() const
Definition: sim_object.hh:182
ThreadContext::getVirtProxy
virtual PortProxy & getVirtProxy()=0
Loader::ObjectFile::getInterpreter
virtual ObjectFile * getInterpreter() const
Definition: object_file.hh:87
System::threads
Threads threads
Definition: system.hh:304
Process::mmapGrowsDown
virtual bool mmapGrowsDown() const
Does mmap region grow upward or downward from mmapEnd? Most platforms grow downward,...
Definition: process.hh:133
Process::absolutePath
std::string absolutePath(const std::string &path, bool host_fs)
Return an absolute path given a relative path paired with the current working directory of the proces...
Definition: process.cc:485
std
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:587
startswith
bool startswith(const char *s, const char *prefix)
Return true if 's' starts with the prefix string 'prefix'.
Definition: str.hh:239
Process::useArchPT
bool useArchPT
Definition: process.hh:163
Process::initState
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition: process.cc:277
roundUp
T roundUp(const T &val, const U &align)
This function is used to align addresses in memory.
Definition: intmath.hh:131
Process::_pid
uint64_t _pid
Definition: process.hh:263
Process::map
bool map(Addr vaddr, Addr paddr, int size, bool cacheable=true)
Maps a contiguous range of virtual addresses in this process's address space to a contiguous range of...
Definition: process.cc:384
CLONE_THREAD
#define CLONE_THREAD
emul_driver.hh
Process::release
std::string release
Definition: process.hh:254
Process::euid
uint64_t euid()
Definition: process.hh:81
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:64
Process::getStartPC
Addr getStartPC()
Definition: process.cc:477
Process::replicatePage
void replicatePage(Addr vaddr, Addr new_paddr, ThreadContext *old_tc, ThreadContext *new_tc, bool alloc_page)
Definition: process.cc:331
System::allocPhysPages
Addr allocPhysPages(int npages)
Allocate npages contiguous unused physical pages.
Definition: system.cc:376
normalize
static std::string normalize(const std::string &directory)
Definition: process.cc:103
se_translating_port_proxy.hh
Process::fixupFault
bool fixupFault(Addr vaddr)
Attempt to fix up a fault at vaddr by allocating a page on the stack.
Definition: process.cc:349
symtab.hh
SimObject::params
const Params & params() const
Definition: sim_object.hh:168
Process::system
System * system
Definition: process.hh:160
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
Process::uid
uint64_t uid()
Definition: process.hh:80
intmath.hh
fatal_if
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Definition: logging.hh:219
EmulationPageTable::map
virtual void map(Addr vaddr, Addr paddr, int64_t size, uint64_t flags=0)
Maps a virtual memory region to a physical memory region.
Definition: page_table.cc:45
page_table.hh
Process::_pgid
uint64_t _pgid
Definition: process.hh:265
CheckpointIn
Definition: serialize.hh:68
Process::_tgid
uint64_t _tgid
Definition: process.hh:266
Process::_ppid
uint64_t _ppid
Definition: process.hh:264
PortProxy::readBlob
void readBlob(Addr addr, void *p, int size) const
Higher level interfaces based on the above.
Definition: port_proxy.hh:177
Process::findDriver
EmulatedDriver * findDriver(std::string filename)
Find an emulated device driver.
Definition: process.cc:393
EmulationPageTable::pageSize
Addr pageSize()
Definition: page_table.hh:110
EmulationPageTable::translate
bool translate(Addr vaddr, Addr &paddr)
Translate function.
Definition: page_table.cc:140
object_file.hh
thread_context.hh
Serializable::path
static std::stack< std::string > path
Definition: serialize.hh:321
Process::childClearTID
uint64_t childClearTID
Calls a futex wakeup at the address specified by this pointer when this process exits.
Definition: process.hh:280
Process::memState
std::shared_ptr< MemState > memState
Definition: process.hh:274
RegVal
uint64_t RegVal
Definition: types.hh:174
Process::pid
uint64_t pid()
Definition: process.hh:84
syscall_desc.hh
Process::Process
Process(const ProcessParams &params, EmulationPageTable *pTable, ::Loader::ObjectFile *obj_file)
Definition: process.cc:110
Process::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: process.cc:355
SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:141

Generated on Tue Mar 23 2021 19:41:20 for gem5 by doxygen 1.8.17