gem5  v20.1.0.0
process.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2013, 2015, 2020 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) 2003-2005 The Regents of The University of Michigan
15  * Copyright (c) 2007-2008 The Florida State University
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 
43 
44 #include <sys/syscall.h>
45 
46 #include "arch/arm/isa_traits.hh"
47 #include "arch/arm/linux/linux.hh"
49 #include "base/trace.hh"
50 #include "cpu/thread_context.hh"
51 #include "kern/linux/linux.hh"
52 #include "sim/process.hh"
53 #include "sim/syscall_desc.hh"
54 #include "sim/syscall_emul.hh"
55 #include "sim/system.hh"
56 
57 using namespace std;
58 using namespace ArmISA;
59 
60 namespace
61 {
62 
63 class ArmLinuxObjectFileLoader : public Process::Loader
64 {
65  public:
66  Process *
67  load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
68  {
69  auto arch = obj_file->getArch();
70  auto opsys = obj_file->getOpSys();
71 
72  if (arch != ::Loader::Arm && arch != ::Loader::Thumb &&
73  arch != ::Loader::Arm64) {
74  return nullptr;
75  }
76 
77  if (opsys == ::Loader::UnknownOpSys) {
78  warn("Unknown operating system; assuming Linux.");
79  opsys = ::Loader::Linux;
80  }
81 
82  if (opsys == ::Loader::LinuxArmOABI) {
83  fatal("gem5 does not support ARM OABI binaries. Please recompile "
84  "with an EABI compiler.");
85  }
86 
87  if (opsys != ::Loader::Linux)
88  return nullptr;
89 
90  if (arch == ::Loader::Arm64)
91  return new ArmLinuxProcess64(params, obj_file, arch);
92  else
93  return new ArmLinuxProcess32(params, obj_file, arch);
94  }
95 };
96 
97 ArmLinuxObjectFileLoader loader;
98 
99 } // anonymous namespace
100 
102 static SyscallReturn
104 {
105  auto process = tc->getProcessPtr();
106 
107  strcpy(name->sysname, "Linux");
108  strcpy(name->nodename, "m5.eecs.umich.edu");
109  strcpy(name->release, process->release.c_str());
110  strcpy(name->version, "#1 SMP Sat Dec 1 00:00:00 GMT 2012");
111  strcpy(name->machine, "armv7l");
112 
113  return 0;
114 }
115 
117 static SyscallReturn
119 {
120  auto process = tc->getProcessPtr();
121 
122  strcpy(name->sysname, "Linux");
123  strcpy(name->nodename, "gem5");
124  strcpy(name->release, process->release.c_str());
125  strcpy(name->version, "#1 SMP Sat Dec 1 00:00:00 GMT 2012");
126  strcpy(name->machine, "armv8l");
127 
128  return 0;
129 }
130 
132 static SyscallReturn
133 setTLSFunc32(SyscallDesc *desc, ThreadContext *tc, uint32_t tlsPtr)
134 {
136  &tlsPtr, sizeof(tlsPtr));
137  tc->setMiscReg(MISCREG_TPIDRURO, tlsPtr);
138  return 0;
139 }
140 
141 static SyscallReturn
142 setTLSFunc64(SyscallDesc *desc, ThreadContext *tc, uint32_t tlsPtr)
143 {
144  tc->setMiscReg(MISCREG_TPIDRRO_EL0, tlsPtr);
145  return 0;
146 }
147 
148 
150  public SyscallDescTable<ArmLinuxProcess32::SyscallABI>
151 {
152  public:
154  SyscallDescTable<ArmLinuxProcess32::SyscallABI>({
155  { base + 0, "syscall" },
156  { base + 1, "exit", exitFunc },
157  { base + 2, "fork" },
158  { base + 3, "read", readFunc<ArmLinux32> },
159  { base + 4, "write", writeFunc<ArmLinux32> },
160  { base + 5, "open", openFunc<ArmLinux32> },
161  { base + 6, "close", closeFunc },
162  { base + 8, "creat" },
163  { base + 9, "link" },
164  { base + 10, "unlink", unlinkFunc },
165  { base + 11, "execve", execveFunc<ArmLinux32> },
166  { base + 12, "chdir" },
167  { base + 13, "time", timeFunc<ArmLinux32> },
168  { base + 14, "mknod" },
169  { base + 15, "chmod", chmodFunc<ArmLinux32> },
170  { base + 16, "lchown", chownFunc },
171  { base + 19, "lseek", lseekFunc },
172  { base + 20, "getpid", getpidFunc },
173  { base + 21, "mount" },
174  { base + 22, "umount" },
175  { base + 23, "setuid", ignoreFunc },
176  { base + 24, "getuid", getuidFunc },
177  { base + 25, "stime" },
178  { base + 26, "ptrace" },
179  { base + 27, "alarm" },
180  { base + 29, "pause" },
181  { base + 30, "utime" },
182  { base + 33, "access", accessFunc },
183  { base + 34, "nice" },
184  { base + 36, "sync" },
185  { base + 37, "kill", ignoreFunc },
186  { base + 38, "rename", renameFunc },
187  { base + 39, "mkdir", mkdirFunc },
188  { base + 40, "rmdir" },
189  { base + 41, "dup", dupFunc },
190  { base + 42, "pipe", pipePseudoFunc },
191  { base + 43, "times", timesFunc<ArmLinux32> },
192  { base + 45, "brk", brkFunc },
193  { base + 46, "setgid" },
194  { base + 47, "getgid", getgidFunc },
195  { base + 49, "geteuid", geteuidFunc },
196  { base + 50, "getegid", getegidFunc },
197  { base + 51, "acct" },
198  { base + 52, "umount2" },
199  { base + 54, "ioctl", ioctlFunc<ArmLinux32> },
200  { base + 55, "fcntl", fcntlFunc },
201  { base + 57, "setpgid" },
202  { base + 60, "umask", umaskFunc },
203  { base + 61, "chroot" },
204  { base + 62, "ustat" },
205  { base + 63, "dup2" },
206  { base + 64, "getppid", getppidFunc },
207  { base + 65, "getpgrp" },
208  { base + 66, "setsid" },
209  { base + 67, "sigaction" },
210  { base + 70, "setreuid" },
211  { base + 71, "setregid" },
212  { base + 72, "sigsuspend" },
213  { base + 73, "sigpending" },
214  { base + 74, "sethostname", ignoreFunc },
215  { base + 75, "setrlimit", ignoreFunc },
216  { base + 76, "getrlimit", getrlimitFunc<ArmLinux32> },
217  { base + 77, "getrusage", getrusageFunc<ArmLinux32> },
218  { base + 78, "gettimeofday", gettimeofdayFunc<ArmLinux32> },
219  { base + 79, "settimeofday" },
220  { base + 80, "getgroups" },
221  { base + 81, "setgroups" },
222  { base + 82, "reserved#82" },
223  { base + 83, "symlink" },
224  { base + 85, "readlink", readlinkFunc },
225  { base + 86, "uselib" },
226  { base + 87, "swapon" },
227  { base + 88, "reboot" },
228  { base + 89, "readdir" },
229  { base + 90, "mmap", mmapFunc<ArmLinux32> },
230  { base + 91, "munmap", munmapFunc },
231  { base + 92, "truncate", truncateFunc },
232  { base + 93, "ftruncate", ftruncateFunc },
233  { base + 94, "fchmod" },
234  { base + 95, "fchown" },
235  { base + 96, "getpriority" },
236  { base + 97, "setpriority" },
237  { base + 99, "statfs" },
238  { base + 100, "fstatfs" },
239  { base + 102, "socketcall" },
240  { base + 103, "syslog" },
241  { base + 104, "setitimer" },
242  { base + 105, "getitimer" },
243  { base + 106, "stat", statFunc<ArmLinux32> },
244  { base + 107, "lstat" },
245  { base + 108, "fstat", fstatFunc<ArmLinux32> },
246  { base + 111, "vhangup" },
247  { base + 113, "syscall" },
248  { base + 114, "wait4" },
249  { base + 115, "swapoff" },
250  { base + 116, "sysinfo", sysinfoFunc<ArmLinux32> },
251  { base + 117, "ipc" },
252  { base + 118, "fsync" },
253  { base + 119, "sigreturn" },
254  { base + 120, "clone", cloneBackwardsFunc<ArmLinux32> },
255  { base + 121, "setdomainname" },
256  { base + 122, "uname", unameFunc32 },
257  { base + 124, "adjtimex" },
258  { base + 125, "mprotect", ignoreFunc },
259  { base + 126, "sigprocmask", ignoreWarnOnceFunc },
260  { base + 128, "init_module" },
261  { base + 129, "delete_module" },
262  { base + 131, "quotactl" },
263  { base + 132, "getpgid" },
264  { base + 133, "fchdir" },
265  { base + 134, "bdflush" },
266  { base + 135, "sysfs" },
267  { base + 136, "personality" },
268  { base + 137, "reserved#138" },
269  { base + 138, "setfsuid" },
270  { base + 139, "setfsgid" },
271  { base + 140, "llseek", _llseekFunc },
272 #if defined(SYS_getdents)
273  { base + 141, "getdents", getdentsFunc },
274 #else
275  { base + 141, "getdents" },
276 #endif
277  { base + 142, "newselect" },
278  { base + 143, "flock" },
279  { base + 144, "msync" },
280  { base + 145, "readv" },
281  { base + 146, "writev", writevFunc<ArmLinux32> },
282  { base + 147, "getsid" },
283  { base + 148, "fdatasync" },
284  { base + 149, "sysctl" },
285  { base + 150, "mlock" },
286  { base + 151, "munlock" },
287  { base + 152, "mlockall" },
288  { base + 153, "munlockall" },
289  { base + 154, "sched_setparam", ignoreWarnOnceFunc },
290  { base + 155, "sched_getparam", ignoreWarnOnceFunc },
291  { base + 156, "sched_setscheduler", ignoreWarnOnceFunc },
292  { base + 157, "sched_getscheduler", ignoreWarnOnceFunc },
293  { base + 158, "sched_yield", ignoreWarnOnceFunc },
294  { base + 159, "sched_get_priority_max", ignoreWarnOnceFunc },
295  { base + 160, "sched_get_priority_min", ignoreWarnOnceFunc },
296  { base + 161, "sched_rr_get_interval", ignoreWarnOnceFunc },
297  { base + 162, "nanosleep", ignoreWarnOnceFunc },
298  { base + 163, "mremap", mremapFunc<ArmLinux32> }, // ARM-specific
299  { base + 164, "setresuid" },
300  { base + 165, "getresuid" },
301  { base + 168, "poll" },
302  { base + 169, "nfsservctl" },
303  { base + 170, "setresgid" },
304  { base + 171, "getresgid" },
305  { base + 172, "prctl" },
306  { base + 173, "rt_sigreturn" },
307  { base + 174, "rt_sigaction", ignoreWarnOnceFunc },
308  { base + 175, "rt_sigprocmask", ignoreWarnOnceFunc },
309  { base + 176, "rt_sigpending" },
310  { base + 177, "rt_sigtimedwait" },
311  { base + 178, "rt_sigqueueinfo", ignoreFunc },
312  { base + 179, "rt_sigsuspend" },
313  { base + 180, "pread64" },
314  { base + 181, "pwrite64" },
315  { base + 182, "chown" },
316  { base + 183, "getcwd", getcwdFunc },
317  { base + 184, "capget" },
318  { base + 185, "capset" },
319  { base + 186, "sigaltstack" },
320  { base + 187, "sendfile" },
321  { base + 190, "vfork" },
322  { base + 191, "getrlimit", getrlimitFunc<ArmLinux32> },
323  { base + 192, "mmap2", mmapFunc<ArmLinux32> },
324  { base + 193, "truncate64" },
325  { base + 194, "ftruncate64", ftruncate64Func },
326  { base + 195, "stat64", stat64Func<ArmLinux32> },
327  { base + 196, "lstat64", lstat64Func<ArmLinux32> },
328  { base + 197, "fstat64", fstat64Func<ArmLinux32> },
329  { base + 198, "lchown" },
330  { base + 199, "getuid", getuidFunc },
331  { base + 200, "getgid", getgidFunc },
332  { base + 201, "geteuid", geteuidFunc },
333  { base + 202, "getegid", getegidFunc },
334  { base + 203, "setreuid" },
335  { base + 204, "setregid" },
336  { base + 205, "getgroups" },
337  { base + 206, "setgroups" },
338  { base + 207, "fchown" },
339  { base + 208, "setresuid" },
340  { base + 209, "getresuid" },
341  { base + 210, "setresgid" },
342  { base + 211, "getresgid" },
343  { base + 212, "chown" },
344  { base + 213, "setuid" },
345  { base + 214, "setgid" },
346  { base + 215, "setfsuid" },
347  { base + 216, "setfsgid" },
348 #if defined(SYS_getdents64)
349  { base + 217, "getdents64", getdents64Func },
350 #else
351  { base + 217, "getdents64" },
352 #endif
353  { base + 218, "pivot_root" },
354  { base + 219, "mincore" },
355  { base + 220, "madvise", ignoreFunc },
356  { base + 221, "fcntl64", fcntl64Func },
357  { base + 224, "gettid", gettidFunc },
358  { base + 225, "readahead" },
359  { base + 226, "setxattr" },
360  { base + 227, "lsetxattr" },
361  { base + 228, "fsetxattr" },
362  { base + 229, "getxattr" },
363  { base + 230, "lgetxattr" },
364  { base + 231, "fgetxattr" },
365  { base + 232, "listxattr" },
366  { base + 233, "llistxattr" },
367  { base + 234, "flistxattr" },
368  { base + 235, "removexattr" },
369  { base + 236, "lremovexattr" },
370  { base + 237, "fremovexattr" },
371  { base + 238, "tkill" },
372  { base + 239, "sendfile64" },
373  { base + 240, "futex", futexFunc<ArmLinux32> },
374  { base + 241, "sched_setaffinity", ignoreWarnOnceFunc },
375  { base + 242, "sched_getaffinity", ignoreFunc },
376  { base + 243, "io_setup" },
377  { base + 244, "io_destroy" },
378  { base + 245, "io_getevents" },
379  { base + 246, "io_submit" },
380  { base + 247, "io_cancel" },
381  { base + 248, "exit_group", exitGroupFunc },
382  { base + 249, "lookup_dcookie" },
383  { base + 250, "epoll_create" },
384  { base + 251, "epoll_ctl" },
385  { base + 252, "epoll_wait" },
386  { base + 253, "remap_file_pages" },
387  { base + 256, "set_tid_address", setTidAddressFunc },
388  { base + 257, "timer_create" },
389  { base + 258, "timer_settime" },
390  { base + 259, "timer_gettime" },
391  { base + 260, "timer_getoverrun" },
392  { base + 261, "timer_delete" },
393  { base + 262, "clock_settime" },
394  { base + 263, "clock_gettime", clock_gettimeFunc<ArmLinux32> },
395  { base + 264, "clock_getres", clock_getresFunc<ArmLinux32> },
396  { base + 265, "clock_nanosleep" },
397  { base + 266, "statfs64" },
398  { base + 267, "fstatfs64" },
399  { base + 268, "tgkill", tgkillFunc<ArmLinux32> },
400  { base + 269, "utimes" },
401  { base + 270, "arm_fadvise64_64" },
402  { base + 271, "pciconfig_iobase" },
403  { base + 272, "pciconfig_read" },
404  { base + 273, "pciconfig_write" },
405  { base + 274, "mq_open" },
406  { base + 275, "mq_unlink" },
407  { base + 276, "mq_timedsend" },
408  { base + 277, "mq_timedreceive" },
409  { base + 278, "mq_notify" },
410  { base + 279, "mq_getsetattr" },
411  { base + 280, "waitid" },
412  { base + 281, "socket" },
413  { base + 282, "bind" },
414  { base + 283, "connect" },
415  { base + 284, "listen" },
416  { base + 285, "accept" },
417  { base + 286, "getsockname" },
418  { base + 287, "getpeername" },
419  { base + 288, "socketpair" },
420  { base + 289, "send" },
421  { base + 290, "sendto" },
422  { base + 291, "recv" },
423  { base + 292, "recvfrom" },
424  { base + 293, "shutdown" },
425  { base + 294, "setsockopt" },
426  { base + 295, "getsockopt" },
427  { base + 296, "sendmsg" },
428  { base + 297, "rcvmsg" },
429  { base + 298, "semop" },
430  { base + 299, "semget" },
431  { base + 300, "semctl" },
432  { base + 301, "msgsend" },
433  { base + 302, "msgrcv" },
434  { base + 303, "msgget" },
435  { base + 304, "msgctl" },
436  { base + 305, "shmat" },
437  { base + 306, "shmdt" },
438  { base + 307, "shmget" },
439  { base + 308, "shmctl" },
440  { base + 309, "add_key" },
441  { base + 310, "request_key" },
442  { base + 311, "keyctl" },
443  { base + 312, "semtimedop" },
444  { base + 314, "ioprio_set" },
445  { base + 315, "ioprio_get" },
446  { base + 316, "inotify_init" },
447  { base + 317, "inotify_add_watch" },
448  { base + 318, "inotify_rm_watch" },
449  { base + 319, "mbind" },
450  { base + 320, "get_mempolicy" },
451  { base + 321, "set_mempolicy" },
452  { base + 322, "openat", openatFunc<ArmLinux32> },
453  { base + 323, "mkdirat" },
454  { base + 324, "mknodat" },
455  { base + 325, "fchownat" },
456  { base + 326, "futimesat" },
457  { base + 327, "fstatat64" },
458  { base + 328, "unlinkat" },
459  { base + 329, "renameat" },
460  { base + 330, "linkat" },
461  { base + 331, "symlinkat" },
462  { base + 332, "readlinkat" },
463  { base + 333, "fchmodat" },
464  { base + 334, "faccessat" },
465  { base + 335, "pselect6" },
466  { base + 336, "ppoll" },
467  { base + 337, "unshare" },
468  { base + 338, "set_robust_list", ignoreFunc },
469  { base + 339, "get_robust_list" },
470  { base + 340, "splice" },
471  { base + 341, "arm_sync_file_range" },
472  { base + 342, "tee" },
473  { base + 343, "vmsplice" },
474  { base + 344, "move_pages" },
475  { base + 345, "getcpu", getcpuFunc },
476  { base + 346, "epoll_pwait" },
477  { base + 347, "sys_kexec_load" },
478  { base + 348, "sys_utimensat" },
479  { base + 349, "sys_signalfd" },
480  { base + 350, "sys_timerfd_create" },
481  { base + 351, "sys_eventfd" },
482  { base + 352, "sys_fallocate" },
483  { base + 353, "sys_timerfd_settime" },
484  { base + 354, "sys_timerfd_gettime" },
485  { base + 355, "sys_signalfd4" },
486  { base + 356, "sys_eventfd2" },
487  { base + 357, "sys_epoll_create1" },
488  { base + 358, "sys_dup3" },
489  { base + 359, "sys_pipe2" },
490  { base + 360, "sys_inotify_init1" },
491  { base + 361, "sys_preadv" },
492  { base + 362, "sys_pwritev" },
493  { base + 363, "sys_rt_tgsigqueueinfo" },
494  { base + 364, "sys_perf_event_open" },
495  { base + 365, "sys_recvmmsg" },
496  })
497  {}
498 };
499 
501 
503  public SyscallDescTable<ArmLinuxProcess64::SyscallABI>
504 {
505  public:
507  SyscallDescTable<ArmLinuxProcess64::SyscallABI>({
508  { base + 0, "io_setup" },
509  { base + 1, "io_destroy" },
510  { base + 2, "io_submit" },
511  { base + 3, "io_cancel" },
512  { base + 4, "io_getevents" },
513  { base + 5, "setxattr" },
514  { base + 6, "lsetxattr" },
515  { base + 7, "fsetxattr" },
516  { base + 8, "getxattr" },
517  { base + 9, "lgetxattr" },
518  { base + 10, "fgetxattr" },
519  { base + 11, "listxattr" },
520  { base + 12, "llistxattr" },
521  { base + 13, "flistxattr" },
522  { base + 14, "removexattr" },
523  { base + 15, "lremovexattr" },
524  { base + 16, "fremovexattr" },
525  { base + 17, "getcwd", getcwdFunc },
526  { base + 18, "lookup_dcookie" },
527  { base + 19, "eventfd2" },
528  { base + 20, "epoll_create1" },
529  { base + 21, "epoll_ctl" },
530  { base + 22, "epoll_pwait" },
531  { base + 23, "dup", dupFunc },
532  { base + 24, "dup3" },
533  { base + 25, "fcntl64", fcntl64Func },
534  { base + 26, "inotify_init1" },
535  { base + 27, "inotify_add_watch" },
536  { base + 28, "inotify_rm_watch" },
537  { base + 29, "ioctl", ioctlFunc<ArmLinux64> },
538  { base + 30, "ioprio_set" },
539  { base + 31, "ioprio_get" },
540  { base + 32, "flock" },
541  { base + 33, "mknodat" },
542  { base + 34, "mkdirat" },
543  { base + 35, "unlinkat", unlinkatFunc<ArmLinux64> },
544  { base + 36, "symlinkat" },
545  { base + 37, "linkat" },
546  { base + 38, "renameat", renameatFunc<ArmLinux64> },
547  { base + 39, "umount2" },
548  { base + 40, "mount" },
549  { base + 41, "pivot_root" },
550  { base + 42, "nfsservctl" },
551  { base + 43, "statfs64" },
552  { base + 44, "fstatfs64" },
553  { base + 45, "truncate64" },
554  { base + 46, "ftruncate64", ftruncate64Func },
555  { base + 47, "fallocate" },
556  { base + 48, "faccessat", faccessatFunc<ArmLinux64> },
557  { base + 49, "chdir" },
558  { base + 50, "fchdir" },
559  { base + 51, "chroot" },
560  { base + 52, "fchmod" },
561  { base + 53, "fchmodat" },
562  { base + 54, "fchownat" },
563  { base + 55, "fchown" },
564  { base + 56, "openat", openatFunc<ArmLinux64> },
565  { base + 57, "close", closeFunc },
566  { base + 58, "vhangup" },
567  { base + 59, "pipe2" },
568  { base + 60, "quotactl" },
569 #if defined(SYS_getdents64)
570  { base + 61, "getdents64", getdents64Func },
571 #else
572  { base + 61, "getdents64" },
573 #endif
574  { base + 62, "llseek", lseekFunc },
575  { base + 63, "read", readFunc<ArmLinux64> },
576  { base + 64, "write", writeFunc<ArmLinux64> },
577  { base + 65, "readv" },
578  { base + 66, "writev", writevFunc<ArmLinux64> },
579  { base + 67, "pread64" },
580  { base + 68, "pwrite64" },
581  { base + 69, "preadv" },
582  { base + 70, "pwritev" },
583  { base + 71, "sendfile64" },
584  { base + 72, "pselect6" },
585  { base + 73, "ppoll" },
586  { base + 74, "signalfd4" },
587  { base + 75, "vmsplice" },
588  { base + 76, "splice" },
589  { base + 77, "tee" },
590  { base + 78, "readlinkat", readlinkatFunc<ArmLinux64> },
591  { base + 79, "fstatat64", fstatat64Func<ArmLinux64> },
592  { base + 80, "fstat64", fstat64Func<ArmLinux64> },
593  { base + 81, "sync" },
594  { base + 82, "fsync" },
595  { base + 83, "fdatasync" },
596  { base + 84, "sync_file_range" },
597  { base + 85, "timerfd_create" },
598  { base + 86, "timerfd_settime" },
599  { base + 87, "timerfd_gettime" },
600  { base + 88, "utimensat" },
601  { base + 89, "acct" },
602  { base + 90, "capget" },
603  { base + 91, "capset" },
604  { base + 92, "personality" },
605  { base + 93, "exit", exitFunc },
606  { base + 94, "exit_group", exitGroupFunc },
607  { base + 95, "waitid" },
608  { base + 96, "set_tid_address", setTidAddressFunc },
609  { base + 97, "unshare" },
610  { base + 98, "futex", futexFunc<ArmLinux64> },
611  { base + 99, "set_robust_list", ignoreFunc },
612  { base + 100, "get_robust_list" },
613  { base + 101, "nanosleep", ignoreWarnOnceFunc },
614  { base + 102, "getitimer" },
615  { base + 103, "setitimer" },
616  { base + 104, "kexec_load" },
617  { base + 105, "init_module" },
618  { base + 106, "delete_module" },
619  { base + 107, "timer_create" },
620  { base + 108, "timer_gettime" },
621  { base + 109, "timer_getoverrun" },
622  { base + 110, "timer_settime" },
623  { base + 111, "timer_delete" },
624  { base + 112, "clock_settime" },
625  { base + 113, "clock_gettime", clock_gettimeFunc<ArmLinux64> },
626  { base + 114, "clock_getres" },
627  { base + 115, "clock_nanosleep" },
628  { base + 116, "syslog" },
629  { base + 117, "ptrace" },
630  { base + 118, "sched_setparam", ignoreWarnOnceFunc },
631  { base + 119, "sched_setscheduler", ignoreWarnOnceFunc },
632  { base + 120, "sched_getscheduler", ignoreWarnOnceFunc },
633  { base + 121, "sched_getparam", ignoreWarnOnceFunc },
634  { base + 122, "sched_setaffinity", ignoreWarnOnceFunc },
635  { base + 123, "sched_getaffinity", ignoreFunc },
636  { base + 124, "sched_yield", ignoreWarnOnceFunc },
637  { base + 125, "sched_get_priority_max", ignoreWarnOnceFunc },
638  { base + 126, "sched_get_priority_min", ignoreWarnOnceFunc },
639  { base + 127, "sched_rr_get_interval", ignoreWarnOnceFunc },
640  { base + 128, "restart_syscall" },
641  { base + 129, "kill", ignoreFunc },
642  { base + 130, "tkill" },
643  { base + 131, "tgkill", tgkillFunc<ArmLinux64> },
644  { base + 132, "sigaltstack" },
645  { base + 133, "rt_sigsuspend" },
646  { base + 134, "rt_sigaction", ignoreFunc },
647  { base + 135, "rt_sigprocmask", ignoreWarnOnceFunc },
648  { base + 136, "rt_sigpending" },
649  { base + 137, "rt_sigtimedwait" },
650  { base + 138, "rt_sigqueueinfo", ignoreFunc },
651  { base + 139, "rt_sigreturn" },
652  { base + 140, "setpriority" },
653  { base + 141, "getpriority" },
654  { base + 142, "reboot" },
655  { base + 143, "setregid" },
656  { base + 144, "setgid" },
657  { base + 145, "setreuid" },
658  { base + 146, "setuid" },
659  { base + 147, "setresuid" },
660  { base + 148, "getresuid" },
661  { base + 149, "setresgid" },
662  { base + 150, "getresgid" },
663  { base + 151, "setfsuid" },
664  { base + 152, "setfsgid" },
665  { base + 153, "times", timesFunc<ArmLinux64> },
666  { base + 154, "setpgid" },
667  { base + 155, "getpgid" },
668  { base + 156, "getsid" },
669  { base + 157, "setsid" },
670  { base + 158, "getgroups" },
671  { base + 159, "setgroups" },
672  { base + 160, "uname", unameFunc64 },
673  { base + 161, "sethostname", ignoreFunc },
674  { base + 162, "setdomainname" },
675  { base + 163, "getrlimit", getrlimitFunc<ArmLinux64> },
676  { base + 164, "setrlimit", ignoreFunc },
677  { base + 165, "getrusage", getrusageFunc<ArmLinux64> },
678  { base + 166, "umask" },
679  { base + 167, "prctl" },
680  { base + 168, "getcpu", getcpuFunc },
681  { base + 169, "gettimeofday", gettimeofdayFunc<ArmLinux64> },
682  { base + 170, "settimeofday" },
683  { base + 171, "adjtimex" },
684  { base + 172, "getpid", getpidFunc },
685  { base + 173, "getppid", getppidFunc },
686  { base + 174, "getuid", getuidFunc },
687  { base + 175, "geteuid", geteuidFunc },
688  { base + 176, "getgid", getgidFunc },
689  { base + 177, "getegid", getegidFunc },
690  { base + 178, "gettid", gettidFunc },
691  { base + 179, "sysinfo", sysinfoFunc<ArmLinux64> },
692  { base + 180, "mq_open" },
693  { base + 181, "mq_unlink" },
694  { base + 182, "mq_timedsend" },
695  { base + 183, "mq_timedreceive" },
696  { base + 184, "mq_notify" },
697  { base + 185, "mq_getsetattr" },
698  { base + 186, "msgget" },
699  { base + 187, "msgctl" },
700  { base + 188, "msgrcv" },
701  { base + 189, "msgsnd" },
702  { base + 190, "semget" },
703  { base + 191, "semctl" },
704  { base + 192, "semtimedop" },
705  { base + 193, "semop" },
706  { base + 194, "shmget" },
707  { base + 195, "shmctl" },
708  { base + 196, "shmat" },
709  { base + 197, "shmdt" },
710  { base + 198, "socket" },
711  { base + 199, "socketpair" },
712  { base + 200, "bind" },
713  { base + 201, "listen" },
714  { base + 202, "accept" },
715  { base + 203, "connect" },
716  { base + 204, "getsockname" },
717  { base + 205, "getpeername" },
718  { base + 206, "sendto" },
719  { base + 207, "recvfrom" },
720  { base + 208, "setsockopt" },
721  { base + 209, "getsockopt" },
722  { base + 210, "shutdown" },
723  { base + 211, "sendmsg" },
724  { base + 212, "recvmsg" },
725  { base + 213, "readahead" },
726  { base + 214, "brk", brkFunc },
727  { base + 215, "munmap", munmapFunc },
728  { base + 216, "mremap", mremapFunc<ArmLinux64> },
729  { base + 217, "add_key" },
730  { base + 218, "request_key" },
731  { base + 219, "keyctl" },
732  { base + 220, "clone", cloneBackwardsFunc<ArmLinux64> },
733  { base + 221, "execve", execveFunc<ArmLinux64> },
734  { base + 222, "mmap2", mmapFunc<ArmLinux64> },
735  { base + 223, "fadvise64_64" },
736  { base + 224, "swapon" },
737  { base + 225, "swapoff" },
738  { base + 226, "mprotect", ignoreFunc },
739  { base + 227, "msync" },
740  { base + 228, "mlock" },
741  { base + 229, "munlock" },
742  { base + 230, "mlockall" },
743  { base + 231, "munlockall" },
744  { base + 232, "mincore" },
745  { base + 233, "madvise", ignoreFunc },
746  { base + 234, "remap_file_pages" },
747  { base + 235, "mbind" },
748  { base + 236, "get_mempolicy" },
749  { base + 237, "set_mempolicy" },
750  { base + 238, "migrate_pages" },
751  { base + 239, "move_pages" },
752  { base + 240, "rt_tgsigqueueinfo" },
753  { base + 241, "perf_event_open" },
754  { base + 242, "accept4" },
755  { base + 243, "recvmmsg" },
756  { base + 260, "wait4" },
757  { base + 261, "prlimit64", prlimitFunc<ArmLinux64> },
758  { base + 262, "fanotify_init" },
759  { base + 263, "fanotify_mark" },
760  { base + 264, "name_to_handle_at" },
761  { base + 265, "open_by_handle_at" },
762  { base + 266, "clock_adjtime" },
763  { base + 267, "syncfs" },
764  { base + 268, "setns" },
765  { base + 269, "sendmmsg" },
766  { base + 270, "process_vm_readv" },
767  { base + 271, "process_vm_writev" },
768  { base + 1024, "open", openFunc<ArmLinux64> },
769  { base + 1025, "link" },
770  { base + 1026, "unlink", unlinkFunc },
771  { base + 1027, "mknod" },
772  { base + 1028, "chmod", chmodFunc<ArmLinux64> },
773  { base + 1029, "chown" },
774  { base + 1030, "mkdir", mkdirFunc },
775  { base + 1031, "rmdir" },
776  { base + 1032, "lchown" },
777  { base + 1033, "access", accessFunc },
778  { base + 1034, "rename", renameFunc },
779  { base + 1035, "readlink", readlinkFunc },
780  { base + 1036, "symlink" },
781  { base + 1037, "utimes" },
782  { base + 1038, "stat64", stat64Func<ArmLinux64> },
783  { base + 1039, "lstat64", lstat64Func<ArmLinux64> },
784  { base + 1040, "pipe", pipePseudoFunc },
785  { base + 1041, "dup2" },
786  { base + 1042, "epoll_create" },
787  { base + 1043, "inotify_init" },
788  { base + 1044, "eventfd" },
789  { base + 1045, "signalfd" },
790  { base + 1046, "sendfile" },
791  { base + 1047, "ftruncate", ftruncateFunc },
792  { base + 1048, "truncate", truncateFunc },
793  { base + 1049, "stat", statFunc<ArmLinux64> },
794  { base + 1050, "lstat" },
795  { base + 1051, "fstat", fstatFunc<ArmLinux64> },
796  { base + 1052, "fcntl", fcntlFunc },
797  { base + 1053, "fadvise64" },
798  { base + 1054, "newfstatat" },
799  { base + 1055, "fstatfs" },
800  { base + 1056, "statfs" },
801  { base + 1057, "lseek", lseekFunc },
802  { base + 1058, "mmap", mmapFunc<ArmLinux64> },
803  { base + 1059, "alarm" },
804  { base + 1060, "getpgrp" },
805  { base + 1061, "pause" },
806  { base + 1062, "time", timeFunc<ArmLinux64> },
807  { base + 1063, "utime" },
808  { base + 1064, "creat" },
809 #if defined(SYS_getdents)
810  { base + 1065, "getdents", getdentsFunc },
811 #else
812  { base + 1065, "getdents" },
813 #endif
814  { base + 1066, "futimesat" },
815  { base + 1067, "select" },
816  { base + 1068, "poll" },
817  { base + 1069, "epoll_wait" },
818  { base + 1070, "ustat" },
819  { base + 1071, "vfork" },
820  { base + 1072, "oldwait4" },
821  { base + 1073, "recv" },
822  { base + 1074, "send" },
823  { base + 1075, "bdflush" },
824  { base + 1076, "umount" },
825  { base + 1077, "uselib" },
826  { base + 1078, "_sysctl" },
827  { base + 1079, "fork" }
828  })
829  {}
830 };
831 
833 
835  { 0xf0001, "breakpoint" },
836  { 0xf0002, "cacheflush" },
837  { 0xf0003, "usr26" },
838  { 0xf0004, "usr32" },
839  { 0xf0005, "set_tls", setTLSFunc32 },
840 };
841 
842 // Indices 1, 3 and 4 are unallocated.
844  { 0x1002, "cacheflush" },
845  { 0x1005, "set_tls", setTLSFunc64 }
846 };
847 
849  ::Loader::ObjectFile *objFile, ::Loader::Arch _arch) :
850  ArmProcess32(params, objFile, _arch)
851 {}
852 
854  ::Loader::ObjectFile *objFile, ::Loader::Arch _arch) :
855  ArmProcess64(params, objFile, _arch)
856 {}
857 
858 const Addr ArmLinuxProcess32::commPage = 0xffff0000;
859 
860 void
862 {
866 
867  uint8_t swiNeg1[] = {
868  0xff, 0xff, 0xff, 0xef // swi -1
869  };
870 
871  // Fill this page with swi -1 so we'll no if we land in it somewhere.
872  for (Addr addr = 0; addr < PageBytes; addr += sizeof(swiNeg1)) {
874  swiNeg1, sizeof(swiNeg1));
875  }
876 
877  uint8_t memory_barrier[] =
878  {
879  0x5f, 0xf0, 0x7f, 0xf5, // dmb
880  0x0e, 0xf0, 0xa0, 0xe1 // return
881  };
882  tc->getVirtProxy().writeBlob(commPage + 0x0fa0, memory_barrier,
883  sizeof(memory_barrier));
884 
885  uint8_t cmpxchg[] =
886  {
887  0x9f, 0x3f, 0x92, 0xe1, // ldrex r3, [r2]
888  0x00, 0x30, 0x53, 0xe0, // subs r3, r3, r0
889  0x91, 0x3f, 0x82, 0x01, // strexeq r3, r1, [r2]
890  0x01, 0x00, 0x33, 0x03, // teqeq r3, #1
891  0xfa, 0xff, 0xff, 0x0a, // beq 1b
892  0x00, 0x00, 0x73, 0xe2, // rsbs r0, r3, #0
893  0x5f, 0xf0, 0x7f, 0xf5, // dmb
894  0x0e, 0xf0, 0xa0, 0xe1 // return
895  };
896  tc->getVirtProxy().writeBlob(commPage + 0x0fc0, cmpxchg, sizeof(cmpxchg));
897 
898  uint8_t get_tls[] =
899  {
900  // read user read-only thread id register
901  0x70, 0x0f, 0x1d, 0xee, // mrc p15, 0, r0, c13, c0, 3
902  0x0e, 0xf0, 0xa0, 0xe1 // return
903  };
904  tc->getVirtProxy().writeBlob(commPage + 0x0fe0, get_tls, sizeof(get_tls));
905 }
906 
907 void
909 {
911  // The 64 bit equivalent of the comm page would be set up here.
912 }
913 
914 void
916 {
918 
919  int num = tc->readIntReg(INTREG_R7);
920  SyscallDesc *desc = syscallDescs32Low.get(num, false);
921  if (!desc)
922  desc = syscallDescs32Low.get(num, false);
923  if (!desc)
924  desc = privSyscallDescs32.get(num);
925  desc->doSyscall(tc);
926 }
927 
928 void
930 {
932 
933  int num = tc->readIntReg(INTREG_X8);
934  SyscallDesc *desc = syscallDescs64Low.get(num, false);
935  if (!desc)
936  desc = syscallDescs64Low.get(num, false);
937  if (!desc)
938  desc = privSyscallDescs64.get(num);
939  desc->doSyscall(tc);
940 }
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:183
ArmProcess64::initState
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition: process.cc:122
geteuidFunc
SyscallReturn geteuidFunc(SyscallDesc *desc, ThreadContext *tc)
Target geteuid() handler.
Definition: syscall_emul.cc:956
Loader::Linux
@ Linux
Definition: object_file.hh:62
munmapFunc
SyscallReturn munmapFunc(SyscallDesc *desc, ThreadContext *tc, Addr start, size_t length)
Target munmap() handler.
Definition: syscall_emul.cc:331
Process::Loader
Each instance of a Loader subclass will have a chance to try to load an object file when tryLoaders i...
Definition: process.hh:185
dupFunc
SyscallReturn dupFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd)
FIXME: The file description is not shared among file descriptors created with dup.
Definition: syscall_emul.cc:671
ignoreFunc
SyscallReturn ignoreFunc(SyscallDesc *desc, ThreadContext *tc)
Handler for unimplemented syscalls that we never intend to implement (signal handling,...
Definition: syscall_emul.cc:73
warn
#define warn(...)
Definition: logging.hh:239
linux.hh
syscallDescs32High
static SyscallTable32 syscallDescs32High(0x900000)
system.hh
Loader::Thumb
@ Thumb
Definition: object_file.hh:53
ArmLinuxProcess64::syscall
void syscall(ThreadContext *tc) override
Definition: process.cc:929
SyscallDescTable
Definition: syscall_desc.hh:180
Loader::Arm
@ Arm
Definition: object_file.hh:52
Process
Definition: process.hh:65
ArmProcess64
Definition: process.hh:117
chownFunc
SyscallReturn chownFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, uint32_t owner, uint32_t group)
Target chown() handler.
Definition: syscall_emul.cc:625
ProxyPtr
Definition: proxy_ptr.hh:236
syscallDescs64High
static SyscallTable64 syscallDescs64High(0x900000)
mkdirFunc
SyscallReturn mkdirFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, mode_t mode)
Target mkdir() handler.
Definition: syscall_emul.cc:509
unlinkFunc
SyscallReturn unlinkFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname)
Target unlink() handler.
Definition: syscall_emul.cc:452
X86ISA::base
Bitfield< 51, 12 > base
Definition: pagetable.hh:141
getegidFunc
SyscallReturn getegidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getegid() handler.
Definition: syscall_emul.cc:970
ThreadContext::getProcessPtr
virtual Process * getProcessPtr()=0
unameFunc32
static SyscallReturn unameFunc32(SyscallDesc *desc, ThreadContext *tc, VPtr< Linux::utsname > name)
Target uname() handler.
Definition: process.cc:103
ftruncateFunc
SyscallReturn ftruncateFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, off_t length)
Target ftruncate() handler.
Definition: syscall_emul.cc:560
umaskFunc
SyscallReturn umaskFunc(SyscallDesc *desc, ThreadContext *tc)
Target umask() handler.
Definition: syscall_emul.cc:614
Process::syscall
virtual void syscall(ThreadContext *tc)
Definition: process.hh:78
ArmISA
Definition: ccregs.hh:41
SyscallTable64
Definition: process.cc:502
ArmLinuxProcess64::ArmLinuxProcess64
ArmLinuxProcess64(ProcessParams *params, ::Loader::ObjectFile *objFile, ::Loader::Arch _arch)
Definition: process.cc:853
lseekFunc
SyscallReturn lseekFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint64_t offs, int whence)
Target lseek() handler.
Definition: syscall_emul.cc:287
exitFunc
SyscallReturn exitFunc(SyscallDesc *desc, ThreadContext *tc, int status)
Target exit() handler: terminate current context.
Definition: syscall_emul.cc:230
ArmProcess32::initState
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition: process.cc:103
PortProxy::writeBlob
void writeBlob(Addr addr, const void *p, int size) const
Same as tryWriteBlob, but insists on success.
Definition: port_proxy.hh:187
unameFunc64
static SyscallReturn unameFunc64(SyscallDesc *desc, ThreadContext *tc, VPtr< Linux::utsname > name)
Target uname() handler.
Definition: process.cc:118
setTLSFunc32
static SyscallReturn setTLSFunc32(SyscallDesc *desc, ThreadContext *tc, uint32_t tlsPtr)
Target set_tls() handler.
Definition: process.cc:133
SyscallTable32
Definition: process.cc:149
getpidFunc
SyscallReturn getpidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getpid() handler.
Definition: syscall_emul.cc:928
Loader::ObjectFile
Definition: object_file.hh:70
renameFunc
SyscallReturn renameFunc(SyscallDesc *desc, ThreadContext *tc, Addr oldpath, Addr newpath)
Target rename() handler.
Definition: syscall_emul.cc:523
brkFunc
SyscallReturn brkFunc(SyscallDesc *desc, ThreadContext *tc, Addr new_brk)
Target brk() handler: set brk address.
Definition: syscall_emul.cc:249
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
_llseekFunc
SyscallReturn _llseekFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint64_t offset_high, uint32_t offset_low, Addr result_ptr, int whence)
Target _llseek() handler.
Definition: syscall_emul.cc:304
setTLSFunc64
static SyscallReturn setTLSFunc64(SyscallDesc *desc, ThreadContext *tc, uint32_t tlsPtr)
Definition: process.cc:142
ArmLinuxProcess32
A process with emulated Arm/Linux syscalls.
Definition: process.hh:77
ArmISA::MISCREG_TPIDRRO_EL0
@ MISCREG_TPIDRRO_EL0
Definition: miscregs.hh:741
readlinkFunc
SyscallReturn readlinkFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, Addr buf_ptr, size_t bufsiz)
Target readlink() handler.
Definition: syscall_emul.cc:394
Process::allocateMem
void allocateMem(Addr vaddr, int64_t size, bool clobber=false)
Definition: process.cc:319
ArmISA::MISCREG_TPIDRURO
@ MISCREG_TPIDRURO
Definition: miscregs.hh:399
truncateFunc
SyscallReturn truncateFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, off_t length)
Target truncate() handler.
Definition: syscall_emul.cc:544
process.hh
ArmLinuxProcess32::initState
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition: process.cc:861
Loader::UnknownOpSys
@ UnknownOpSys
Definition: object_file.hh:60
getppidFunc
SyscallReturn getppidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getppid() handler.
Definition: syscall_emul.cc:942
linux.hh
ArmISA::INTREG_R7
@ INTREG_R7
Definition: intregs.hh:61
SyscallTable64::SyscallTable64
SyscallTable64(int base)
Definition: process.cc:506
ArmProcess32
Definition: process.hh:74
privSyscallDescs64
static SyscallDescTable< ArmLinuxProcess64::SyscallABI > privSyscallDescs64
Definition: process.cc:843
ftruncate64Func
SyscallReturn ftruncate64Func(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int64_t length)
Target ftruncate64() handler.
Definition: syscall_emul.cc:595
exitGroupFunc
SyscallReturn exitGroupFunc(SyscallDesc *desc, ThreadContext *tc, int status)
Target exit_group() handler: terminate simulation. (exit all threads)
Definition: syscall_emul.cc:236
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
SyscallReturn
This class represents the return value from an emulated system call, including any errno setting.
Definition: syscall_return.hh:52
name
const std::string & name()
Definition: trace.cc:50
Process::contextIds
std::vector< ContextID > contextIds
Definition: process.hh:160
setTidAddressFunc
SyscallReturn setTidAddressFunc(SyscallDesc *desc, ThreadContext *tc, uint64_t tidPtr)
Target set_tid_address() handler.
Definition: syscall_emul.cc:271
SyscallDesc::doSyscall
void doSyscall(ThreadContext *tc)
Interface for invoking the system call funcion pointer.
Definition: syscall_desc.cc:38
ThreadContext::getVirtProxy
virtual PortProxy & getVirtProxy()=0
fcntlFunc
SyscallReturn fcntlFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int cmd, GuestABI::VarArgs< int > varargs)
Target fcntl() handler.
Definition: syscall_emul.cc:719
getcwdFunc
SyscallReturn getcwdFunc(SyscallDesc *desc, ThreadContext *tc, Addr buf_ptr, unsigned long size)
Target getcwd() handler.
Definition: syscall_emul.cc:364
System::threads
Threads threads
Definition: system.hh:309
ArmLinuxProcess64::initState
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition: process.cc:908
ArmISA::PageBytes
const Addr PageBytes
Definition: isa_traits.hh:52
Loader::Arch
Arch
Definition: object_file.hh:44
gettidFunc
SyscallReturn gettidFunc(SyscallDesc *desc, ThreadContext *tc)
Target gettid() handler.
Definition: syscall_emul.cc:935
ignoreWarnOnceFunc
SyscallReturn ignoreWarnOnceFunc(SyscallDesc *desc, ThreadContext *tc)
Like above, but only prints a warning once per syscall desc it's used with.
Definition: syscall_emul.cc:80
getuidFunc
SyscallReturn getuidFunc(SyscallDesc *desc, ThreadContext *tc)
Definition: syscall_emul.cc:949
syscall_emul.hh
Loader::ObjectFile::getArch
Arch getArch() const
Definition: object_file.hh:99
closeFunc
SyscallReturn closeFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd)
Target close() handler.
Definition: syscall_emul.cc:280
std
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:587
Loader::LinuxArmOABI
@ LinuxArmOABI
Definition: object_file.hh:64
SyscallTable32::SyscallTable32
SyscallTable32(int base)
Definition: process.cc:153
ThreadContext::setMiscReg
virtual void setMiscReg(RegIndex misc_reg, RegVal val)=0
addr
ip6_addr_t addr
Definition: inet.hh:423
ArmLinuxProcess32::commPage
static const Addr commPage
A page to hold "kernel" provided functions. The name might be wrong.
Definition: process.hh:88
Loader::ObjectFile::getOpSys
OpSys getOpSys() const
Definition: object_file.hh:100
isa_traits.hh
ArmLinuxProcess32::syscall
void syscall(ThreadContext *tc) override
Definition: process.cc:915
ArmISA::INTREG_X8
@ INTREG_X8
Definition: intregs.hh:135
fcntl64Func
SyscallReturn fcntl64Func(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int cmd)
Target fcntl64() handler.
Definition: syscall_emul.cc:761
Loader::Arm64
@ Arm64
Definition: object_file.hh:51
process.hh
trace.hh
Process::system
System * system
Definition: process.hh:163
SyscallDescTable::get
SyscallDesc * get(int num, bool fatal_if_missing=true)
Definition: syscall_desc.hh:195
ArmLinuxProcess64
A process with emulated Arm/Linux syscalls.
Definition: process.hh:96
ThreadContext::readIntReg
virtual RegVal readIntReg(RegIndex reg_idx) const =0
syscallDescs32Low
static SyscallTable32 syscallDescs32Low(0)
getgidFunc
SyscallReturn getgidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getgid() handler.
Definition: syscall_emul.cc:963
pipePseudoFunc
SyscallReturn pipePseudoFunc(SyscallDesc *desc, ThreadContext *tc)
Pseudo Funcs - These functions use a different return convension, returning a second value in a regis...
Definition: syscall_emul.cc:790
object_file.hh
ArmLinuxProcess32::ArmLinuxProcess32
ArmLinuxProcess32(ProcessParams *params, ::Loader::ObjectFile *objFile, ::Loader::Arch _arch)
Definition: process.cc:848
accessFunc
SyscallReturn accessFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, mode_t mode)
Target access() handler.
Definition: syscall_emul.cc:999
thread_context.hh
SyscallDesc
This class provides the wrapper interface for the system call implementations which are defined in th...
Definition: syscall_desc.hh:66
syscall_desc.hh
getcpuFunc
SyscallReturn getcpuFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< uint32_t > cpu, VPtr< uint32_t > node, VPtr< uint32_t > tcache)
Definition: syscall_emul.cc:1639
syscallDescs64Low
static SyscallTable64 syscallDescs64Low(0)
privSyscallDescs32
static SyscallDescTable< ArmLinuxProcess32::SyscallABI > privSyscallDescs32
Definition: process.cc:834

Generated on Wed Sep 30 2020 14:01:59 for gem5 by doxygen 1.8.17