gem5  v19.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) 2003-2004 The Regents of The University of Michigan
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met: redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * Authors: Gabe Black
29  * Ali Saidi
30  */
31 
32 #include "arch/sparc/process.hh"
33 
34 #include "arch/sparc/asi.hh"
35 #include "arch/sparc/handlers.hh"
36 #include "arch/sparc/isa_traits.hh"
37 #include "arch/sparc/registers.hh"
38 #include "arch/sparc/types.hh"
41 #include "base/logging.hh"
42 #include "cpu/thread_context.hh"
43 #include "debug/Stack.hh"
44 #include "mem/page_table.hh"
45 #include "params/Process.hh"
46 #include "sim/aux_vector.hh"
47 #include "sim/process_impl.hh"
48 #include "sim/syscall_return.hh"
49 #include "sim/system.hh"
50 
51 using namespace std;
52 using namespace SparcISA;
53 
54 static const int FirstArgumentReg = 8;
55 
56 
57 SparcProcess::SparcProcess(ProcessParams *params, ObjectFile *objFile,
58  Addr _StackBias)
59  : Process(params,
60  new EmulationPageTable(params->name, params->pid, PageBytes),
61  objFile),
62  StackBias(_StackBias)
63 {
64  fatal_if(params->useArchPT, "Arch page tables not implemented.");
65  // Initialize these to 0s
66  fillStart = 0;
67  spillStart = 0;
68 }
69 
70 void
71 SparcProcess::handleTrap(int trapNum, ThreadContext *tc, Fault *fault)
72 {
73  PCState pc = tc->pcState();
74  switch (trapNum) {
75  case 0x01: // Software breakpoint
76  warn("Software breakpoint encountered at pc %#x.\n", pc.pc());
77  break;
78  case 0x02: // Division by zero
79  warn("Software signaled a division by zero at pc %#x.\n", pc.pc());
80  break;
81  case 0x03: // Flush window trap
82  flushWindows(tc);
83  break;
84  case 0x04: // Clean windows
85  warn("Ignoring process request for clean register "
86  "windows at pc %#x.\n", pc.pc());
87  break;
88  case 0x05: // Range check
89  warn("Software signaled a range check at pc %#x.\n", pc.pc());
90  break;
91  case 0x06: // Fix alignment
92  warn("Ignoring process request for os assisted unaligned accesses "
93  "at pc %#x.\n", pc.pc());
94  break;
95  case 0x07: // Integer overflow
96  warn("Software signaled an integer overflow at pc %#x.\n", pc.pc());
97  break;
98  case 0x32: // Get integer condition codes
99  warn("Ignoring process request to get the integer condition codes "
100  "at pc %#x.\n", pc.pc());
101  break;
102  case 0x33: // Set integer condition codes
103  warn("Ignoring process request to set the integer condition codes "
104  "at pc %#x.\n", pc.pc());
105  break;
106  default:
107  panic("Unimplemented trap to operating system: trap number %#x.\n", trapNum);
108  }
109 }
110 
111 void
113 {
115 
117  // From the SPARC ABI
118 
119  // Setup default FP state
121 
123 
124  /*
125  * Register window management registers
126  */
127 
128  // No windows contain info from other programs
129  // tc->setMiscRegNoEffect(MISCREG_OTHERWIN, 0);
130  tc->setIntReg(NumIntArchRegs + 6, 0);
131  // There are no windows to pop
132  // tc->setMiscRegNoEffect(MISCREG_CANRESTORE, 0);
133  tc->setIntReg(NumIntArchRegs + 4, 0);
134  // All windows are available to save into
135  // tc->setMiscRegNoEffect(MISCREG_CANSAVE, NWindows - 2);
136  tc->setIntReg(NumIntArchRegs + 3, NWindows - 2);
137  // All windows are "clean"
138  // tc->setMiscRegNoEffect(MISCREG_CLEANWIN, NWindows);
140  // Start with register window 0
141  tc->setMiscReg(MISCREG_CWP, 0);
142  // Always use spill and fill traps 0
143  // tc->setMiscRegNoEffect(MISCREG_WSTATE, 0);
144  tc->setIntReg(NumIntArchRegs + 7, 0);
145  // Set the trap level to 0
147  // Set the ASI register to something fixed
149 
150  // Set the MMU Primary Context Register to hold the process' pid
152 
153  /*
154  * T1 specific registers
155  */
156  // Turn on the icache, dcache, dtb translation, and itb translation.
158 }
159 
160 void
162 {
164 
166  // The process runs in user mode with 32 bit addresses
167  PSTATE pstate = 0;
168  pstate.ie = 1;
169  pstate.am = 1;
170  tc->setMiscReg(MISCREG_PSTATE, pstate);
171 
172  argsInit(32 / 8, PageBytes);
173 }
174 
175 void
177 {
179 
181  // The process runs in user mode
182  PSTATE pstate = 0;
183  pstate.ie = 1;
184  tc->setMiscReg(MISCREG_PSTATE, pstate);
185 
186  argsInit(sizeof(RegVal), PageBytes);
187 }
188 
189 template<class IntType>
190 void
192 {
193  int intSize = sizeof(IntType);
194 
196 
197  string filename;
198  if (argv.size() < 1)
199  filename = "";
200  else
201  filename = argv[0];
202 
203  // Even for a 32 bit process, the ABI says we still need to
204  // maintain double word alignment of the stack pointer.
205  uint64_t align = 16;
206 
207  enum hardwareCaps
208  {
209  M5_HWCAP_SPARC_FLUSH = 1,
210  M5_HWCAP_SPARC_STBAR = 2,
211  M5_HWCAP_SPARC_SWAP = 4,
212  M5_HWCAP_SPARC_MULDIV = 8,
213  M5_HWCAP_SPARC_V9 = 16,
214  // This one should technically only be set
215  // if there is a cheetah or cheetah_plus tlb,
216  // but we'll use it all the time
217  M5_HWCAP_SPARC_ULTRA3 = 32
218  };
219 
220  const int64_t hwcap =
221  M5_HWCAP_SPARC_FLUSH |
222  M5_HWCAP_SPARC_STBAR |
223  M5_HWCAP_SPARC_SWAP |
224  M5_HWCAP_SPARC_MULDIV |
225  M5_HWCAP_SPARC_V9 |
226  M5_HWCAP_SPARC_ULTRA3;
227 
228  // Setup the auxilliary vectors. These will already have endian conversion.
229  // Auxilliary vectors are loaded only for elf formatted executables.
230  ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile);
231  if (elfObject) {
232  // Bits which describe the system hardware capabilities
233  auxv.emplace_back(M5_AT_HWCAP, hwcap);
234  // The system page size
235  auxv.emplace_back(M5_AT_PAGESZ, SparcISA::PageBytes);
236  // Defined to be 100 in the kernel source.
237  // Frequency at which times() increments
238  auxv.emplace_back(M5_AT_CLKTCK, 100);
239  // For statically linked executables, this is the virtual address of
240  // the program header tables if they appear in the executable image
241  auxv.emplace_back(M5_AT_PHDR, elfObject->programHeaderTable());
242  // This is the size of a program header entry from the elf file.
243  auxv.emplace_back(M5_AT_PHENT, elfObject->programHeaderSize());
244  // This is the number of program headers from the original elf file.
245  auxv.emplace_back(M5_AT_PHNUM, elfObject->programHeaderCount());
246  // This is the base address of the ELF interpreter; it should be
247  // zero for static executables or contain the base address for
248  // dynamic executables.
249  auxv.emplace_back(M5_AT_BASE, getBias());
250  // This is hardwired to 0 in the elf loading code in the kernel
251  auxv.emplace_back(M5_AT_FLAGS, 0);
252  // The entry point to the program
253  auxv.emplace_back(M5_AT_ENTRY, objFile->entryPoint());
254  // Different user and group IDs
255  auxv.emplace_back(M5_AT_UID, uid());
256  auxv.emplace_back(M5_AT_EUID, euid());
257  auxv.emplace_back(M5_AT_GID, gid());
258  auxv.emplace_back(M5_AT_EGID, egid());
259  // Whether to enable "secure mode" in the executable
260  auxv.emplace_back(M5_AT_SECURE, 0);
261  }
262 
263  // Figure out how big the initial stack needs to be
264 
265  // The unaccounted for 8 byte 0 at the top of the stack
266  int sentry_size = 8;
267 
268  // This is the name of the file which is present on the initial stack
269  // It's purpose is to let the user space linker examine the original file.
270  int file_name_size = filename.size() + 1;
271 
272  int env_data_size = 0;
273  for (int i = 0; i < envp.size(); ++i) {
274  env_data_size += envp[i].size() + 1;
275  }
276  int arg_data_size = 0;
277  for (int i = 0; i < argv.size(); ++i) {
278  arg_data_size += argv[i].size() + 1;
279  }
280 
281  // The info_block.
282  int base_info_block_size =
283  sentry_size + file_name_size + env_data_size + arg_data_size;
284 
285  int info_block_size = roundUp(base_info_block_size, align);
286 
287  int info_block_padding = info_block_size - base_info_block_size;
288 
289  // Each auxilliary vector is two words
290  int aux_array_size = intSize * 2 * (auxv.size() + 1);
291 
292  int envp_array_size = intSize * (envp.size() + 1);
293  int argv_array_size = intSize * (argv.size() + 1);
294 
295  int argc_size = intSize;
296  int window_save_size = intSize * 16;
297 
298  // Figure out the size of the contents of the actual initial frame
299  int frame_size =
300  aux_array_size +
301  envp_array_size +
302  argv_array_size +
303  argc_size +
304  window_save_size;
305 
306  // There needs to be padding after the auxiliary vector data so that the
307  // very bottom of the stack is aligned properly.
308  int aligned_partial_size = roundUp(frame_size, align);
309  int aux_padding = aligned_partial_size - frame_size;
310 
311  int space_needed =
312  info_block_size +
313  aux_padding +
314  frame_size;
315 
316  memState->setStackMin(memState->getStackBase() - space_needed);
317  memState->setStackMin(roundDown(memState->getStackMin(), align));
318  memState->setStackSize(memState->getStackBase() - memState->getStackMin());
319 
320  // Allocate space for the stack
321  allocateMem(roundDown(memState->getStackMin(), pageSize),
322  roundUp(memState->getStackSize(), pageSize));
323 
324  // map out initial stack contents
325  IntType sentry_base = memState->getStackBase() - sentry_size;
326  IntType file_name_base = sentry_base - file_name_size;
327  IntType env_data_base = file_name_base - env_data_size;
328  IntType arg_data_base = env_data_base - arg_data_size;
329  IntType auxv_array_base = arg_data_base -
330  info_block_padding - aux_array_size - aux_padding;
331  IntType envp_array_base = auxv_array_base - envp_array_size;
332  IntType argv_array_base = envp_array_base - argv_array_size;
333  IntType argc_base = argv_array_base - argc_size;
334 #if TRACING_ON
335  IntType window_save_base = argc_base - window_save_size;
336 #endif
337 
338  DPRINTF(Stack, "The addresses of items on the initial stack:\n");
339  DPRINTF(Stack, "%#x - sentry NULL\n", sentry_base);
340  DPRINTF(Stack, "filename = %s\n", filename);
341  DPRINTF(Stack, "%#x - file name\n", file_name_base);
342  DPRINTF(Stack, "%#x - env data\n", env_data_base);
343  DPRINTF(Stack, "%#x - arg data\n", arg_data_base);
344  DPRINTF(Stack, "%#x - auxv array\n", auxv_array_base);
345  DPRINTF(Stack, "%#x - envp array\n", envp_array_base);
346  DPRINTF(Stack, "%#x - argv array\n", argv_array_base);
347  DPRINTF(Stack, "%#x - argc \n", argc_base);
348  DPRINTF(Stack, "%#x - window save\n", window_save_base);
349  DPRINTF(Stack, "%#x - stack min\n", memState->getStackMin());
350 
351  assert(window_save_base == memState->getStackMin());
352 
353  // write contents to stack
354 
355  // figure out argc
356  IntType argc = argv.size();
357  IntType guestArgc = htobe(argc);
358 
359  // Write out the sentry void *
360  uint64_t sentry_NULL = 0;
361  initVirtMem.writeBlob(sentry_base, &sentry_NULL, sentry_size);
362 
363  // Write the file name
364  initVirtMem.writeString(file_name_base, filename.c_str());
365 
366  // Copy the aux stuff
367  Addr auxv_array_end = auxv_array_base;
368  for (const auto &aux: auxv) {
369  initVirtMem.write(auxv_array_end, aux, GuestByteOrder);
370  auxv_array_end += sizeof(aux);
371  }
372 
373  // Write out the terminating zeroed auxilliary vector
374  const AuxVector<IntType> zero(0, 0);
375  initVirtMem.write(auxv_array_end, zero);
376  auxv_array_end += sizeof(zero);
377 
378  copyStringArray(envp, envp_array_base, env_data_base,
380  copyStringArray(argv, argv_array_base, arg_data_base,
382 
383  initVirtMem.writeBlob(argc_base, &guestArgc, intSize);
384 
385  // Set up space for the trap handlers into the processes address space.
386  // Since the stack grows down and there is reserved address space abov
387  // it, we can put stuff above it and stay out of the way.
388  fillStart = memState->getStackBase();
390 
392  // Set up the thread context to start running the process
393  // assert(NumArgumentRegs >= 2);
394  // tc->setIntReg(ArgumentReg[0], argc);
395  // tc->setIntReg(ArgumentReg[1], argv_array_base);
396  tc->setIntReg(StackPointerReg, memState->getStackMin() - StackBias);
397 
398  // %g1 is a pointer to a function that should be run at exit. Since we
399  // don't have anything like that, it should be set to 0.
400  tc->setIntReg(1, 0);
401 
402  tc->pcState(getStartPC());
403 
404  // Align the "stack_min" to a page boundary.
405  memState->setStackMin(roundDown(memState->getStackMin(), pageSize));
406 }
407 
408 void
409 Sparc64Process::argsInit(int intSize, int pageSize)
410 {
411  SparcProcess::argsInit<uint64_t>(pageSize);
412 
413  // Stuff the trap handlers into the process address space
415  fillHandler64, sizeof(MachInst) * numFillInsts);
418 }
419 
420 void
421 Sparc32Process::argsInit(int intSize, int pageSize)
422 {
423  SparcProcess::argsInit<uint32_t>(pageSize);
424 
425  // Stuff the trap handlers into the process address space
427  fillHandler32, sizeof(MachInst) * numFillInsts);
430 }
431 
433 {
434  RegVal Cansave = tc->readIntReg(NumIntArchRegs + 3);
435  RegVal Canrestore = tc->readIntReg(NumIntArchRegs + 4);
436  RegVal Otherwin = tc->readIntReg(NumIntArchRegs + 6);
437  RegVal CWP = tc->readMiscReg(MISCREG_CWP);
438  RegVal origCWP = CWP;
439  CWP = (CWP + Cansave + 2) % NWindows;
440  while (NWindows - 2 - Cansave != 0) {
441  if (Otherwin) {
442  panic("Otherwin non-zero.\n");
443  } else {
444  tc->setMiscReg(MISCREG_CWP, CWP);
445  // Do the stores
447  for (int index = 16; index < 32; index++) {
448  uint32_t regVal = tc->readIntReg(index);
449  regVal = htobe(regVal);
450  if (!tc->getVirtProxy().tryWriteBlob(
451  sp + (index - 16) * 4, (uint8_t *)&regVal, 4)) {
452  warn("Failed to save register to the stack when "
453  "flushing windows.\n");
454  }
455  }
456  Canrestore--;
457  Cansave++;
458  CWP = (CWP + 1) % NWindows;
459  }
460  }
461  tc->setIntReg(NumIntArchRegs + 3, Cansave);
462  tc->setIntReg(NumIntArchRegs + 4, Canrestore);
463  tc->setMiscReg(MISCREG_CWP, origCWP);
464 }
465 
466 void
468 {
469  RegVal Cansave = tc->readIntReg(NumIntArchRegs + 3);
470  RegVal Canrestore = tc->readIntReg(NumIntArchRegs + 4);
471  RegVal Otherwin = tc->readIntReg(NumIntArchRegs + 6);
472  RegVal CWP = tc->readMiscReg(MISCREG_CWP);
473  RegVal origCWP = CWP;
474  CWP = (CWP + Cansave + 2) % NWindows;
475  while (NWindows - 2 - Cansave != 0) {
476  if (Otherwin) {
477  panic("Otherwin non-zero.\n");
478  } else {
479  tc->setMiscReg(MISCREG_CWP, CWP);
480  // Do the stores
482  for (int index = 16; index < 32; index++) {
483  RegVal regVal = tc->readIntReg(index);
484  regVal = htobe(regVal);
485  if (!tc->getVirtProxy().tryWriteBlob(
486  sp + 2047 + (index - 16) * 8, (uint8_t *)&regVal, 8)) {
487  warn("Failed to save register to the stack when "
488  "flushing windows.\n");
489  }
490  }
491  Canrestore--;
492  Cansave++;
493  CWP = (CWP + 1) % NWindows;
494  }
495  }
496  tc->setIntReg(NumIntArchRegs + 3, Cansave);
497  tc->setIntReg(NumIntArchRegs + 4, Canrestore);
498  tc->setMiscReg(MISCREG_CWP, origCWP);
499 }
500 
501 RegVal
503 {
504  assert(i < 6);
505  return bits(tc->readIntReg(FirstArgumentReg + i++), 31, 0);
506 }
507 
508 RegVal
510 {
511  assert(i < 6);
512  return tc->readIntReg(FirstArgumentReg + i++);
513 }
514 
515 void
517 {
518  // check for error condition. SPARC syscall convention is to
519  // indicate success/failure in reg the carry bit of the ccr
520  // and put the return value itself in the standard return value reg ().
521  PSTATE pstate = tc->readMiscRegNoEffect(MISCREG_PSTATE);
522  if (sysret.successful()) {
523  // no error, clear XCC.C
524  tc->setIntReg(NumIntArchRegs + 2,
525  tc->readIntReg(NumIntArchRegs + 2) & 0xEE);
526  RegVal val = sysret.returnValue();
527  if (pstate.am)
528  val = bits(val, 31, 0);
529  tc->setIntReg(ReturnValueReg, val);
530  } else {
531  // got an error, set XCC.C
532  tc->setIntReg(NumIntArchRegs + 2,
533  tc->readIntReg(NumIntArchRegs + 2) | 0x11);
534  RegVal val = sysret.errnoValue();
535  if (pstate.am)
536  val = bits(val, 31, 0);
537  tc->setIntReg(ReturnValueReg, val);
538  }
539 }
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:167
#define DPRINTF(x,...)
Definition: trace.hh:229
ObjectFile * objFile
Definition: process.hh:217
virtual void setMiscReg(RegIndex misc_reg, RegVal val)=0
Bitfield< 30, 0 > index
const int numFillInsts
Definition: handlers.hh:42
Addr programHeaderTable()
Definition: elf_object.hh:128
const std::string & name()
Definition: trace.cc:54
void flushWindows(ThreadContext *tc) override
Definition: process.cc:467
Bitfield< 7 > i
virtual bool tryWriteBlob(Addr addr, const void *p, int size) const
Write size bytes from p to address.
Definition: port_proxy.hh:154
virtual TheISA::PCState pcState() const =0
virtual RegVal readIntReg(RegIndex reg_idx) const =0
bool successful() const
Was the system call successful?
std::vector< ContextID > contextIds
Definition: process.hh:167
void writeString(Addr addr, const char *str) const
Same as tryWriteString, but insists on success.
Definition: port_proxy.hh:241
uint32_t MachInst
Definition: types.hh:40
void argsInit(int pageSize)
Definition: process.cc:191
virtual void setMiscRegNoEffect(RegIndex misc_reg, RegVal val)=0
void allocateMem(Addr vaddr, int64_t size, bool clobber=false)
Definition: process.cc:333
SparcProcess(ProcessParams *params, ObjectFile *objFile, Addr _StackBias)
Definition: process.cc:57
SETranslatingPortProxy initVirtMem
Definition: process.hh:183
uint64_t uid()
Definition: process.hh:87
const MachInst fillHandler64[numFillInsts]
Definition: handlers.hh:45
virtual PortProxy & getVirtProxy()=0
Bitfield< 0 > sp
uint64_t RegVal
Definition: types.hh:168
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:586
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition: process.cc:307
MMU Internal Registers.
Definition: miscregs.hh:89
const Addr StackBias
Definition: process.hh:49
T roundUp(const T &val, const U &align)
This function is used to align addresses in memory.
Definition: intmath.hh:168
std::shared_ptr< MemState > memState
Definition: process.hh:283
void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value) override
Definition: process.cc:516
const Addr PageBytes
Definition: isa_traits.hh:46
ThreadContext is the external interface to all thread state for anything outside of the CPU...
int errnoValue() const
The errno value.
const ByteOrder GuestByteOrder
Definition: isa_traits.hh:42
STL vector class.
Definition: stl.hh:40
Bitfield< 63 > val
Definition: misc.hh:771
ThreadContext * getThreadContext(ContextID tid) const
Definition: system.hh:194
uint32_t MachInst
Definition: types.hh:40
void flushWindows(ThreadContext *tc) override
Definition: process.cc:432
Bitfield< 4 > pc
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:2051
void writeBlob(Addr addr, const void *p, int size) const
Same as tryWriteBlob, but insists on success.
Definition: port_proxy.hh:189
uint64_t _pid
Definition: process.hh:272
const int numSpillInsts
Definition: handlers.hh:43
void copyStringArray(std::vector< std::string > &strings, AddrType array_ptr, AddrType data_ptr, const ByteOrder bo, PortProxy &memProxy)
Definition: process_impl.hh:43
uint64_t euid()
Definition: process.hh:88
virtual void flushWindows(ThreadContext *tc)=0
Addr getStartPC()
Definition: process.cc:532
System * system
Definition: process.hh:170
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Definition: logging.hh:203
const RegIndex StackPointerReg
Definition: registers.hh:77
T roundDown(const T &val, const U &align)
This function is used to align addresses in memory.
Definition: intmath.hh:185
Addr spillStart
Definition: process.hh:52
std::vector< std::string > envp
Definition: process.hh:221
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition: process.cc:161
virtual void setIntReg(RegIndex reg_idx, RegVal val)=0
RegVal getSyscallArg(ThreadContext *tc, int &i) override
Definition: process.cc:502
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
int64_t returnValue() const
The return value.
const MachInst spillHandler32[numSpillInsts]
Definition: handlers.hh:153
void argsInit(int intSize, int pageSize)
Definition: process.cc:421
const MachInst fillHandler32[numFillInsts]
Definition: handlers.hh:81
const Addr PageBytes
Definition: isa_traits.hh:47
Ancillary State Registers.
Definition: miscregs.hh:45
uint16_t programHeaderSize()
Definition: elf_object.hh:129
Addr fillStart
Definition: process.hh:52
RegVal getSyscallArg(ThreadContext *tc, int &i) override
Definition: process.cc:509
const int NumIntArchRegs
Definition: registers.hh:89
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
Declarations of a non-full system Page Table.
T htobe(T value)
Definition: byteswap.hh:146
uint16_t programHeaderCount()
Definition: elf_object.hh:130
Definition: asi.cc:34
static const int FirstArgumentReg
Definition: process.cc:54
virtual void handleTrap(int trapNum, ThreadContext *tc, Fault *fault)
Definition: process.cc:71
const int NWindows
Definition: sparc_traits.hh:43
Addr entryPoint() const
Definition: object_file.hh:131
uint64_t gid()
Definition: process.hh:89
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition: process.cc:176
void argsInit(int intSize, int pageSize)
Definition: process.cc:409
void write(Addr address, const T &data) const
Write object T to address.
Definition: port_proxy.hh:293
const RegIndex ReturnValueReg
Definition: registers.hh:81
#define warn(...)
Definition: logging.hh:212
std::vector< std::string > argv
Definition: process.hh:220
This class represents the return value from an emulated system call, including any errno setting...
T bits(T val, int first, int last)
Extract the bitfield from position &#39;first&#39; to &#39;last&#39; (inclusive) from &#39;val&#39; and right justify it...
Definition: bitfield.hh:72
virtual RegVal readMiscReg(RegIndex misc_reg)=0
std::shared_ptr< FaultBase > Fault
Definition: types.hh:240
Addr getBias()
Definition: process.cc:524
const MachInst spillHandler64[numSpillInsts]
Definition: handlers.hh:117
uint64_t egid()
Definition: process.hh:90
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition: process.cc:112
Floating Point Status Register.
Definition: miscregs.hh:86

Generated on Fri Feb 28 2020 16:26:56 for gem5 by doxygen 1.8.13