44 #include "debug/SyscallVerbose.hh" 62 load(ProcessParams *params,
ObjectFile *obj_file)
override 64 auto arch = obj_file->
getArch();
71 warn(
"Unknown operating system; assuming Linux.");
85 RiscvLinuxObjectFileLoader loader;
97 strcpy(
name->sysname,
"Linux");
98 strcpy(
name->nodename,
"sim.gem5.org");
99 strcpy(
name->release, process->release.c_str());
100 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
101 strcpy(
name->machine,
"riscv64");
115 strcpy(
name->sysname,
"Linux");
116 strcpy(
name->nodename,
"sim.gem5.org");
117 strcpy(
name->release, process->release.c_str());
118 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
119 strcpy(
name->machine,
"riscv32");
125 std::map<int, SyscallDescABI<DefaultSyscallABI>>
128 {1, {
"io_destroy" }},
129 {2, {
"io_submit" }},
130 {3, {
"io_cancel" }},
131 {4, {
"io_getevents" }},
133 {6, {
"lsetxattr" }},
134 {7, {
"fsetxattr" }},
136 {9, {
"lgetxattr" }},
137 {10, {
"fgetxattr" }},
138 {11, {
"listxattr" }},
139 {12, {
"llistxattr" }},
140 {13, {
"flistxattr" }},
141 {14, {
"removexattr" }},
142 {15, {
"lremovexattr" }},
143 {16, {
"fremovexattr" }},
145 {18, {
"lookup_dcookie" }},
146 {19, {
"eventfd2" }},
147 {20, {
"epoll_create1" }},
148 {21, {
"epoll_ctl" }},
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" }},
162 {35, {
"unlinkat", unlinkatFunc<RiscvLinux64> }},
163 {36, {
"symlinkat" }},
165 {38, {
"renameat", renameatFunc<RiscvLinux64> }},
168 {41, {
"pivot_root" }},
169 {42, {
"nfsservctl" }},
170 {43, {
"statfs", statfsFunc<RiscvLinux64> }},
171 {44, {
"fstatfs", fstatfsFunc<RiscvLinux64> }},
175 {48, {
"faccessat", faccessatFunc<RiscvLinux64> }},
179 {52, {
"fchmod", fchmodFunc<RiscvLinux64> }},
180 {53, {
"fchmodat" }},
181 {54, {
"fchownat" }},
183 {56, {
"openat", openatFunc<RiscvLinux64> }},
187 {60, {
"quotactl" }},
188 {61, {
"getdents64" }},
190 {63, {
"read", readFunc<RiscvLinux64> }},
191 {64, {
"write", writeFunc<RiscvLinux64> }},
192 {66, {
"writev", writevFunc<RiscvLinux64> }},
194 {68, {
"pwrite64", pwrite64Func<RiscvLinux64> }},
197 {71, {
"sendfile" }},
198 {72, {
"pselect6" }},
200 {74, {
"signalfd64" }},
201 {75, {
"vmsplice" }},
204 {78, {
"readlinkat", readlinkatFunc<RiscvLinux64> }},
205 {79, {
"fstatat", fstatat64Func<RiscvLinux64> }},
206 {80, {
"fstat", fstat64Func<RiscvLinux64> }},
209 {83, {
"fdatasync" }},
210 {84, {
"sync_file_range2" }},
211 {85, {
"timerfd_create" }},
212 {86, {
"timerfd_settime" }},
213 {87, {
"timerfd_gettime" }},
214 {88, {
"utimensat" }},
218 {92, {
"personality" }},
224 {98, {
"futex", futexFunc<RiscvLinux64> }},
228 {102, {
"getitimer" }},
229 {103, {
"setitimer" }},
230 {104, {
"kexec_load" }},
231 {105, {
"init_module" }},
232 {106, {
"delete_module" }},
233 {107, {
"timer_create" }},
234 {108, {
"timer_gettime" }},
235 {109, {
"timer_getoverrun" }},
236 {110, {
"timer_settime" }},
237 {111, {
"timer_delete" }},
238 {112, {
"clock_settime" }},
239 {113, {
"clock_gettime", clock_gettimeFunc<RiscvLinux64> }},
240 {114, {
"clock_getres", clock_getresFunc<RiscvLinux64> }},
241 {115, {
"clock_nanosleep" }},
244 {118, {
"sched_setparam" }},
245 {119, {
"sched_setscheduler" }},
246 {120, {
"sched_getscheduler" }},
247 {121, {
"sched_getparam" }},
248 {122, {
"sched_setaffinity" }},
249 {123, {
"sched_getaffinity" }},
251 {125, {
"sched_get_priority_max" }},
252 {126, {
"sched_get_priority_min" }},
253 {127, {
"scheD_rr_get_interval" }},
254 {128, {
"restart_syscall" }},
257 {131, {
"tgkill", tgkillFunc<RiscvLinux64> }},
258 {132, {
"sigaltstack" }},
266 {140, {
"setpriority" }},
267 {141, {
"getpriority" }},
269 {143, {
"setregid" }},
271 {145, {
"setreuid" }},
273 {147, {
"setresuid" }},
274 {148, {
"getresuid" }},
275 {149, {
"getresgid" }},
276 {150, {
"getresgid" }},
277 {151, {
"setfsuid" }},
278 {152, {
"setfsgid" }},
279 {153, {
"times", timesFunc<RiscvLinux64> }},
281 {155, {
"getpgid" }},
284 {158, {
"getgroups" }},
285 {159, {
"setgroups" }},
287 {161, {
"sethostname" }},
288 {162, {
"setdomainname" }},
289 {163, {
"getrlimit", getrlimitFunc<RiscvLinux64> }},
291 {165, {
"getrusage", getrusageFunc<RiscvLinux64> }},
295 {169, {
"gettimeofday", gettimeofdayFunc<RiscvLinux64> }},
296 {170, {
"settimeofday" }},
297 {171, {
"adjtimex" }},
305 {179, {
"sysinfo", sysinfoFunc<RiscvLinux64> }},
306 {180, {
"mq_open" }},
307 {181, {
"mq_unlink" }},
308 {182, {
"mq_timedsend" }},
309 {183, {
"mq_timedrecieve" }},
310 {184, {
"mq_notify" }},
311 {185, {
"mq_getsetattr" }},
318 {192, {
"semtimedop" }},
325 {199, {
"socketpair" }},
329 {203, {
"connect" }},
330 {204, {
"getsockname" }},
331 {205, {
"getpeername" }},
333 {207, {
"recvfrom" }},
334 {208, {
"setsockopt" }},
335 {209, {
"getsockopt" }},
336 {210, {
"shutdown" }},
337 {211, {
"sendmsg" }},
338 {212, {
"recvmsg" }},
339 {213, {
"readahead" }},
342 {216, {
"mremap", mremapFunc<RiscvLinux64> }},
343 {217, {
"add_key" }},
344 {218, {
"request_key" }},
346 {220, {
"clone", cloneFunc<RiscvLinux64> }},
347 {221, {
"execve", execveFunc<RiscvLinux64> }},
348 {222, {
"mmap", mmapFunc<RiscvLinux64> }},
349 {223, {
"fadvise64" }},
351 {225, {
"swapoff" }},
360 {234, {
"remap_file_pages" }},
362 {236, {
"get_mempolicy" }},
363 {237, {
"set_mempolicy" }},
364 {238, {
"migrate_pages" }},
365 {239, {
"move_pages" }},
366 {240, {
"tgsigqueueinfo" }},
367 {241, {
"perf_event_open" }},
368 {242, {
"accept4" }},
369 {243, {
"recvmmsg" }},
371 {261, {
"prlimit64", prlimitFunc<RiscvLinux64> }},
372 {262, {
"fanotify_init" }},
373 {263, {
"fanotify_mark" }},
374 {264, {
"name_to_handle_at" }},
375 {265, {
"open_by_handle_at" }},
376 {266, {
"clock_adjtime" }},
379 {269, {
"sendmmsg" }},
380 {270, {
"process_vm_ready" }},
381 {271, {
"process_vm_writev" }},
383 {273, {
"finit_module" }},
384 {274, {
"sched_setattr" }},
385 {275, {
"sched_getattr" }},
386 {276, {
"renameat2" }},
387 {277, {
"seccomp" }},
388 {278, {
"getrandom" }},
389 {279, {
"memfd_create" }},
391 {281, {
"execveat" }},
392 {282, {
"userfaultid" }},
393 {283, {
"membarrier" }},
395 {285, {
"copy_file_range" }},
396 {286, {
"preadv2" }},
397 {287, {
"pwritev2" }},
398 {1024, {
"open", openFunc<RiscvLinux64> }},
402 {1028, {
"chmod", chmodFunc<RiscvLinux64> }},
406 {1032, {
"lchown" }},
410 {1036, {
"symlink" }},
411 {1037, {
"utimes", utimesFunc<RiscvLinux64> }},
412 {1038, {
"stat", stat64Func<RiscvLinux64> }},
413 {1039, {
"lstat", lstat64Func<RiscvLinux64> }},
416 {1042, {
"epoll_create" }},
417 {1043, {
"inotifiy_init" }},
418 {1044, {
"eventfd" }},
419 {1045, {
"signalfd" }},
420 {1046, {
"sendfile" }},
423 {1049, {
"stat", stat64Func<RiscvLinux64> }},
424 {1050, {
"lstat", lstat64Func<RiscvLinux64> }},
425 {1051, {
"fstat", fstat64Func<RiscvLinux64> }},
427 {1053, {
"fadvise64" }},
428 {1054, {
"newfstatat" }},
429 {1055, {
"fstatfs", fstatfsFunc<RiscvLinux64> }},
430 {1056, {
"statfs", statfsFunc<RiscvLinux64> }},
432 {1058, {
"mmap", mmapFunc<RiscvLinux64> }},
434 {1060, {
"getpgrp" }},
436 {1062, {
"time", timeFunc<RiscvLinux64> }},
439 {1065, {
"getdents" }},
440 {1066, {
"futimesat" }},
441 {1067, {
"select" }},
443 {1069, {
"epoll_wait" }},
446 {1072, {
"oldwait4" }},
449 {1075, {
"bdflush" }},
450 {1076, {
"umount" }},
451 {1077, {
"uselib" }},
452 {1078, {
"sysctl" }},
454 {2011, {
"getmainvars" }}
457 std::map<int, SyscallDescABI<DefaultSyscallABI>>
460 {1, {
"io_destroy" }},
461 {2, {
"io_submit" }},
462 {3, {
"io_cancel" }},
463 {4, {
"io_getevents" }},
465 {6, {
"lsetxattr" }},
466 {7, {
"fsetxattr" }},
468 {9, {
"lgetxattr" }},
469 {10, {
"fgetxattr" }},
470 {11, {
"listxattr" }},
471 {12, {
"llistxattr" }},
472 {13, {
"flistxattr" }},
473 {14, {
"removexattr" }},
474 {15, {
"lremovexattr" }},
475 {16, {
"fremovexattr" }},
477 {18, {
"lookup_dcookie" }},
478 {19, {
"eventfd2" }},
479 {20, {
"epoll_create1" }},
480 {21, {
"epoll_ctl" }},
481 {22, {
"epoll_pwait" }},
485 {26, {
"inotify_init1" }},
486 {27, {
"inotify_add_watch" }},
487 {28, {
"inotify_rm_watch" }},
488 {29, {
"ioctl", ioctlFunc<RiscvLinux32> }},
489 {30, {
"ioprio_get" }},
490 {31, {
"ioprio_set" }},
494 {35, {
"unlinkat", unlinkatFunc<RiscvLinux32> }},
495 {36, {
"symlinkat" }},
497 {38, {
"renameat", renameatFunc<RiscvLinux32> }},
500 {41, {
"pivot_root" }},
501 {42, {
"nfsservctl" }},
502 {43, {
"statfs", statfsFunc<RiscvLinux32> }},
503 {44, {
"fstatfs", fstatfsFunc<RiscvLinux32> }},
507 {48, {
"faccessat", faccessatFunc<RiscvLinux32> }},
511 {52, {
"fchmod", fchmodFunc<RiscvLinux32> }},
512 {53, {
"fchmodat" }},
513 {54, {
"fchownat" }},
515 {56, {
"openat", openatFunc<RiscvLinux32> }},
519 {60, {
"quotactl" }},
520 {61, {
"getdents64" }},
522 {63, {
"read", readFunc<RiscvLinux32> }},
523 {64, {
"write", writeFunc<RiscvLinux32> }},
524 {66, {
"writev", writevFunc<RiscvLinux32> }},
526 {68, {
"pwrite64", pwrite64Func<RiscvLinux32> }},
529 {71, {
"sendfile" }},
530 {72, {
"pselect6" }},
532 {74, {
"signalfd64" }},
533 {75, {
"vmsplice" }},
536 {78, {
"readlinkat", readlinkatFunc<RiscvLinux32> }},
538 {80, {
"fstat", fstatFunc<RiscvLinux32> }},
541 {83, {
"fdatasync" }},
542 {84, {
"sync_file_range2" }},
543 {85, {
"timerfd_create" }},
544 {86, {
"timerfd_settime" }},
545 {87, {
"timerfd_gettime" }},
546 {88, {
"utimensat" }},
550 {92, {
"personality" }},
556 {98, {
"futex", futexFunc<RiscvLinux32> }},
559 {101, {
"nanosleep" }},
560 {102, {
"getitimer" }},
561 {103, {
"setitimer" }},
562 {104, {
"kexec_load" }},
563 {105, {
"init_module" }},
564 {106, {
"delete_module" }},
565 {107, {
"timer_create" }},
566 {108, {
"timer_gettime" }},
567 {109, {
"timer_getoverrun" }},
568 {110, {
"timer_settime" }},
569 {111, {
"timer_delete" }},
570 {112, {
"clock_settime" }},
571 {113, {
"clock_gettime", clock_gettimeFunc<RiscvLinux32> }},
572 {114, {
"clock_getres", clock_getresFunc<RiscvLinux32> }},
573 {115, {
"clock_nanosleep" }},
576 {118, {
"sched_setparam" }},
577 {119, {
"sched_setscheduler" }},
578 {120, {
"sched_getscheduler" }},
579 {121, {
"sched_getparam" }},
580 {122, {
"sched_setaffinity" }},
581 {123, {
"sched_getaffinity" }},
583 {125, {
"sched_get_priority_max" }},
584 {126, {
"sched_get_priority_min" }},
585 {127, {
"scheD_rr_get_interval" }},
586 {128, {
"restart_syscall" }},
589 {131, {
"tgkill", tgkillFunc<RiscvLinux32> }},
590 {132, {
"sigaltstack" }},
598 {140, {
"setpriority" }},
599 {141, {
"getpriority" }},
601 {143, {
"setregid" }},
603 {145, {
"setreuid" }},
605 {147, {
"setresuid" }},
606 {148, {
"getresuid" }},
607 {149, {
"getresgid" }},
608 {150, {
"getresgid" }},
609 {151, {
"setfsuid" }},
610 {152, {
"setfsgid" }},
611 {153, {
"times", timesFunc<RiscvLinux32> }},
613 {155, {
"getpgid" }},
616 {158, {
"getgroups" }},
617 {159, {
"setgroups" }},
619 {161, {
"sethostname" }},
620 {162, {
"setdomainname" }},
621 {163, {
"getrlimit", getrlimitFunc<RiscvLinux32> }},
623 {165, {
"getrusage", getrusageFunc<RiscvLinux32> }},
627 {169, {
"gettimeofday", gettimeofdayFunc<RiscvLinux32> }},
628 {170, {
"settimeofday" }},
629 {171, {
"adjtimex" }},
637 {179, {
"sysinfo", sysinfoFunc<RiscvLinux32> }},
638 {180, {
"mq_open" }},
639 {181, {
"mq_unlink" }},
640 {182, {
"mq_timedsend" }},
641 {183, {
"mq_timedrecieve" }},
642 {184, {
"mq_notify" }},
643 {185, {
"mq_getsetattr" }},
650 {192, {
"semtimedop" }},
657 {199, {
"socketpair" }},
661 {203, {
"connect" }},
662 {204, {
"getsockname" }},
663 {205, {
"getpeername" }},
665 {207, {
"recvfrom" }},
666 {208, {
"setsockopt" }},
667 {209, {
"getsockopt" }},
668 {210, {
"shutdown" }},
669 {211, {
"sendmsg" }},
670 {212, {
"recvmsg" }},
671 {213, {
"readahead" }},
674 {216, {
"mremap", mremapFunc<RiscvLinux32> }},
675 {217, {
"add_key" }},
676 {218, {
"request_key" }},
678 {220, {
"clone", cloneFunc<RiscvLinux32> }},
679 {221, {
"execve", execveFunc<RiscvLinux32> }},
680 {222, {
"mmap", mmapFunc<RiscvLinux32> }},
681 {223, {
"fadvise64" }},
683 {225, {
"swapoff" }},
692 {234, {
"remap_file_pages" }},
694 {236, {
"get_mempolicy" }},
695 {237, {
"set_mempolicy" }},
696 {238, {
"migrate_pages" }},
697 {239, {
"move_pages" }},
698 {240, {
"tgsigqueueinfo" }},
699 {241, {
"perf_event_open" }},
700 {242, {
"accept4" }},
701 {243, {
"recvmmsg" }},
703 {261, {
"prlimit64", prlimitFunc<RiscvLinux32> }},
704 {262, {
"fanotify_init" }},
705 {263, {
"fanotify_mark" }},
706 {264, {
"name_to_handle_at" }},
707 {265, {
"open_by_handle_at" }},
708 {266, {
"clock_adjtime" }},
711 {269, {
"sendmmsg" }},
712 {270, {
"process_vm_ready" }},
713 {271, {
"process_vm_writev" }},
715 {273, {
"finit_module" }},
716 {274, {
"sched_setattr" }},
717 {275, {
"sched_getattr" }},
718 {276, {
"renameat2" }},
719 {277, {
"seccomp" }},
720 {278, {
"getrandom" }},
721 {279, {
"memfd_create" }},
723 {281, {
"execveat" }},
724 {282, {
"userfaultid" }},
725 {283, {
"membarrier" }},
727 {285, {
"copy_file_range" }},
728 {286, {
"preadv2" }},
729 {287, {
"pwritev2" }},
730 {1024, {
"open", openFunc<RiscvLinux32> }},
734 {1028, {
"chmod", chmodFunc<RiscvLinux32> }},
738 {1032, {
"lchown" }},
742 {1036, {
"symlink" }},
743 {1037, {
"utimes", utimesFunc<RiscvLinux32> }},
744 {1038, {
"stat", statFunc<RiscvLinux32> }},
745 {1039, {
"lstat", lstatFunc<RiscvLinux32> }},
748 {1042, {
"epoll_create" }},
749 {1043, {
"inotifiy_init" }},
750 {1044, {
"eventfd" }},
751 {1045, {
"signalfd" }},
752 {1046, {
"sendfile" }},
755 {1049, {
"stat", statFunc<RiscvLinux32> }},
756 {1050, {
"lstat", lstatFunc<RiscvLinux32> }},
757 {1051, {
"fstat", fstatFunc<RiscvLinux32> }},
759 {1053, {
"fadvise64" }},
760 {1054, {
"newfstatat" }},
761 {1055, {
"fstatfs", fstatfsFunc<RiscvLinux32> }},
762 {1056, {
"statfs", statfsFunc<RiscvLinux32> }},
764 {1058, {
"mmap", mmapFunc<RiscvLinux32> }},
766 {1060, {
"getpgrp" }},
768 {1062, {
"time", timeFunc<RiscvLinux32> }},
771 {1065, {
"getdents" }},
772 {1066, {
"futimesat" }},
773 {1067, {
"select" }},
775 {1069, {
"epoll_wait" }},
778 {1072, {
"oldwait4" }},
781 {1075, {
"bdflush" }},
782 {1076, {
"umount" }},
783 {1077, {
"uselib" }},
784 {1078, {
"sysctl" }},
786 {2011, {
"getmainvars" }}
const RegIndex SyscallNumReg
const std::string & name()
SyscallReturn geteuidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target geteuid() handler.
SyscallReturn ignoreFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Handler for unimplemented syscalls that we never intend to implement (signal handling, etc.) and should not affect the correct behavior of the program.
SyscallReturn dup2Func(SyscallDesc *desc, int num, ThreadContext *tc, int old_tgt_fd, int new_tgt_fd)
Target dup2() handler.
SyscallReturn getcwdFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr buf_ptr, unsigned long size)
Target getcwd() handler.
virtual RegVal readIntReg(RegIndex reg_idx) const =0
RiscvLinuxProcess32(ProcessParams *params, ObjectFile *objFile)
Constructor.
A process with emulated Riscv/Linux syscalls.
virtual PortProxy & getVirtProxy()=0
virtual Process * getProcessPtr()=0
SyscallReturn fcntlFunc(SyscallDesc *desc, int num, ThreadContext *tc)
Target fcntl() handler.
Overload hash function for BasicBlockRange type.
void doSyscall(int64_t callnum, ThreadContext *tc, Fault *fault)
TypedBufferArg is a class template; instances of this template represent typed buffers in target user...
static std::map< int, SyscallDescABI< DefaultSyscallABI > > syscallDescs
Array of syscall descriptors, indexed by call number.
SyscallReturn fallocateFunc(SyscallDesc *desc, int callnum, ThreadContext *tc, int tgt_fd, int mode, off_t offset, off_t len)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
SyscallReturn closeFunc(SyscallDesc *desc, int num, ThreadContext *tc, int tgt_fd)
Target close() handler.
SyscallDesc * getDesc(int callnum) override
SyscallReturn getegidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target getegid() handler.
SyscallReturn renameFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr oldpath, Addr newpath)
Target rename() handler.
SyscallReturn umaskFunc(SyscallDesc *desc, int num, ThreadContext *tc)
Target umask() handler.
SyscallReturn munmapFunc(SyscallDesc *desc, int num, ThreadContext *tc)
Target munmap() handler.
SyscallReturn getuidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
SyscallReturn unlinkFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr pathname)
Target unlink() handler.
RiscvLinuxProcess64(ProcessParams *params, ObjectFile *objFile)
Constructor.
SyscallReturn fchownFunc(SyscallDesc *desc, int num, ThreadContext *tc, int tgt_fd, uint32_t owner, uint32_t group)
Target fchown() handler.
SyscallReturn exitGroupFunc(SyscallDesc *desc, int callnum, ThreadContext *tc, int status)
Target exit_group() handler: terminate simulation. (exit all threads)
SyscallReturn mkdirFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr pathname, mode_t mode)
Target mkdir() handler.
static SyscallReturn unameFunc64(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target uname() handler.
SyscallReturn readlinkFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr pathname, Addr buf_ptr, size_t bufsiz)
Target readlink() handler.
SyscallDesc * getDesc(int callnum) override
SyscallReturn ftruncateFunc(SyscallDesc *desc, int num, ThreadContext *tc, int tgt_fd, off_t length)
Target ftruncate() handler.
SyscallReturn getppidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target getppid() handler.
static std::map< int, SyscallDescABI< DefaultSyscallABI > > syscallDescs
Array of syscall descriptors, indexed by call number.
SyscallReturn brkFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr new_brk)
Target brk() handler: set brk address.
SyscallReturn ignoreWarnOnceFunc(SyscallDesc *desc, int num, ThreadContext *tc)
Like above, but only prints a warning once per syscall desc it's used with.
SyscallReturn dupFunc(SyscallDesc *desc, int num, ThreadContext *tc, int tgt_fd)
FIXME: The file description is not shared among file descriptors created with dup.
SyscallReturn getgidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target getgid() handler.
static SyscallReturn unameFunc32(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target uname() handler.
This class provides the wrapper interface for the system call implementations which are defined in th...
SyscallReturn gettidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target gettid() handler.
SyscallReturn truncateFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr pathname, off_t length)
Target truncate() handler.
SyscallReturn fcntl64Func(SyscallDesc *desc, int num, ThreadContext *tc)
Target fcntl64() handler.
SyscallReturn lseekFunc(SyscallDesc *desc, int num, ThreadContext *tc, int tgt_fd, uint64_t offs, int whence)
Target lseek() handler.
SyscallReturn pipeFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target pipe() handler.
SyscallReturn accessFunc(SyscallDesc *desc, int callnum, ThreadContext *tc, Addr pathname, mode_t mode)
Target access() handler.
This file defines objects used to emulate syscalls from the target application on the host machine...
SyscallReturn setTidAddressFunc(SyscallDesc *desc, int callnum, ThreadContext *tc, uint64_t tidPtr)
Target set_tid_address() handler.
SyscallReturn setpgidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc, int pid, int pgid)
Target setpgid() handler.
SyscallReturn chownFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr pathname, uint32_t owner, uint32_t group)
Target chown() handler.
SyscallReturn truncate64Func(SyscallDesc *desc, int num, ThreadContext *tc, Addr pathname, int64_t length)
Target truncate64() handler.
void syscall(ThreadContext *tc, Fault *fault) override
This class represents the return value from an emulated system call, including any errno setting...
Each instance of a Loader subclass will have a chance to try to load an object file when tryLoaders i...
std::shared_ptr< FaultBase > Fault
SyscallReturn getpidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target getpid() handler.
SyscallReturn exitFunc(SyscallDesc *desc, int callnum, ThreadContext *tc, int status)
Target exit() handler: terminate current context.
SyscallReturn ftruncate64Func(SyscallDesc *desc, int num, ThreadContext *tc)
Target ftruncate64() handler.
void syscall(ThreadContext *tc, Fault *fault) override