gem5  v21.0.1.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) 2010, 2012, 2017-2018 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2007-2008 The Florida State University
15  * All rights reserved.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions are
19  * met: redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer;
21  * redistributions in binary form must reproduce the above copyright
22  * notice, this list of conditions and the following disclaimer in the
23  * documentation and/or other materials provided with the distribution;
24  * neither the name of the copyright holders nor the names of its
25  * contributors may be used to endorse or promote products derived from
26  * this software without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  */
40 
41 #include "arch/arm/process.hh"
42 
43 #include "arch/arm/isa_traits.hh"
44 #include "arch/arm/types.hh"
47 #include "base/logging.hh"
48 #include "cpu/thread_context.hh"
49 #include "debug/Stack.hh"
50 #include "mem/page_table.hh"
51 #include "params/Process.hh"
52 #include "sim/aux_vector.hh"
53 #include "sim/byteswap.hh"
54 #include "sim/process_impl.hh"
55 #include "sim/syscall_return.hh"
56 #include "sim/system.hh"
57 
58 using namespace ArmISA;
59 
60 ArmProcess::ArmProcess(const ProcessParams &params,
61  ::Loader::ObjectFile *objFile, ::Loader::Arch _arch)
62  : Process(params,
63  new EmulationPageTable(params.name, params.pid, PageBytes),
64  objFile),
65  arch(_arch)
66 {
67  fatal_if(params.useArchPT, "Arch page tables not implemented.");
68 }
69 
70 ArmProcess32::ArmProcess32(const ProcessParams &params,
71  ::Loader::ObjectFile *objFile, ::Loader::Arch _arch)
72  : ArmProcess(params, objFile, _arch)
73 {
74  Addr brk_point = roundUp(image.maxAddr(), PageBytes);
75  Addr stack_base = 0xbf000000L;
76  Addr max_stack_size = 8 * 1024 * 1024;
77  Addr next_thread_stack_base = stack_base - max_stack_size;
78  Addr mmap_end = 0x40000000L;
79 
80  memState = std::make_shared<MemState>(
81  this, brk_point, stack_base, max_stack_size,
82  next_thread_stack_base, mmap_end);
83 }
84 
86  const ProcessParams &params, ::Loader::ObjectFile *objFile,
87  ::Loader::Arch _arch)
88  : ArmProcess(params, objFile, _arch)
89 {
90  Addr brk_point = roundUp(image.maxAddr(), PageBytes);
91  Addr stack_base = 0x7fffff0000L;
92  Addr max_stack_size = 8 * 1024 * 1024;
93  Addr next_thread_stack_base = stack_base - max_stack_size;
94  Addr mmap_end = 0x4000000000L;
95 
96  memState = std::make_shared<MemState>(
97  this, brk_point, stack_base, max_stack_size,
98  next_thread_stack_base, mmap_end);
99 }
100 
101 void
103 {
105  argsInit<uint32_t>(PageBytes, INTREG_SP);
106  for (auto id: contextIds) {
107  ThreadContext *tc = system->threads[id];
108  CPACR cpacr = tc->readMiscReg(MISCREG_CPACR);
109  // Enable the floating point coprocessors.
110  cpacr.cp10 = 0x3;
111  cpacr.cp11 = 0x3;
112  tc->setMiscReg(MISCREG_CPACR, cpacr);
113  // Generically enable floating point support.
114  FPEXC fpexc = tc->readMiscReg(MISCREG_FPEXC);
115  fpexc.en = 1;
116  tc->setMiscReg(MISCREG_FPEXC, fpexc);
117  }
118 }
119 
120 void
122 {
124  argsInit<uint64_t>(PageBytes, INTREG_SP0);
125  for (auto id: contextIds) {
126  ThreadContext *tc = system->threads[id];
127  CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
128  cpsr.mode = MODE_EL0T;
129  tc->setMiscReg(MISCREG_CPSR, cpsr);
130  CPACR cpacr = tc->readMiscReg(MISCREG_CPACR_EL1);
131  // Enable the floating point coprocessors.
132  cpacr.cp10 = 0x3;
133  cpacr.cp11 = 0x3;
134  // Enable SVE.
135  cpacr.zen = 0x3;
136  tc->setMiscReg(MISCREG_CPACR_EL1, cpacr);
137  // Generically enable floating point support.
138  FPEXC fpexc = tc->readMiscReg(MISCREG_FPEXC);
139  fpexc.en = 1;
140  tc->setMiscReg(MISCREG_FPEXC, fpexc);
141  }
142 }
143 
144 uint32_t
146 {
147  enum ArmCpuFeature {
148  Arm_Swp = 1 << 0,
149  Arm_Half = 1 << 1,
150  Arm_Thumb = 1 << 2,
151  Arm_26Bit = 1 << 3,
152  Arm_FastMult = 1 << 4,
153  Arm_Fpa = 1 << 5,
154  Arm_Vfp = 1 << 6,
155  Arm_Edsp = 1 << 7,
156  Arm_Java = 1 << 8,
157  Arm_Iwmmxt = 1 << 9,
158  Arm_Crunch = 1 << 10,
159  Arm_ThumbEE = 1 << 11,
160  Arm_Neon = 1 << 12,
161  Arm_Vfpv3 = 1 << 13,
162  Arm_Vfpv3d16 = 1 << 14
163  };
164 
165  return Arm_Swp | Arm_Half | Arm_Thumb | Arm_FastMult |
166  Arm_Vfp | Arm_Edsp | Arm_ThumbEE | Arm_Neon |
167  Arm_Vfpv3 | Arm_Vfpv3d16;
168 }
169 
170 uint32_t
172 {
173  // In order to know what these flags mean, please refer to Linux
174  // /Documentation/arm64/elf_hwcaps.txt text file.
175  enum ArmCpuFeature {
176  Arm_Fp = 1 << 0,
177  Arm_Asimd = 1 << 1,
178  Arm_Evtstrm = 1 << 2,
179  Arm_Aes = 1 << 3,
180  Arm_Pmull = 1 << 4,
181  Arm_Sha1 = 1 << 5,
182  Arm_Sha2 = 1 << 6,
183  Arm_Crc32 = 1 << 7,
184  Arm_Atomics = 1 << 8,
185  Arm_Fphp = 1 << 9,
186  Arm_Asimdhp = 1 << 10,
187  Arm_Cpuid = 1 << 11,
188  Arm_Asimdrdm = 1 << 12,
189  Arm_Jscvt = 1 << 13,
190  Arm_Fcma = 1 << 14,
191  Arm_Lrcpc = 1 << 15,
192  Arm_Dcpop = 1 << 16,
193  Arm_Sha3 = 1 << 17,
194  Arm_Sm3 = 1 << 18,
195  Arm_Sm4 = 1 << 19,
196  Arm_Asimddp = 1 << 20,
197  Arm_Sha512 = 1 << 21,
198  Arm_Sve = 1 << 22,
199  Arm_Asimdfhm = 1 << 23,
200  Arm_Dit = 1 << 24,
201  Arm_Uscat = 1 << 25,
202  Arm_Ilrcpc = 1 << 26,
203  Arm_Flagm = 1 << 27
204  };
205 
206  uint32_t hwcap = 0;
207 
209 
210  const AA64PFR0 pf_r0 = tc->readMiscReg(MISCREG_ID_AA64PFR0_EL1);
211 
212  hwcap |= (pf_r0.fp == 0) ? Arm_Fp : 0;
213  hwcap |= (pf_r0.fp == 1) ? Arm_Fphp | Arm_Fp : 0;
214  hwcap |= (pf_r0.advsimd == 0) ? Arm_Asimd : 0;
215  hwcap |= (pf_r0.advsimd == 1) ? Arm_Asimdhp | Arm_Asimd : 0;
216  hwcap |= (pf_r0.sve >= 1) ? Arm_Sve : 0;
217  hwcap |= (pf_r0.dit >= 1) ? Arm_Dit : 0;
218 
219  const AA64ISAR0 isa_r0 = tc->readMiscReg(MISCREG_ID_AA64ISAR0_EL1);
220 
221  hwcap |= (isa_r0.aes >= 1) ? Arm_Aes : 0;
222  hwcap |= (isa_r0.aes >= 2) ? Arm_Pmull : 0;
223  hwcap |= (isa_r0.sha1 >= 1) ? Arm_Sha1 : 0;
224  hwcap |= (isa_r0.sha2 >= 1) ? Arm_Sha2 : 0;
225  hwcap |= (isa_r0.sha2 >= 2) ? Arm_Sha512 : 0;
226  hwcap |= (isa_r0.crc32 >= 1) ? Arm_Crc32 : 0;
227  hwcap |= (isa_r0.atomic >= 1) ? Arm_Atomics : 0;
228  hwcap |= (isa_r0.rdm >= 1) ? Arm_Asimdrdm : 0;
229  hwcap |= (isa_r0.sha3 >= 1) ? Arm_Sha3 : 0;
230  hwcap |= (isa_r0.sm3 >= 1) ? Arm_Sm3 : 0;
231  hwcap |= (isa_r0.sm4 >= 1) ? Arm_Sm4 : 0;
232  hwcap |= (isa_r0.dp >= 1) ? Arm_Asimddp : 0;
233  hwcap |= (isa_r0.fhm >= 1) ? Arm_Asimdfhm : 0;
234  hwcap |= (isa_r0.ts >= 1) ? Arm_Flagm : 0;
235 
236  const AA64ISAR1 isa_r1 = tc->readMiscReg(MISCREG_ID_AA64ISAR1_EL1);
237 
238  hwcap |= (isa_r1.dpb >= 1) ? Arm_Dcpop : 0;
239  hwcap |= (isa_r1.jscvt >= 1) ? Arm_Jscvt : 0;
240  hwcap |= (isa_r1.fcma >= 1) ? Arm_Fcma : 0;
241  hwcap |= (isa_r1.lrcpc >= 1) ? Arm_Lrcpc : 0;
242  hwcap |= (isa_r1.lrcpc >= 2) ? Arm_Ilrcpc : 0;
243 
244  const AA64MMFR2 mm_fr2 = tc->readMiscReg(MISCREG_ID_AA64MMFR2_EL1);
245 
246  hwcap |= (mm_fr2.at >= 1) ? Arm_Uscat : 0;
247 
248  return hwcap;
249 }
250 
251 template <class IntType>
252 void
253 ArmProcess::argsInit(int pageSize, IntRegIndex spIndex)
254 {
255  int intSize = sizeof(IntType);
256 
258 
259  std::string filename;
260  if (argv.size() < 1)
261  filename = "";
262  else
263  filename = argv[0];
264 
265  //We want 16 byte alignment
266  uint64_t align = 16;
267 
268  //Setup the auxilliary vectors. These will already have endian conversion.
269  //Auxilliary vectors are loaded only for elf formatted executables.
270  auto *elfObject = dynamic_cast<::Loader::ElfObject *>(objFile);
271  if (elfObject) {
272 
273  if (objFile->getOpSys() == ::Loader::Linux) {
274  IntType features = armHwcap<IntType>();
275 
276  //Bits which describe the system hardware capabilities
277  //XXX Figure out what these should be
278  auxv.emplace_back(M5_AT_HWCAP, features);
279  //Frequency at which times() increments
280  auxv.emplace_back(M5_AT_CLKTCK, 0x64);
281  //Whether to enable "secure mode" in the executable
282  auxv.emplace_back(M5_AT_SECURE, 0);
283  // Pointer to 16 bytes of random data
284  auxv.emplace_back(M5_AT_RANDOM, 0);
285  //The filename of the program
286  auxv.emplace_back(M5_AT_EXECFN, 0);
287  //The string "v71" -- ARM v7 architecture
288  auxv.emplace_back(M5_AT_PLATFORM, 0);
289  }
290 
291  //The system page size
292  auxv.emplace_back(M5_AT_PAGESZ, ArmISA::PageBytes);
293  // For statically linked executables, this is the virtual address of
294  // the program header tables if they appear in the executable image
295  auxv.emplace_back(M5_AT_PHDR, elfObject->programHeaderTable());
296  // This is the size of a program header entry from the elf file.
297  auxv.emplace_back(M5_AT_PHENT, elfObject->programHeaderSize());
298  // This is the number of program headers from the original elf file.
299  auxv.emplace_back(M5_AT_PHNUM, elfObject->programHeaderCount());
300  // This is the base address of the ELF interpreter; it should be
301  // zero for static executables or contain the base address for
302  // dynamic executables.
303  auxv.emplace_back(M5_AT_BASE, getBias());
304  //XXX Figure out what this should be.
305  auxv.emplace_back(M5_AT_FLAGS, 0);
306  //The entry point to the program
307  auxv.emplace_back(M5_AT_ENTRY, objFile->entryPoint());
308  //Different user and group IDs
309  auxv.emplace_back(M5_AT_UID, uid());
310  auxv.emplace_back(M5_AT_EUID, euid());
311  auxv.emplace_back(M5_AT_GID, gid());
312  auxv.emplace_back(M5_AT_EGID, egid());
313  }
314 
315  //Figure out how big the initial stack nedes to be
316 
317  // A sentry NULL void pointer at the top of the stack.
318  int sentry_size = intSize;
319 
320  std::string platform = "v71";
321  int platform_size = platform.size() + 1;
322 
323  // Bytes for AT_RANDOM above, we'll just keep them 0
324  int aux_random_size = 16; // as per the specification
325 
326  // The aux vectors are put on the stack in two groups. The first group are
327  // the vectors that are generated as the elf is loaded. The second group
328  // are the ones that were computed ahead of time and include the platform
329  // string.
330  int aux_data_size = filename.size() + 1;
331 
332  int env_data_size = 0;
333  for (int i = 0; i < envp.size(); ++i) {
334  env_data_size += envp[i].size() + 1;
335  }
336  int arg_data_size = 0;
337  for (int i = 0; i < argv.size(); ++i) {
338  arg_data_size += argv[i].size() + 1;
339  }
340 
341  int info_block_size =
342  sentry_size + env_data_size + arg_data_size +
343  aux_data_size + platform_size + aux_random_size;
344 
345  //Each auxilliary vector is two 4 byte words
346  int aux_array_size = intSize * 2 * (auxv.size() + 1);
347 
348  int envp_array_size = intSize * (envp.size() + 1);
349  int argv_array_size = intSize * (argv.size() + 1);
350 
351  int argc_size = intSize;
352 
353  //Figure out the size of the contents of the actual initial frame
354  int frame_size =
355  info_block_size +
356  aux_array_size +
357  envp_array_size +
358  argv_array_size +
359  argc_size;
360 
361  //There needs to be padding after the auxiliary vector data so that the
362  //very bottom of the stack is aligned properly.
363  int partial_size = frame_size;
364  int aligned_partial_size = roundUp(partial_size, align);
365  int aux_padding = aligned_partial_size - partial_size;
366 
367  int space_needed = frame_size + aux_padding;
368 
369  memState->setStackMin(memState->getStackBase() - space_needed);
370  memState->setStackMin(roundDown(memState->getStackMin(), align));
371  memState->setStackSize(memState->getStackBase() - memState->getStackMin());
372 
373  // map memory
374  memState->mapRegion(roundDown(memState->getStackMin(), pageSize),
375  roundUp(memState->getStackSize(), pageSize), "stack");
376 
377  // map out initial stack contents
378  IntType sentry_base = memState->getStackBase() - sentry_size;
379  IntType aux_data_base = sentry_base - aux_data_size;
380  IntType env_data_base = aux_data_base - env_data_size;
381  IntType arg_data_base = env_data_base - arg_data_size;
382  IntType platform_base = arg_data_base - platform_size;
383  IntType aux_random_base = platform_base - aux_random_size;
384  IntType auxv_array_base = aux_random_base - aux_array_size - aux_padding;
385  IntType envp_array_base = auxv_array_base - envp_array_size;
386  IntType argv_array_base = envp_array_base - argv_array_size;
387  IntType argc_base = argv_array_base - argc_size;
388 
389  DPRINTF(Stack, "The addresses of items on the initial stack:\n");
390  DPRINTF(Stack, "0x%x - aux data\n", aux_data_base);
391  DPRINTF(Stack, "0x%x - env data\n", env_data_base);
392  DPRINTF(Stack, "0x%x - arg data\n", arg_data_base);
393  DPRINTF(Stack, "0x%x - random data\n", aux_random_base);
394  DPRINTF(Stack, "0x%x - platform base\n", platform_base);
395  DPRINTF(Stack, "0x%x - auxv array\n", auxv_array_base);
396  DPRINTF(Stack, "0x%x - envp array\n", envp_array_base);
397  DPRINTF(Stack, "0x%x - argv array\n", argv_array_base);
398  DPRINTF(Stack, "0x%x - argc \n", argc_base);
399  DPRINTF(Stack, "0x%x - stack min\n", memState->getStackMin());
400 
401  // write contents to stack
402 
403  // figure out argc
404  IntType argc = argv.size();
405  IntType guestArgc = htole(argc);
406 
407  //Write out the sentry void *
408  IntType sentry_NULL = 0;
409  initVirtMem->writeBlob(sentry_base, &sentry_NULL, sentry_size);
410 
411  //Fix up the aux vectors which point to other data
412  for (int i = auxv.size() - 1; i >= 0; i--) {
413  if (auxv[i].type == M5_AT_PLATFORM) {
414  auxv[i].val = platform_base;
415  initVirtMem->writeString(platform_base, platform.c_str());
416  } else if (auxv[i].type == M5_AT_EXECFN) {
417  auxv[i].val = aux_data_base;
418  initVirtMem->writeString(aux_data_base, filename.c_str());
419  } else if (auxv[i].type == M5_AT_RANDOM) {
420  auxv[i].val = aux_random_base;
421  // Just leave the value 0, we don't want randomness
422  }
423  }
424 
425  //Copy the aux stuff
426  Addr auxv_array_end = auxv_array_base;
427  for (const auto &aux: auxv) {
428  initVirtMem->write(auxv_array_end, aux, GuestByteOrder);
429  auxv_array_end += sizeof(aux);
430  }
431  //Write out the terminating zeroed auxillary vector
432  const AuxVector<IntType> zero(0, 0);
433  initVirtMem->write(auxv_array_end, zero);
434  auxv_array_end += sizeof(zero);
435 
436  copyStringArray(envp, envp_array_base, env_data_base,
437  ByteOrder::little, *initVirtMem);
438  copyStringArray(argv, argv_array_base, arg_data_base,
439  ByteOrder::little, *initVirtMem);
440 
441  initVirtMem->writeBlob(argc_base, &guestArgc, intSize);
442 
444  //Set the stack pointer register
445  tc->setIntReg(spIndex, memState->getStackMin());
446  //A pointer to a function to run when the program exits. We'll set this
447  //to zero explicitly to make sure this isn't used.
448  tc->setIntReg(ArgumentReg0, 0);
449  //Set argument regs 1 and 2 to argv[0] and envp[0] respectively
450  if (argv.size() > 0) {
451  tc->setIntReg(ArgumentReg1, arg_data_base + arg_data_size -
452  argv[argv.size() - 1].size() - 1);
453  } else {
454  tc->setIntReg(ArgumentReg1, 0);
455  }
456  if (envp.size() > 0) {
457  tc->setIntReg(ArgumentReg2, env_data_base + env_data_size -
458  envp[envp.size() - 1].size() - 1);
459  } else {
460  tc->setIntReg(ArgumentReg2, 0);
461  }
462 
463  PCState pc;
464  pc.thumb(arch == ::Loader::Thumb);
465  pc.nextThumb(pc.thumb());
466  pc.aarch64(arch == ::Loader::Arm64);
467  pc.nextAArch64(pc.aarch64());
468  pc.set(getStartPC() & ~mask(1));
469  tc->pcState(pc);
470 
471  //Align the "stackMin" to a page boundary.
472  memState->setStackMin(roundDown(memState->getStackMin(), pageSize));
473 }
ArmProcess64::initState
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition: process.cc:121
ArmISA::MISCREG_ID_AA64MMFR2_EL1
@ MISCREG_ID_AA64MMFR2_EL1
Definition: miscregs.hh:818
Loader::Linux
@ Linux
Definition: object_file.hh:64
roundDown
T roundDown(const T &val, const U &align)
This function is used to align addresses in memory.
Definition: intmath.hh:150
X86ISA::L
Bitfield< 7, 0 > L
Definition: int.hh:57
ArmISA::MISCREG_ID_AA64ISAR1_EL1
@ MISCREG_ID_AA64ISAR1_EL1
Definition: miscregs.hh:564
system.hh
ArmISA::MODE_EL0T
@ MODE_EL0T
Definition: types.hh:629
Process::envp
std::vector< std::string > envp
Definition: process.hh:212
ArmProcess64::ArmProcess64
ArmProcess64(const ProcessParams &params, ::Loader::ObjectFile *objFile, ::Loader::Arch _arch)
Definition: process.cc:85
Loader::Thumb
@ Thumb
Definition: object_file.hh:53
Process::gid
uint64_t gid()
Definition: process.hh:82
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
ArmISA::MISCREG_ID_AA64ISAR0_EL1
@ MISCREG_ID_AA64ISAR0_EL1
Definition: miscregs.hh:563
Process
Definition: process.hh:65
M5_AT_UID
@ M5_AT_UID
Definition: aux_vector.hh:69
htole
T htole(T value)
Definition: byteswap.hh:141
Process::argv
std::vector< std::string > argv
Definition: process.hh:211
ThreadContext::setIntReg
virtual void setIntReg(RegIndex reg_idx, RegVal val)=0
ArmISA::MISCREG_CPACR
@ MISCREG_CPACR
Definition: miscregs.hh:237
ArmISA::ArgumentReg2
const int ArgumentReg2
Definition: registers.hh:103
ArmISA::IntRegIndex
IntRegIndex
Definition: intregs.hh:51
M5_AT_PAGESZ
@ M5_AT_PAGESZ
Definition: aux_vector.hh:64
M5_AT_SECURE
@ M5_AT_SECURE
Definition: aux_vector.hh:76
ArmProcess64::armHwcapImpl
uint32_t armHwcapImpl() const override
AArch64 AT_HWCAP.
Definition: process.cc:171
M5_AT_PHENT
@ M5_AT_PHENT
Definition: aux_vector.hh:62
ArmProcess::arch
::Loader::Arch arch
Definition: process.hh:56
ArmISA::GuestByteOrder
const ByteOrder GuestByteOrder
Definition: isa_traits.hh:50
ArmProcess::argsInit
void argsInit(int pageSize, ArmISA::IntRegIndex spIndex)
Definition: process.cc:253
process_impl.hh
M5_AT_EUID
@ M5_AT_EUID
Definition: aux_vector.hh:70
std::vector
STL vector class.
Definition: stl.hh:37
Process::initVirtMem
std::unique_ptr< SETranslatingPortProxy > initVirtMem
Definition: process.hh:172
ArmISA::ArgumentReg1
const int ArgumentReg1
Definition: registers.hh:102
Process::egid
uint64_t egid()
Definition: process.hh:83
ArmISA
Definition: ccregs.hh:41
ArmProcess::ArmProcess
ArmProcess(const ProcessParams &params, ::Loader::ObjectFile *objFile, ::Loader::Arch _arch)
Definition: process.cc:60
types.hh
ArmISA::INTREG_SP
@ INTREG_SP
Definition: intregs.hh:68
Loader::ElfObject
Definition: elf_object.hh:59
Loader::MemoryImage::maxAddr
Addr maxAddr() const
Definition: memory_image.hh:131
sc_dt::align
void align(const scfx_rep &lhs, const scfx_rep &rhs, int &new_wp, int &len_mant, scfx_mant_ref &lhs_mant, scfx_mant_ref &rhs_mant)
Definition: scfx_rep.cc:2083
ArmProcess32::initState
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition: process.cc:102
M5_AT_ENTRY
@ M5_AT_ENTRY
Definition: aux_vector.hh:67
M5_AT_BASE
@ M5_AT_BASE
Definition: aux_vector.hh:65
Loader::ObjectFile
Definition: object_file.hh:74
M5_AT_PHNUM
@ M5_AT_PHNUM
Definition: aux_vector.hh:63
elf_object.hh
AuxVector
Definition: aux_vector.hh:38
Loader::ObjectFile::entryPoint
Addr entryPoint() const
Definition: object_file.hh:112
syscall_return.hh
ArmISA::MISCREG_ID_AA64PFR0_EL1
@ MISCREG_ID_AA64PFR0_EL1
Definition: miscregs.hh:557
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
M5_AT_PLATFORM
@ M5_AT_PLATFORM
Definition: aux_vector.hh:73
EmulationPageTable
Definition: page_table.hh:49
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:237
MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:240
ArmISA::ArgumentReg0
const int ArgumentReg0
Definition: registers.hh:101
M5_AT_FLAGS
@ M5_AT_FLAGS
Definition: aux_vector.hh:66
ArmISA::INTREG_SP0
@ INTREG_SP0
Definition: intregs.hh:118
M5_AT_EXECFN
@ M5_AT_EXECFN
Definition: aux_vector.hh:80
Process::image
::Loader::MemoryImage image
Definition: process.hh:209
M5_AT_RANDOM
@ M5_AT_RANDOM
Definition: aux_vector.hh:78
ArmISA::MISCREG_FPEXC
@ MISCREG_FPEXC
Definition: miscregs.hh:71
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
name
const std::string & name()
Definition: trace.cc:48
Process::contextIds
std::vector< ContextID > contextIds
Definition: process.hh:157
ThreadContext::pcState
virtual TheISA::PCState pcState() const =0
M5_AT_GID
@ M5_AT_GID
Definition: aux_vector.hh:71
System::threads
Threads threads
Definition: system.hh:304
ArmISA::PageBytes
const Addr PageBytes
Definition: isa_traits.hh:53
Loader::Arch
Arch
Definition: object_file.hh:44
ArmISA::MISCREG_CPSR
@ MISCREG_CPSR
Definition: miscregs.hh:57
aux_vector.hh
MipsISA::PCState
GenericISA::DelaySlotPCState< MachInst > PCState
Definition: types.hh:41
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
ThreadContext::readMiscReg
virtual RegVal readMiscReg(RegIndex misc_reg)=0
ThreadContext::setMiscReg
virtual void setMiscReg(RegIndex misc_reg, RegVal val)=0
logging.hh
Loader::ObjectFile::getOpSys
OpSys getOpSys() const
Definition: object_file.hh:104
isa_traits.hh
ArmProcess32::ArmProcess32
ArmProcess32(const ProcessParams &params, ::Loader::ObjectFile *objFile, ::Loader::Arch _arch)
Definition: process.cc:70
Loader::Arm64
@ Arm64
Definition: object_file.hh:51
Process::euid
uint64_t euid()
Definition: process.hh:81
Process::getStartPC
Addr getStartPC()
Definition: process.cc:477
X86ISA::type
type
Definition: misc.hh:727
ArmProcess32::armHwcapImpl
uint32_t armHwcapImpl() const override
AArch32 AT_HWCAP.
Definition: process.cc:145
M5_AT_HWCAP
@ M5_AT_HWCAP
Definition: aux_vector.hh:74
SimObject::params
const Params & params() const
Definition: sim_object.hh:168
Process::system
System * system
Definition: process.hh:160
Process::uid
uint64_t uid()
Definition: process.hh:80
ArmISA::MISCREG_CPACR_EL1
@ MISCREG_CPACR_EL1
Definition: miscregs.hh:578
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
M5_AT_CLKTCK
@ M5_AT_CLKTCK
Definition: aux_vector.hh:75
page_table.hh
process.hh
ArmProcess
Definition: process.hh:53
copyStringArray
void copyStringArray(std::vector< std::string > &strings, AddrType array_ptr, AddrType data_ptr, const ByteOrder bo, PortProxy &memProxy)
Definition: process_impl.hh:40
M5_AT_EGID
@ M5_AT_EGID
Definition: aux_vector.hh:72
object_file.hh
thread_context.hh
Process::memState
std::shared_ptr< MemState > memState
Definition: process.hh:274
ArmISA::mask
Bitfield< 28, 24 > mask
Definition: miscregs_types.hh:711
ArmISA::id
Bitfield< 33 > id
Definition: miscregs_types.hh:247
M5_AT_PHDR
@ M5_AT_PHDR
Definition: aux_vector.hh:61
byteswap.hh

Generated on Tue Jun 22 2021 15:28:21 for gem5 by doxygen 1.8.17