gem5  v21.1.0.2
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 "cpu/thread_context.hh"
59 #include "mem/page_table.hh"
61 #include "params/Process.hh"
62 #include "sim/emul_driver.hh"
63 #include "sim/fd_array.hh"
64 #include "sim/fd_entry.hh"
65 #include "sim/redirect_path.hh"
66 #include "sim/syscall_desc.hh"
67 #include "sim/system.hh"
68 
69 namespace gem5
70 {
71 
72 namespace
73 {
74 
75 typedef std::vector<Process::Loader *> LoaderList;
76 
77 LoaderList &
78 process_loaders()
79 {
80  static LoaderList loaders;
81  return loaders;
82 }
83 
84 } // anonymous namespace
85 
87 {
88  process_loaders().emplace_back(this);
89 }
90 
91 Process *
92 Process::tryLoaders(const ProcessParams &params,
93  loader::ObjectFile *obj_file)
94 {
95  for (auto &loader_it : process_loaders()) {
96  Process *p = loader_it->load(params, obj_file);
97  if (p)
98  return p;
99  }
100 
101  return nullptr;
102 }
103 
104 static std::string
105 normalize(const std::string& directory)
106 {
107  if (directory.back() != '/')
108  return directory + '/';
109  return directory;
110 }
111 
113  loader::ObjectFile *obj_file)
117  useForClone(false),
118  pTable(pTable),
119  objFile(obj_file),
120  argv(params.cmd), envp(params.env),
122  tgtCwd(normalize(params.cwd)),
129  fds(std::make_shared<FDArray>(
130  params.input, params.output, params.errout)),
131  childClearTID(0),
132  ADD_STAT(numSyscalls, statistics::units::Count::get(),
133  "Number of system calls")
134 {
135  if (_pid >= System::maxPID)
136  fatal("_pid is too large: %d", _pid);
137 
138  auto ret_pair = system->PIDs.emplace(_pid);
139  if (!ret_pair.second)
140  fatal("_pid %d is already used", _pid);
141 
154  _tgid = params.pid;
155 
156  exitGroup = new bool();
157  sigchld = new bool();
158 
159  image = objFile->buildImage();
160 
161  if (loader::debugSymbolTable.empty())
163 }
164 
165 void
167  Process *np, RegVal flags)
168 {
169 #ifndef CLONE_VM
170 #define CLONE_VM 0
171 #endif
172 #ifndef CLONE_FILES
173 #define CLONE_FILES 0
174 #endif
175 #ifndef CLONE_THREAD
176 #define CLONE_THREAD 0
177 #endif
178 #ifndef CLONE_VFORK
179 #define CLONE_VFORK 0
180 #endif
181  if (CLONE_VM & flags) {
187  delete np->pTable;
188  np->pTable = pTable;
189 
190  np->memState = memState;
191  } else {
196  typedef std::vector<std::pair<Addr,Addr>> MapVec;
197  MapVec mappings;
198  pTable->getMappings(&mappings);
199 
200  for (auto map : mappings) {
201  Addr paddr, vaddr = map.first;
202  bool alloc_page = !(np->pTable->translate(vaddr, paddr));
203  np->replicatePage(vaddr, paddr, otc, ntc, alloc_page);
204  }
205 
206  *np->memState = *memState;
207  }
208 
209  if (CLONE_FILES & flags) {
215  np->fds = fds;
216  } else {
224  std::shared_ptr<FDArray> nfds = np->fds;
225  for (int tgt_fd = 0; tgt_fd < fds->getSize(); tgt_fd++) {
226  std::shared_ptr<FDEntry> this_fde = (*fds)[tgt_fd];
227  if (!this_fde) {
228  nfds->setFDEntry(tgt_fd, nullptr);
229  continue;
230  }
231  nfds->setFDEntry(tgt_fd, this_fde->clone());
232 
233  auto this_hbfd = std::dynamic_pointer_cast<HBFDEntry>(this_fde);
234  if (!this_hbfd)
235  continue;
236 
237  int this_sim_fd = this_hbfd->getSimFD();
238  if (this_sim_fd <= 2)
239  continue;
240 
241  int np_sim_fd = dup(this_sim_fd);
242  assert(np_sim_fd != -1);
243 
244  auto nhbfd = std::dynamic_pointer_cast<HBFDEntry>((*nfds)[tgt_fd]);
245  nhbfd->setSimFD(np_sim_fd);
246  }
247  }
248 
249  if (CLONE_THREAD & flags) {
250  np->_tgid = _tgid;
251  delete np->exitGroup;
252  np->exitGroup = exitGroup;
253  }
254 
255  if (CLONE_VFORK & flags) {
256  np->vforkContexts.push_back(otc->contextId());
257  }
258 
259  np->argv.insert(np->argv.end(), argv.begin(), argv.end());
260  np->envp.insert(np->envp.end(), envp.begin(), envp.end());
261 }
262 
263 void
265 {
267  for (it = contextIds.begin(); it != contextIds.end(); it++) {
268  if (*it == context_id) {
269  contextIds.erase(it);
270  return;
271  }
272  }
273  warn("Unable to find thread context to revoke");
274 }
275 
276 void
278 {
279  // Patch the ld_bias for dynamic executables.
280  updateBias();
281 
282  if (objFile->getInterpreter())
284 }
285 
286 void
288 {
289  if (contextIds.empty())
290  fatal("Process %s is not associated with any HW contexts!\n", name());
291 
292  // first thread context for this process... initialize & enable
294 
295  // mark this context as active so it will start ticking.
296  tc->activate();
297 
298  pTable->initState();
299 
302 
303  // load object file into target memory
306 }
307 
310 {
311  fds->updateFileOffsets();
312  return DrainState::Drained;
313 }
314 
315 void
316 Process::allocateMem(Addr vaddr, int64_t size, bool clobber)
317 {
318  // Check if the page has been mapped by other cores if not to clobber.
319  // When running multithreaded programs in SE-mode with DerivO3CPU model,
320  // there are cases where two or more cores have page faults on the same
321  // page in nearby ticks. When the cores try to handle the faults at the
322  // commit stage (also in nearby ticks/cycles), the first core will ask for
323  // a physical page frame to map with the virtual page. Other cores can
324  // return if the page has been mapped and `!clobber`.
325  if (!clobber) {
327  if (pte) {
328  warn("Process::allocateMem: addr %#x already mapped\n", vaddr);
329  return;
330  }
331  }
332 
333  int npages = divCeil(size, pTable->pageSize());
334  Addr paddr = system->allocPhysPages(npages);
335  pTable->map(vaddr, paddr, size,
336  clobber ? EmulationPageTable::Clobber :
338 }
339 
340 void
342  ThreadContext *new_tc, bool allocate_page)
343 {
344  if (allocate_page)
345  new_paddr = system->allocPhysPages(1);
346 
347  // Read from old physical page.
348  uint8_t buf_p[pTable->pageSize()];
349  old_tc->getVirtProxy().readBlob(vaddr, buf_p, sizeof(buf_p));
350 
351  // Create new mapping in process address space by clobbering existing
352  // mapping (if any existed) and then write to the new physical page.
353  bool clobber = true;
354  pTable->map(vaddr, new_paddr, sizeof(buf_p), clobber);
355  new_tc->getVirtProxy().writeBlob(vaddr, buf_p, sizeof(buf_p));
356 }
357 
358 bool
360 {
361  return memState->fixupFault(vaddr);
362 }
363 
364 void
366 {
367  memState->serialize(cp);
368  pTable->serialize(cp);
369  fds->serialize(cp);
370 
376  warn("Checkpoints for pipes, device drivers and sockets do not work.");
377 }
378 
379 void
381 {
382  memState->unserialize(cp);
383  pTable->unserialize(cp);
384  fds->unserialize(cp);
389  warn("Checkpoints for pipes, device drivers and sockets do not work.");
390  // The above returns a bool so that you could do something if you don't
391  // find the param in the checkpoint if you wanted to, like set a default
392  // but in this case we'll just stick with the instantiated value if not
393  // found.
394 }
395 
396 bool
397 Process::map(Addr vaddr, Addr paddr, int size, bool cacheable)
398 {
399  pTable->map(vaddr, paddr, size,
400  cacheable ? EmulationPageTable::MappingFlags(0) :
402  return true;
403 }
404 
406 Process::findDriver(std::string filename)
407 {
408  for (EmulatedDriver *d : drivers) {
409  if (d->match(filename))
410  return d;
411  }
412 
413  return nullptr;
414 }
415 
416 std::string
417 Process::checkPathRedirect(const std::string &filename)
418 {
419  // If the input parameter contains a relative path, convert it.
420  // The target version of the current working directory is fine since
421  // we immediately convert it using redirect paths into a host version.
422  auto abs_path = absolutePath(filename, false);
423 
424  for (auto path : system->redirectPaths) {
425  // Search through the redirect paths to see if a starting substring of
426  // our path falls into any buckets which need to redirected.
427  if (startswith(abs_path, path->appPath())) {
428  std::string tail = abs_path.substr(path->appPath().size());
429 
430  // If this path needs to be redirected, search through a list
431  // of targets to see if we can match a valid file (or directory).
432  for (auto host_path : path->hostPaths()) {
433  if (access((host_path + tail).c_str(), R_OK) == 0) {
434  // Return the valid match.
435  return host_path + tail;
436  }
437  }
438  // The path needs to be redirected, but the file or directory
439  // does not exist on the host filesystem. Return the first
440  // host path as a default.
441  return path->hostPaths()[0] + tail;
442  }
443  }
444 
445  // The path does not need to be redirected.
446  return abs_path;
447 }
448 
449 void
451 {
452  auto *interp = objFile->getInterpreter();
453 
454  if (!interp || !interp->relocatable())
455  return;
456 
457  // Determine how large the interpreters footprint will be in the process
458  // address space.
459  Addr interp_mapsize = roundUp(interp->mapSize(), pTable->pageSize());
460 
461  // We are allocating the memory area; set the bias to the lowest address
462  // in the allocated memory region.
463  Addr mmap_end = memState->getMmapEnd();
464  Addr ld_bias = mmapGrowsDown() ? mmap_end - interp_mapsize : mmap_end;
465 
466  // Adjust the process mmap area to give the interpreter room; the real
467  // execve system call would just invoke the kernel's internal mmap
468  // functions to make these adjustments.
469  mmap_end = mmapGrowsDown() ? ld_bias : mmap_end + interp_mapsize;
470  memState->setMmapEnd(mmap_end);
471 
472  interp->updateBias(ld_bias);
473 }
474 
477 {
478  return objFile->getInterpreter();
479 }
480 
481 Addr
483 {
484  auto *interp = getInterpreter();
485 
486  return interp ? interp->bias() : objFile->bias();
487 }
488 
489 Addr
491 {
492  auto *interp = getInterpreter();
493 
494  return interp ? interp->entryPoint() : objFile->entryPoint();
495 }
496 
497 std::string
498 Process::absolutePath(const std::string &filename, bool host_filesystem)
499 {
500  if (filename.empty() || startswith(filename, "/"))
501  return filename;
502 
503  // Construct the absolute path given the current working directory for
504  // either the host filesystem or target filesystem. The distinction only
505  // matters if filesystem redirection is utilized in the simulation.
506  auto path_base = std::string();
507  if (host_filesystem) {
508  path_base = hostCwd;
509  assert(!hostCwd.empty());
510  } else {
511  path_base = tgtCwd;
512  assert(!tgtCwd.empty());
513  }
514 
515  // Add a trailing '/' if the current working directory did not have one.
516  normalize(path_base);
517 
518  // Append the filename onto the current working path.
519  auto absolute_path = path_base + filename;
520 
521  return absolute_path;
522 }
523 
524 Process *
525 ProcessParams::create() const
526 {
527  // If not specified, set the executable parameter equal to the
528  // simulated system's zeroth command line parameter
529  const std::string &exec = (executable == "") ? cmd[0] : executable;
530 
531  auto *obj_file = loader::createObjectFile(exec);
532  fatal_if(!obj_file, "Cannot load object file %s.", exec);
533 
534  Process *process = Process::tryLoaders(*this, obj_file);
535  fatal_if(!process, "Unknown error creating process object.");
536 
537  return process;
538 }
539 
540 } // namespace gem5
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:189
gem5::normalize
static std::string normalize(const std::string &directory)
Definition: process.cc:105
gem5::Process::euid
uint64_t euid()
Definition: process.hh:83
gem5::Process::drivers
std::vector< EmulatedDriver * > drivers
Definition: process.hh:271
gem5::SETranslatingPortProxy
Definition: se_translating_port_proxy.hh:49
gem5::EmulationPageTable::pageSize
Addr pageSize()
Definition: page_table.hh:114
gem5::EmulationPageTable
Definition: page_table.hh:52
gem5::System::PIDs
std::set< int > PIDs
Process set to track which PIDs have already been allocated.
Definition: system.hh:631
warn
#define warn(...)
Definition: logging.hh:245
gem5::loader::ObjectFile
Definition: object_file.hh:85
gem5::PortProxy::writeBlob
void writeBlob(Addr addr, const void *p, int size) const
Same as tryWriteBlob, but insists on success.
Definition: port_proxy.hh:192
gem5::RegVal
uint64_t RegVal
Definition: types.hh:173
system.hh
gem5::Process::interpImage
loader::MemoryImage interpImage
Definition: process.hh:212
gem5::Process::clone
virtual void clone(ThreadContext *old_tc, ThreadContext *new_tc, Process *new_p, RegVal flags)
Definition: process.cc:166
gem5::Process::useArchPT
bool useArchPT
Definition: process.hh:165
fd_entry.hh
gem5::Process::findDriver
EmulatedDriver * findDriver(std::string filename)
Find an emulated device driver.
Definition: process.cc:406
gem5::EmulationPageTable::Uncacheable
@ Uncacheable
Definition: page_table.hh:98
gem5::Process::getStartPC
Addr getStartPC()
Definition: process.cc:490
gem5::Process::initVirtMem
std::unique_ptr< SETranslatingPortProxy > initVirtMem
Definition: process.hh:174
gem5::loader::ObjectFile::entryPoint
Addr entryPoint() const
Definition: object_file.hh:125
gem5::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:252
gem5::Process::numSyscalls
statistics::Scalar numSyscalls
Definition: process.hh:291
CLONE_VM
#define CLONE_VM
gem5::Process::getBias
Addr getBias()
Definition: process.cc:482
gem5::output
static void output(const char *filename)
Definition: debug.cc:66
gem5::Serializable::path
static std::stack< std::string > path
Definition: serialize.hh:315
gem5::EmulationPageTable::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: page_table.cc:172
gem5::Process::_pgid
uint64_t _pgid
Definition: process.hh:267
gem5::Process::release
std::string release
Definition: process.hh:256
gem5::loader::ObjectFile::getInterpreter
virtual ObjectFile * getInterpreter() const
Definition: object_file.hh:99
gem5::CheckpointIn
Definition: serialize.hh:68
gem5::EmulationPageTable::initState
virtual void initState()
Definition: page_table.hh:105
gem5::Process::updateBias
void updateBias()
Definition: process.cc:450
gem5::Process::initState
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition: process.cc:287
redirect_path.hh
gem5::startswith
bool startswith(const char *s, const char *prefix)
Return true if 's' starts with the prefix string 'prefix'.
Definition: str.hh:242
gem5::EmulationPageTable::translate
bool translate(Addr vaddr, Addr &paddr)
Translate function.
Definition: page_table.cc:143
gem5::ThreadContext::contextId
virtual ContextID contextId() const =0
gem5::Process::_pid
uint64_t _pid
Definition: process.hh:265
gem5::ThreadContext::activate
virtual void activate()=0
Set the status to Active.
gem5::Process::egid
uint64_t egid()
Definition: process.hh:85
std::vector
STL vector class.
Definition: stl.hh:37
gem5::Process::pid
uint64_t pid()
Definition: process.hh:86
gem5::EmulationPageTable::getMappings
void getMappings(std::vector< std::pair< Addr, Addr >> *addr_mappings)
Definition: page_table.cc:97
gem5::EmulationPageTable::lookup
const Entry * lookup(Addr vaddr)
Lookup function.
Definition: page_table.cc:133
gem5::Process::_euid
uint64_t _euid
Definition: process.hh:260
fd_array.hh
gem5::Process::fds
std::shared_ptr< FDArray > fds
Definition: process.hh:273
gem5::loader::ObjectFile::symtab
const SymbolTable & symtab() const
Definition: object_file.hh:119
gem5::Process::gid
uint64_t gid()
Definition: process.hh:84
gem5::Process::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: process.cc:365
gem5::Process::useForClone
bool useForClone
Definition: process.hh:169
gem5::Process::memState
std::shared_ptr< MemState > memState
Definition: process.hh:276
gem5::Process::allocateMem
void allocateMem(Addr vaddr, int64_t size, bool clobber=false)
Definition: process.cc:316
gem5::Process::fixupFault
bool fixupFault(Addr vaddr)
Attempt to fix up a fault at vaddr by allocating a page on the stack.
Definition: process.cc:359
gem5::Process::childClearTID
uint64_t childClearTID
Calls a futex wakeup at the address specified by this pointer when this process exits.
Definition: process.hh:282
gem5::Process::Loader::Loader
Loader()
Definition: process.cc:86
gem5::System::redirectPaths
std::vector< RedirectPath * > redirectPaths
Definition: system.hh:640
gem5::Process::uid
uint64_t uid()
Definition: process.hh:82
gem5::Process::_tgid
uint64_t _tgid
Definition: process.hh:268
gem5::DrainState
DrainState
Object drain/handover states.
Definition: drain.hh:74
gem5::Process::ppid
uint64_t ppid()
Definition: process.hh:87
gem5::Process::tryLoaders
static Process * tryLoaders(const ProcessParams &params, loader::ObjectFile *obj_file)
Definition: process.cc:92
gem5::ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:93
gem5::Process::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: process.cc:380
gem5::Named::name
virtual std::string name() const
Definition: named.hh:47
gem5::ThreadContext::getVirtProxy
virtual PortProxy & getVirtProxy()=0
gem5::SimObject::params
const Params & params() const
Definition: sim_object.hh:176
ADD_STAT
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
Definition: group.hh:75
gem5::ArmISA::d
Bitfield< 9 > d
Definition: misc_types.hh:63
gem5::Process::pTable
EmulationPageTable * pTable
Definition: process.hh:171
CLONE_VFORK
#define CLONE_VFORK
gem5::MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:326
statistics.hh
gem5::Process::exitGroup
bool * exitGroup
Definition: process.hh:275
process.hh
gem5::Process::argv
std::vector< std::string > argv
Definition: process.hh:213
gem5::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:498
gem5::loader::ObjectFile::bias
virtual Addr bias() const
Definition: object_file.hh:111
gem5::Process::executable
std::string executable
Definition: process.hh:215
gem5::Process::Process
Process(const ProcessParams &params, EmulationPageTable *pTable, loader::ObjectFile *obj_file)
Definition: process.cc:112
gem5::Process::checkPathRedirect
std::string checkPathRedirect(const std::string &filename)
Redirect file path if it matches any keys initialized by system object.
Definition: process.cc:417
gem5::PortProxy::readBlob
void readBlob(Addr addr, void *p, int size) const
Higher level interfaces based on the above.
Definition: port_proxy.hh:182
gem5::SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:146
gem5::DrainState::Drained
@ Drained
Buffers drained, ready for serialization/handover.
gem5::Process::replicatePage
void replicatePage(Addr vaddr, Addr new_paddr, ThreadContext *old_tc, ThreadContext *new_tc, bool alloc_page)
Definition: process.cc:341
gem5::Process::_egid
uint64_t _egid
Definition: process.hh:262
gem5::System::allocPhysPages
Addr allocPhysPages(int npages, int poolID=0)
Allocate npages contiguous unused physical pages.
Definition: system.cc:355
gem5::Process::getInterpreter
loader::ObjectFile * getInterpreter()
Definition: process.cc:476
gem5::SETranslatingPortProxy::Always
@ Always
Definition: se_translating_port_proxy.hh:55
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::Process::envp
std::vector< std::string > envp
Definition: process.hh:214
gem5::System::maxPID
static const int maxPID
Definition: system.hh:628
CLONE_FILES
#define CLONE_FILES
gem5::loader::createObjectFile
ObjectFile * createObjectFile(const std::string &fname, bool raw)
Definition: object_file.cc:123
gem5::divCeil
static constexpr T divCeil(const T &a, const U &b)
Definition: intmath.hh:110
gem5::Process
Definition: process.hh:67
gem5::EmulatedDriver
EmulatedDriver is an abstract base class for fake SE-mode device drivers.
Definition: emul_driver.hh:55
gem5::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:48
gem5::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:397
gem5::System::threads
Threads threads
Definition: system.hh:316
std
Overload hash function for BasicBlockRange type.
Definition: types.hh:111
gem5::FDArray
Definition: fd_array.hh:48
gem5::Process::sigchld
bool * sigchld
Definition: process.hh:285
gem5::Process::_gid
uint64_t _gid
Definition: process.hh:261
CLONE_THREAD
#define CLONE_THREAD
gem5::Process::_ppid
uint64_t _ppid
Definition: process.hh:266
gem5::roundUp
static constexpr T roundUp(const T &val, const U &align)
This function is used to align addresses in memory.
Definition: intmath.hh:260
gem5::Process::system
System * system
Definition: process.hh:162
emul_driver.hh
gem5::Process::mmapGrowsDown
virtual bool mmapGrowsDown() const
Does mmap region grow upward or downward from mmapEnd? Most platforms grow downward,...
Definition: process.hh:135
gem5::loader::MemoryImage::write
bool write(const PortProxy &proxy) const
Definition: memory_image.cc:54
gem5::Process::pgid
uint64_t pgid()
Definition: process.hh:88
gem5::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:264
gem5::Process::init
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: process.cc:277
gem5::CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:66
gem5::Process::_uid
uint64_t _uid
Definition: process.hh:259
gem5::Process::contextIds
std::vector< ContextID > contextIds
Definition: process.hh:159
se_translating_port_proxy.hh
gem5::loader::ImageFile::buildImage
virtual MemoryImage buildImage() const =0
gem5::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:309
symtab.hh
gem5::MipsISA::vaddr
vaddr
Definition: pra_constants.hh:278
gem5::loader::debugSymbolTable
SymbolTable debugSymbolTable
Global unified debugging symbol table (for target).
Definition: symtab.cc:44
gem5::Process::hostCwd
std::string hostCwd
Definition: process.hh:253
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:225
page_table.hh
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::Process::vforkContexts
std::vector< ContextID > vforkContexts
Definition: process.hh:288
gem5::Process::kvmInSE
bool kvmInSE
Definition: process.hh:167
gem5::EmulationPageTable::Entry
Definition: page_table.hh:55
object_file.hh
gem5::EmulationPageTable::Clobber
@ Clobber
Definition: page_table.hh:97
gem5::Process::image
loader::MemoryImage image
Definition: process.hh:211
thread_context.hh
gem5::Process::objFile
loader::ObjectFile * objFile
Definition: process.hh:210
syscall_desc.hh
gem5::EmulationPageTable::MappingFlags
MappingFlags
Definition: page_table.hh:95
gem5::EmulationPageTable::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: page_table.cc:189

Generated on Tue Sep 21 2021 12:24:36 for gem5 by doxygen 1.8.17