33 #include <sys/syscall.h>
47 class LinuxLoader :
public Process::Loader
51 load(
const ProcessParams ¶ms, loader::ObjectFile *obj)
override
53 auto arch = obj->getArch();
54 auto opsys = obj->getOpSys();
60 warn(
"Unknown operating system; assuming Linux.");
68 return new RiscvProcess64(params, obj);
70 return new RiscvProcess32(params, obj);
74 LinuxLoader linuxLoader;
87 process->Process::syscall(tc);
102 strcpy(
name->sysname,
"Linux");
103 strcpy(
name->nodename,
"sim.gem5.org");
104 strcpy(
name->release, process->release.c_str());
105 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
106 strcpy(
name->machine,
"riscv64");
117 strcpy(
name->sysname,
"Linux");
118 strcpy(
name->nodename,
"sim.gem5.org");
119 strcpy(
name->release, process->release.c_str());
120 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
121 strcpy(
name->machine,
"riscv32");
131 { 4,
"io_getevents" },
139 { 12,
"llistxattr" },
140 { 13,
"flistxattr" },
141 { 14,
"removexattr" },
142 { 15,
"lremovexattr" },
143 { 16,
"fremovexattr" },
145 { 18,
"lookup_dcookie" },
147 { 20,
"epoll_create1" },
149 { 22,
"epoll_pwait" },
153 { 26,
"inotify_init1" },
154 { 27,
"inotify_add_watch" },
155 { 28,
"inotify_rm_watch" },
156 { 29,
"ioctl", ioctlFunc<RiscvLinux64> },
157 { 30,
"ioprio_get" },
158 { 31,
"ioprio_set" },
160 { 33,
"mknodat", mknodatFunc<RiscvLinux64> },
161 { 34,
"mkdirat", mkdiratFunc<RiscvLinux64> },
162 { 35,
"unlinkat", unlinkatFunc<RiscvLinux64> },
165 { 38,
"renameat", renameatFunc<RiscvLinux64> },
168 { 41,
"pivot_root" },
169 { 42,
"nfsservctl" },
170 { 43,
"statfs", statfsFunc<RiscvLinux64> },
171 { 44,
"fstatfs", fstatfsFunc<RiscvLinux64> },
172 { 45,
"truncate", truncateFunc<RiscvLinux64> },
174 { 47,
"fallocate", fallocateFunc<RiscvLinux64> },
175 { 48,
"faccessat", faccessatFunc<RiscvLinux64> },
179 { 52,
"fchmod", fchmodFunc<RiscvLinux64> },
183 { 56,
"openat", openatFunc<RiscvLinux64> },
188 #if defined(SYS_getdents64)
189 { 61,
"getdents64", getdents64Func },
191 { 61,
"getdents64" },
194 { 63,
"read", readFunc<RiscvLinux64> },
195 { 64,
"write", writeFunc<RiscvLinux64> },
196 { 66,
"writev", writevFunc<RiscvLinux64> },
197 { 67,
"pread64", pread64Func<RiscvLinux64> },
198 { 68,
"pwrite64", pwrite64Func<RiscvLinux64> },
204 { 74,
"signalfd64" },
208 { 78,
"readlinkat", readlinkatFunc<RiscvLinux64> },
209 { 79,
"fstatat", fstatat64Func<RiscvLinux64> },
210 { 80,
"fstat", fstat64Func<RiscvLinux64> },
214 { 84,
"sync_file_range2" },
215 { 85,
"timerfd_create" },
216 { 86,
"timerfd_settime" },
217 { 87,
"timerfd_gettime" },
222 { 92,
"personality" },
228 { 98,
"futex", futexFunc<RiscvLinux64> },
232 { 102,
"getitimer" },
233 { 103,
"setitimer" },
234 { 104,
"kexec_load" },
235 { 105,
"init_module" },
236 { 106,
"delete_module" },
237 { 107,
"timer_create" },
238 { 108,
"timer_gettime" },
239 { 109,
"timer_getoverrun" },
240 { 110,
"timer_settime" },
241 { 111,
"timer_delete" },
242 { 112,
"clock_settime" },
243 { 113,
"clock_gettime", clock_gettimeFunc<RiscvLinux64> },
244 { 114,
"clock_getres", clock_getresFunc<RiscvLinux64> },
245 { 115,
"clock_nanosleep" },
248 { 118,
"sched_setparam" },
249 { 119,
"sched_setscheduler" },
250 { 120,
"sched_getscheduler" },
251 { 121,
"sched_getparam" },
252 { 122,
"sched_setaffinity" },
253 { 123,
"sched_getaffinity", schedGetaffinityFunc<RiscvLinux64> },
255 { 125,
"sched_get_priority_max" },
256 { 126,
"sched_get_priority_min" },
257 { 127,
"scheD_rr_get_interval" },
258 { 128,
"restart_syscall" },
261 { 131,
"tgkill", tgkillFunc<RiscvLinux64> },
262 { 132,
"sigaltstack" },
270 { 140,
"setpriority" },
271 { 141,
"getpriority" },
277 { 147,
"setresuid" },
278 { 148,
"getresuid" },
279 { 149,
"getresgid" },
280 { 150,
"getresgid" },
283 { 153,
"times", timesFunc<RiscvLinux64> },
288 { 158,
"getgroups" },
289 { 159,
"setgroups" },
291 { 161,
"sethostname" },
292 { 162,
"setdomainname" },
293 { 163,
"getrlimit", getrlimitFunc<RiscvLinux64> },
295 { 165,
"getrusage", getrusageFunc<RiscvLinux64> },
299 { 169,
"gettimeofday", gettimeofdayFunc<RiscvLinux64> },
300 { 170,
"settimeofday" },
309 { 179,
"sysinfo", sysinfoFunc<RiscvLinux64> },
311 { 181,
"mq_unlink" },
312 { 182,
"mq_timedsend" },
313 { 183,
"mq_timedrecieve" },
314 { 184,
"mq_notify" },
315 { 185,
"mq_getsetattr" },
322 { 192,
"semtimedop" },
328 { 198,
"socket", socketFunc<RiscvLinux64> },
329 { 199,
"socketpair", socketpairFunc<RiscvLinux64> },
332 { 202,
"accept", acceptFunc<RiscvLinux64> },
336 { 206,
"sendto", sendtoFunc<RiscvLinux64> },
337 { 207,
"recvfrom", recvfromFunc<RiscvLinux64> },
343 { 213,
"readahead" },
345 { 215,
"munmap", munmapFunc<RiscvLinux64> },
346 { 216,
"mremap", mremapFunc<RiscvLinux64> },
348 { 218,
"request_key" },
350 { 220,
"clone", cloneBackwardsFunc<RiscvLinux64> },
351 { 221,
"execve", execveFunc<RiscvLinux64> },
352 { 222,
"mmap", mmapFunc<RiscvLinux64> },
353 { 223,
"fadvise64" },
364 { 234,
"remap_file_pages" },
366 { 236,
"get_mempolicy" },
367 { 237,
"set_mempolicy" },
368 { 238,
"migrate_pages" },
369 { 239,
"move_pages" },
370 { 240,
"tgsigqueueinfo" },
371 { 241,
"perf_event_open" },
374 { 260,
"wait4", wait4Func<RiscvLinux64> },
375 { 261,
"prlimit64", prlimitFunc<RiscvLinux64> },
376 { 262,
"fanotify_init" },
377 { 263,
"fanotify_mark" },
378 { 264,
"name_to_handle_at" },
379 { 265,
"open_by_handle_at" },
380 { 266,
"clock_adjtime" },
384 { 270,
"process_vm_ready" },
385 { 271,
"process_vm_writev" },
387 { 273,
"finit_module" },
388 { 274,
"sched_setattr" },
389 { 275,
"sched_getattr" },
390 { 276,
"renameat2" },
392 { 278,
"getrandom", getrandomFunc<RiscvLinux64> },
393 { 279,
"memfd_create" },
396 { 282,
"userfaultid" },
397 { 283,
"membarrier" },
399 { 285,
"copy_file_range" },
402 { 1024,
"open", openFunc<RiscvLinux64> },
406 { 1028,
"chmod", chmodFunc<RiscvLinux64> },
413 { 1035,
"readlink", readlinkFunc<RiscvLinux64> },
415 { 1037,
"utimes", utimesFunc<RiscvLinux64> },
416 { 1038,
"stat", stat64Func<RiscvLinux64> },
417 { 1039,
"lstat", lstat64Func<RiscvLinux64> },
420 { 1042,
"epoll_create" },
421 { 1043,
"inotifiy_init" },
422 { 1044,
"eventfd", eventfdFunc<RiscvLinux64> },
423 { 1045,
"signalfd" },
424 { 1046,
"sendfile" },
427 { 1049,
"stat", stat64Func<RiscvLinux64> },
428 { 1050,
"lstat", lstat64Func<RiscvLinux64> },
429 { 1051,
"fstat", fstat64Func<RiscvLinux64> },
431 { 1053,
"fadvise64" },
432 { 1054,
"newfstatat", newfstatatFunc<RiscvLinux64> },
433 { 1055,
"fstatfs", fstatfsFunc<RiscvLinux64> },
434 { 1056,
"statfs", statfsFunc<RiscvLinux64> },
436 { 1058,
"mmap", mmapFunc<RiscvLinux64> },
440 { 1062,
"time", timeFunc<RiscvLinux64> },
443 #if defined(SYS_getdents)
444 { 1065,
"getdents", getdentsFunc },
446 { 1065,
"getdents" },
448 { 1066,
"futimesat" },
449 { 1067,
"select", selectFunc<RiscvLinux64> },
450 { 1068,
"poll", pollFunc<RiscvLinux64> },
451 { 1069,
"epoll_wait" },
454 { 1072,
"oldwait4" },
462 { 2011,
"getmainvars" }
470 { 4,
"io_getevents" },
478 { 12,
"llistxattr" },
479 { 13,
"flistxattr" },
480 { 14,
"removexattr" },
481 { 15,
"lremovexattr" },
482 { 16,
"fremovexattr" },
484 { 18,
"lookup_dcookie" },
486 { 20,
"epoll_create1" },
488 { 22,
"epoll_pwait" },
492 { 26,
"inotify_init1" },
493 { 27,
"inotify_add_watch" },
494 { 28,
"inotify_rm_watch" },
495 { 29,
"ioctl", ioctlFunc<RiscvLinux32> },
496 { 30,
"ioprio_get" },
497 { 31,
"ioprio_set" },
499 { 33,
"mknodat", mknodatFunc<RiscvLinux32> },
500 { 34,
"mkdirat", mkdiratFunc<RiscvLinux32> },
501 { 35,
"unlinkat", unlinkatFunc<RiscvLinux32> },
504 { 38,
"renameat", renameatFunc<RiscvLinux32> },
507 { 41,
"pivot_root" },
508 { 42,
"nfsservctl" },
509 { 43,
"statfs", statfsFunc<RiscvLinux32> },
510 { 44,
"fstatfs", fstatfsFunc<RiscvLinux32> },
511 { 45,
"truncate", truncateFunc<RiscvLinux32> },
512 { 46,
"ftruncate", ftruncateFunc<RiscvLinux32> },
513 { 47,
"fallocate", fallocateFunc<RiscvLinux32> },
514 { 48,
"faccessat", faccessatFunc<RiscvLinux32> },
518 { 52,
"fchmod", fchmodFunc<RiscvLinux32> },
522 { 56,
"openat", openatFunc<RiscvLinux32> },
527 #if defined(SYS_getdents64)
528 { 61,
"getdents64", getdents64Func },
530 { 61,
"getdents64" },
533 { 63,
"read", readFunc<RiscvLinux32> },
534 { 64,
"write", writeFunc<RiscvLinux32> },
535 { 66,
"writev", writevFunc<RiscvLinux32> },
536 { 67,
"pread64", pread64Func<RiscvLinux32> },
537 { 68,
"pwrite64", pwrite64Func<RiscvLinux32> },
543 { 74,
"signalfd64" },
547 { 78,
"readlinkat", readlinkatFunc<RiscvLinux32> },
549 { 80,
"fstat", fstatFunc<RiscvLinux32> },
553 { 84,
"sync_file_range2" },
554 { 85,
"timerfd_create" },
555 { 86,
"timerfd_settime" },
556 { 87,
"timerfd_gettime" },
561 { 92,
"personality" },
567 { 98,
"futex", futexFunc<RiscvLinux32> },
570 { 101,
"nanosleep" },
571 { 102,
"getitimer" },
572 { 103,
"setitimer" },
573 { 104,
"kexec_load" },
574 { 105,
"init_module" },
575 { 106,
"delete_module" },
576 { 107,
"timer_create" },
577 { 108,
"timer_gettime" },
578 { 109,
"timer_getoverrun" },
579 { 110,
"timer_settime" },
580 { 111,
"timer_delete" },
581 { 112,
"clock_settime" },
582 { 113,
"clock_gettime", clock_gettimeFunc<RiscvLinux32> },
583 { 114,
"clock_getres", clock_getresFunc<RiscvLinux32> },
584 { 115,
"clock_nanosleep" },
587 { 118,
"sched_setparam" },
588 { 119,
"sched_setscheduler" },
589 { 120,
"sched_getscheduler" },
590 { 121,
"sched_getparam" },
591 { 122,
"sched_setaffinity" },
592 { 123,
"sched_getaffinity", schedGetaffinityFunc<RiscvLinux32> },
594 { 125,
"sched_get_priority_max" },
595 { 126,
"sched_get_priority_min" },
596 { 127,
"scheD_rr_get_interval" },
597 { 128,
"restart_syscall" },
600 { 131,
"tgkill", tgkillFunc<RiscvLinux32> },
601 { 132,
"sigaltstack" },
609 { 140,
"setpriority" },
610 { 141,
"getpriority" },
616 { 147,
"setresuid" },
617 { 148,
"getresuid" },
618 { 149,
"getresgid" },
619 { 150,
"getresgid" },
622 { 153,
"times", timesFunc<RiscvLinux32> },
627 { 158,
"getgroups" },
628 { 159,
"setgroups" },
630 { 161,
"sethostname" },
631 { 162,
"setdomainname" },
632 { 163,
"getrlimit", getrlimitFunc<RiscvLinux32> },
634 { 165,
"getrusage", getrusageFunc<RiscvLinux32> },
638 { 169,
"gettimeofday", gettimeofdayFunc<RiscvLinux32> },
639 { 170,
"settimeofday" },
648 { 179,
"sysinfo", sysinfoFunc<RiscvLinux32> },
650 { 181,
"mq_unlink" },
651 { 182,
"mq_timedsend" },
652 { 183,
"mq_timedrecieve" },
653 { 184,
"mq_notify" },
654 { 185,
"mq_getsetattr" },
661 { 192,
"semtimedop" },
667 { 198,
"socket", socketFunc<RiscvLinux32> },
668 { 199,
"socketpair", socketpairFunc<RiscvLinux32> },
671 { 202,
"accept", acceptFunc<RiscvLinux32> },
675 { 206,
"sendto", sendtoFunc<RiscvLinux32> },
676 { 207,
"recvfrom", recvfromFunc<RiscvLinux32> },
682 { 213,
"readahead" },
684 { 215,
"munmap", munmapFunc<RiscvLinux32> },
685 { 216,
"mremap", mremapFunc<RiscvLinux32> },
687 { 218,
"request_key" },
689 { 220,
"clone", cloneBackwardsFunc<RiscvLinux32> },
690 { 221,
"execve", execveFunc<RiscvLinux32> },
691 { 222,
"mmap", mmapFunc<RiscvLinux32> },
692 { 223,
"fadvise64" },
703 { 234,
"remap_file_pages" },
705 { 236,
"get_mempolicy" },
706 { 237,
"set_mempolicy" },
707 { 238,
"migrate_pages" },
708 { 239,
"move_pages" },
709 { 240,
"tgsigqueueinfo" },
710 { 241,
"perf_event_open" },
713 { 260,
"wait4", wait4Func<RiscvLinux32> },
714 { 261,
"prlimit64", prlimitFunc<RiscvLinux32> },
715 { 262,
"fanotify_init" },
716 { 263,
"fanotify_mark" },
717 { 264,
"name_to_handle_at" },
718 { 265,
"open_by_handle_at" },
719 { 266,
"clock_adjtime" },
723 { 270,
"process_vm_ready" },
724 { 271,
"process_vm_writev" },
726 { 273,
"finit_module" },
727 { 274,
"sched_setattr" },
728 { 275,
"sched_getattr" },
729 { 276,
"renameat2" },
731 { 278,
"getrandom", getrandomFunc<RiscvLinux32> },
732 { 279,
"memfd_create" },
735 { 282,
"userfaultid" },
736 { 283,
"membarrier" },
738 { 285,
"copy_file_range" },
741 { 1024,
"open", openFunc<RiscvLinux32> },
745 { 1028,
"chmod", chmodFunc<RiscvLinux32> },
752 { 1035,
"readlink", readlinkFunc<RiscvLinux32> },
754 { 1037,
"utimes", utimesFunc<RiscvLinux32> },
755 { 1038,
"stat", statFunc<RiscvLinux32> },
756 { 1039,
"lstat", lstatFunc<RiscvLinux32> },
759 { 1042,
"epoll_create" },
760 { 1043,
"inotifiy_init" },
761 { 1044,
"eventfd", eventfdFunc<RiscvLinux32> },
762 { 1045,
"signalfd" },
763 { 1046,
"sendfile" },
764 { 1047,
"ftruncate", ftruncateFunc<RiscvLinux32> },
765 { 1048,
"truncate", truncateFunc<RiscvLinux32> },
766 { 1049,
"stat", statFunc<RiscvLinux32> },
767 { 1050,
"lstat", lstatFunc<RiscvLinux32> },
768 { 1051,
"fstat", fstatFunc<RiscvLinux32> },
770 { 1053,
"fadvise64" },
771 { 1054,
"newfstatat", newfstatatFunc<RiscvLinux32> },
772 { 1055,
"fstatfs", fstatfsFunc<RiscvLinux32> },
773 { 1056,
"statfs", statfsFunc<RiscvLinux32> },
775 { 1058,
"mmap", mmapFunc<RiscvLinux32> },
779 { 1062,
"time", timeFunc<RiscvLinux32> },
782 #if defined(SYS_getdents)
783 { 1065,
"getdents", getdentsFunc },
785 { 1065,
"getdents" },
787 { 1066,
"futimesat" },
788 { 1067,
"select", selectFunc<RiscvLinux32> },
789 { 1068,
"poll", pollFunc<RiscvLinux32> },
790 { 1069,
"epoll_wait" },
793 { 1072,
"oldwait4" },
801 { 2011,
"getmainvars" }
void syscall(ThreadContext *tc) override
static SyscallDescTable< SEWorkload::SyscallABI > syscallDescs32
32 bit syscall descriptors, indexed by call number.
static SyscallDescTable< SEWorkload::SyscallABI > syscallDescs64
64 bit syscall descriptors, indexed by call number.
This class provides the wrapper interface for the system call implementations which are defined in th...
This class represents the return value from an emulated system call, including any errno setting.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual RegVal getReg(const RegId ®) const
virtual Process * getProcessPtr()=0
static SyscallReturn unameFunc32(SyscallDesc *desc, ThreadContext *tc, VPtr< Linux::utsname > name)
Target uname() handler.
constexpr auto & SyscallNumReg
static SyscallReturn unameFunc64(SyscallDesc *desc, ThreadContext *tc, VPtr< Linux::utsname > name)
Target uname() handler.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
SyscallReturn linkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr<> new_pathname)
Target link() handler.
SyscallReturn getppidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getppid() handler.
SyscallReturn exitGroupFunc(SyscallDesc *desc, ThreadContext *tc, int status)
Target exit_group() handler: terminate simulation. (exit all threads)
SyscallReturn gettidFunc(SyscallDesc *desc, ThreadContext *tc)
Target gettid() handler.
SyscallReturn recvmsgFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> msgPtr, int flags)
SyscallReturn brkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> new_brk)
Target brk() handler: set brk address.
SyscallReturn pipe2Func(SyscallDesc *desc, ThreadContext *tc, VPtr<> tgt_addr, int flags)
Target pipe() handler.
SyscallReturn getpidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getpid() handler.
SyscallReturn chdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
Target chdir() handler.
SyscallReturn truncate64Func(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, int64_t length)
Target truncate64() handler.
SyscallReturn getuidFunc(SyscallDesc *desc, ThreadContext *tc)
SyscallReturn chownFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, uint32_t owner, uint32_t group)
Target chown() handler.
SyscallReturn renameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> oldpath, VPtr<> newpath)
Target rename() handler.
SyscallReturn mknodFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode, dev_t dev)
Target mknod() handler.
SyscallReturn setTidAddressFunc(SyscallDesc *desc, ThreadContext *tc, uint64_t tidPtr)
Target set_tid_address() handler.
SyscallReturn setpgidFunc(SyscallDesc *desc, ThreadContext *tc, int pid, int pgid)
Target setpgid() handler.
SyscallReturn geteuidFunc(SyscallDesc *desc, ThreadContext *tc)
Target geteuid() handler.
SyscallReturn getcwdFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> buf_ptr, unsigned long size)
Target getcwd() handler.
SyscallReturn symlinkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr<> new_pathname)
Target symlink() handler.
SyscallReturn unlinkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
Target unlink() handler.
SyscallReturn pipeFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> tgt_addr)
Target pipe() handler.
SyscallReturn getsockoptFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int level, int optname, VPtr<> valPtr, VPtr<> lenPtr)
SyscallReturn fcntl64Func(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int cmd)
Target fcntl64() handler.
SyscallReturn ignoreWarnOnceFunc(SyscallDesc *desc, ThreadContext *tc)
Like above, but only prints a warning once per syscall desc it's used with.
SyscallReturn setsockoptFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int level, int optname, VPtr<> valPtr, socklen_t len)
SyscallReturn rmdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
SyscallReturn mkdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode)
Target mkdir() handler.
SyscallReturn getpgrpFunc(SyscallDesc *desc, ThreadContext *tc)
Target getpgrpFunc() handler.
SyscallReturn dupFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd)
FIXME: The file description is not shared among file descriptors created with dup.
SyscallReturn listenFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int backlog)
SyscallReturn ftruncate64Func(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int64_t length)
Target ftruncate64() handler.
SyscallReturn fchownFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint32_t owner, uint32_t group)
Target fchown() handler.
SyscallReturn fcntlFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int cmd, guest_abi::VarArgs< int > varargs)
Target fcntl() handler.
SyscallReturn bindFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, int addrlen)
SyscallReturn getegidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getegid() handler.
SyscallReturn shutdownFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int how)
Target shutdown() handler.
SyscallReturn getcpuFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< uint32_t > cpu, VPtr< uint32_t > node, VPtr< uint32_t > tcache)
SyscallReturn getsocknameFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> addrPtr, VPtr<> lenPtr)
SyscallReturn getpeernameFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> sockAddrPtr, VPtr<> addrlenPtr)
SyscallReturn lseekFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint64_t offs, int whence)
Target lseek() handler.
SyscallReturn accessFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode)
Target access() handler.
SyscallReturn sendmsgFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> msgPtr, int flags)
SyscallReturn ignoreFunc(SyscallDesc *desc, ThreadContext *tc)
Handler for unimplemented syscalls that we never intend to implement (signal handling,...
SyscallReturn connectFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, int addrlen)
SyscallReturn exitFunc(SyscallDesc *desc, ThreadContext *tc, int status)
Target exit() handler: terminate current context.
SyscallReturn dup2Func(SyscallDesc *desc, ThreadContext *tc, int old_tgt_fd, int new_tgt_fd)
Target dup2() handler.
SyscallReturn getgidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getgid() handler.
SyscallReturn closeFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd)
Target close() handler.
SyscallReturn umaskFunc(SyscallDesc *desc, ThreadContext *tc)
Target umask() handler.
This file defines objects used to emulate syscalls from the target application on the host machine.
const std::string & name()