40 #include "debug/SyscallVerbose.hh"
60 auto arch = obj_file->
getArch();
67 warn(
"Unknown operating system; assuming Linux.");
81 RiscvLinuxObjectFileLoader loader;
91 strcpy(
name->sysname,
"Linux");
92 strcpy(
name->nodename,
"sim.gem5.org");
93 strcpy(
name->release, process->release.c_str());
94 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
95 strcpy(
name->machine,
"riscv64");
106 strcpy(
name->sysname,
"Linux");
107 strcpy(
name->nodename,
"sim.gem5.org");
108 strcpy(
name->release, process->release.c_str());
109 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
110 strcpy(
name->machine,
"riscv32");
121 { 4,
"io_getevents" },
129 { 12,
"llistxattr" },
130 { 13,
"flistxattr" },
131 { 14,
"removexattr" },
132 { 15,
"lremovexattr" },
133 { 16,
"fremovexattr" },
135 { 18,
"lookup_dcookie" },
137 { 20,
"epoll_create1" },
139 { 22,
"epoll_pwait" },
143 { 26,
"inotify_init1" },
144 { 27,
"inotify_add_watch" },
145 { 28,
"inotify_rm_watch" },
146 { 29,
"ioctl", ioctlFunc<RiscvLinux64> },
147 { 30,
"ioprio_get" },
148 { 31,
"ioprio_set" },
152 { 35,
"unlinkat", unlinkatFunc<RiscvLinux64> },
155 { 38,
"renameat", renameatFunc<RiscvLinux64> },
158 { 41,
"pivot_root" },
159 { 42,
"nfsservctl" },
160 { 43,
"statfs", statfsFunc<RiscvLinux64> },
161 { 44,
"fstatfs", fstatfsFunc<RiscvLinux64> },
165 { 48,
"faccessat", faccessatFunc<RiscvLinux64> },
169 { 52,
"fchmod", fchmodFunc<RiscvLinux64> },
173 { 56,
"openat", openatFunc<RiscvLinux64> },
178 { 61,
"getdents64" },
180 { 63,
"read", readFunc<RiscvLinux64> },
181 { 64,
"write", writeFunc<RiscvLinux64> },
182 { 66,
"writev", writevFunc<RiscvLinux64> },
184 { 68,
"pwrite64", pwrite64Func<RiscvLinux64> },
190 { 74,
"signalfd64" },
194 { 78,
"readlinkat", readlinkatFunc<RiscvLinux64> },
195 { 79,
"fstatat", fstatat64Func<RiscvLinux64> },
196 { 80,
"fstat", fstat64Func<RiscvLinux64> },
200 { 84,
"sync_file_range2" },
201 { 85,
"timerfd_create" },
202 { 86,
"timerfd_settime" },
203 { 87,
"timerfd_gettime" },
208 { 92,
"personality" },
214 { 98,
"futex", futexFunc<RiscvLinux64> },
218 { 102,
"getitimer" },
219 { 103,
"setitimer" },
220 { 104,
"kexec_load" },
221 { 105,
"init_module" },
222 { 106,
"delete_module" },
223 { 107,
"timer_create" },
224 { 108,
"timer_gettime" },
225 { 109,
"timer_getoverrun" },
226 { 110,
"timer_settime" },
227 { 111,
"timer_delete" },
228 { 112,
"clock_settime" },
229 { 113,
"clock_gettime", clock_gettimeFunc<RiscvLinux64> },
230 { 114,
"clock_getres", clock_getresFunc<RiscvLinux64> },
231 { 115,
"clock_nanosleep" },
234 { 118,
"sched_setparam" },
235 { 119,
"sched_setscheduler" },
236 { 120,
"sched_getscheduler" },
237 { 121,
"sched_getparam" },
238 { 122,
"sched_setaffinity" },
239 { 123,
"sched_getaffinity" },
241 { 125,
"sched_get_priority_max" },
242 { 126,
"sched_get_priority_min" },
243 { 127,
"scheD_rr_get_interval" },
244 { 128,
"restart_syscall" },
247 { 131,
"tgkill", tgkillFunc<RiscvLinux64> },
248 { 132,
"sigaltstack" },
256 { 140,
"setpriority" },
257 { 141,
"getpriority" },
263 { 147,
"setresuid" },
264 { 148,
"getresuid" },
265 { 149,
"getresgid" },
266 { 150,
"getresgid" },
269 { 153,
"times", timesFunc<RiscvLinux64> },
274 { 158,
"getgroups" },
275 { 159,
"setgroups" },
277 { 161,
"sethostname" },
278 { 162,
"setdomainname" },
279 { 163,
"getrlimit", getrlimitFunc<RiscvLinux64> },
281 { 165,
"getrusage", getrusageFunc<RiscvLinux64> },
285 { 169,
"gettimeofday", gettimeofdayFunc<RiscvLinux64> },
286 { 170,
"settimeofday" },
295 { 179,
"sysinfo", sysinfoFunc<RiscvLinux64> },
297 { 181,
"mq_unlink" },
298 { 182,
"mq_timedsend" },
299 { 183,
"mq_timedrecieve" },
300 { 184,
"mq_notify" },
301 { 185,
"mq_getsetattr" },
308 { 192,
"semtimedop" },
315 { 199,
"socketpair" },
320 { 204,
"getsockname" },
321 { 205,
"getpeername" },
324 { 208,
"setsockopt" },
325 { 209,
"getsockopt" },
329 { 213,
"readahead" },
332 { 216,
"mremap", mremapFunc<RiscvLinux64> },
334 { 218,
"request_key" },
336 { 220,
"clone", cloneBackwardsFunc<RiscvLinux64> },
337 { 221,
"execve", execveFunc<RiscvLinux64> },
338 { 222,
"mmap", mmapFunc<RiscvLinux64> },
339 { 223,
"fadvise64" },
350 { 234,
"remap_file_pages" },
352 { 236,
"get_mempolicy" },
353 { 237,
"set_mempolicy" },
354 { 238,
"migrate_pages" },
355 { 239,
"move_pages" },
356 { 240,
"tgsigqueueinfo" },
357 { 241,
"perf_event_open" },
361 { 261,
"prlimit64", prlimitFunc<RiscvLinux64> },
362 { 262,
"fanotify_init" },
363 { 263,
"fanotify_mark" },
364 { 264,
"name_to_handle_at" },
365 { 265,
"open_by_handle_at" },
366 { 266,
"clock_adjtime" },
370 { 270,
"process_vm_ready" },
371 { 271,
"process_vm_writev" },
373 { 273,
"finit_module" },
374 { 274,
"sched_setattr" },
375 { 275,
"sched_getattr" },
376 { 276,
"renameat2" },
378 { 278,
"getrandom" },
379 { 279,
"memfd_create" },
382 { 282,
"userfaultid" },
383 { 283,
"membarrier" },
385 { 285,
"copy_file_range" },
388 { 1024,
"open", openFunc<RiscvLinux64> },
392 { 1028,
"chmod", chmodFunc<RiscvLinux64> },
401 { 1037,
"utimes", utimesFunc<RiscvLinux64> },
402 { 1038,
"stat", stat64Func<RiscvLinux64> },
403 { 1039,
"lstat", lstat64Func<RiscvLinux64> },
406 { 1042,
"epoll_create" },
407 { 1043,
"inotifiy_init" },
409 { 1045,
"signalfd" },
410 { 1046,
"sendfile" },
413 { 1049,
"stat", stat64Func<RiscvLinux64> },
414 { 1050,
"lstat", lstat64Func<RiscvLinux64> },
415 { 1051,
"fstat", fstat64Func<RiscvLinux64> },
417 { 1053,
"fadvise64" },
418 { 1054,
"newfstatat" },
419 { 1055,
"fstatfs", fstatfsFunc<RiscvLinux64> },
420 { 1056,
"statfs", statfsFunc<RiscvLinux64> },
422 { 1058,
"mmap", mmapFunc<RiscvLinux64> },
426 { 1062,
"time", timeFunc<RiscvLinux64> },
429 { 1065,
"getdents" },
430 { 1066,
"futimesat" },
433 { 1069,
"epoll_wait" },
436 { 1072,
"oldwait4" },
444 { 2011,
"getmainvars" }
453 { 4,
"io_getevents" },
461 { 12,
"llistxattr" },
462 { 13,
"flistxattr" },
463 { 14,
"removexattr" },
464 { 15,
"lremovexattr" },
465 { 16,
"fremovexattr" },
467 { 18,
"lookup_dcookie" },
469 { 20,
"epoll_create1" },
471 { 22,
"epoll_pwait" },
475 { 26,
"inotify_init1" },
476 { 27,
"inotify_add_watch" },
477 { 28,
"inotify_rm_watch" },
478 { 29,
"ioctl", ioctlFunc<RiscvLinux32> },
479 { 30,
"ioprio_get" },
480 { 31,
"ioprio_set" },
484 { 35,
"unlinkat", unlinkatFunc<RiscvLinux32> },
487 { 38,
"renameat", renameatFunc<RiscvLinux32> },
490 { 41,
"pivot_root" },
491 { 42,
"nfsservctl" },
492 { 43,
"statfs", statfsFunc<RiscvLinux32> },
493 { 44,
"fstatfs", fstatfsFunc<RiscvLinux32> },
497 { 48,
"faccessat", faccessatFunc<RiscvLinux32> },
501 { 52,
"fchmod", fchmodFunc<RiscvLinux32> },
505 { 56,
"openat", openatFunc<RiscvLinux32> },
510 { 61,
"getdents64" },
512 { 63,
"read", readFunc<RiscvLinux32> },
513 { 64,
"write", writeFunc<RiscvLinux32> },
514 { 66,
"writev", writevFunc<RiscvLinux32> },
516 { 68,
"pwrite64", pwrite64Func<RiscvLinux32> },
522 { 74,
"signalfd64" },
526 { 78,
"readlinkat", readlinkatFunc<RiscvLinux32> },
528 { 80,
"fstat", fstatFunc<RiscvLinux32> },
532 { 84,
"sync_file_range2" },
533 { 85,
"timerfd_create" },
534 { 86,
"timerfd_settime" },
535 { 87,
"timerfd_gettime" },
540 { 92,
"personality" },
546 { 98,
"futex", futexFunc<RiscvLinux32> },
549 { 101,
"nanosleep" },
550 { 102,
"getitimer" },
551 { 103,
"setitimer" },
552 { 104,
"kexec_load" },
553 { 105,
"init_module" },
554 { 106,
"delete_module" },
555 { 107,
"timer_create" },
556 { 108,
"timer_gettime" },
557 { 109,
"timer_getoverrun" },
558 { 110,
"timer_settime" },
559 { 111,
"timer_delete" },
560 { 112,
"clock_settime" },
561 { 113,
"clock_gettime", clock_gettimeFunc<RiscvLinux32> },
562 { 114,
"clock_getres", clock_getresFunc<RiscvLinux32> },
563 { 115,
"clock_nanosleep" },
566 { 118,
"sched_setparam" },
567 { 119,
"sched_setscheduler" },
568 { 120,
"sched_getscheduler" },
569 { 121,
"sched_getparam" },
570 { 122,
"sched_setaffinity" },
571 { 123,
"sched_getaffinity" },
573 { 125,
"sched_get_priority_max" },
574 { 126,
"sched_get_priority_min" },
575 { 127,
"scheD_rr_get_interval" },
576 { 128,
"restart_syscall" },
579 { 131,
"tgkill", tgkillFunc<RiscvLinux32> },
580 { 132,
"sigaltstack" },
588 { 140,
"setpriority" },
589 { 141,
"getpriority" },
595 { 147,
"setresuid" },
596 { 148,
"getresuid" },
597 { 149,
"getresgid" },
598 { 150,
"getresgid" },
601 { 153,
"times", timesFunc<RiscvLinux32> },
606 { 158,
"getgroups" },
607 { 159,
"setgroups" },
609 { 161,
"sethostname" },
610 { 162,
"setdomainname" },
611 { 163,
"getrlimit", getrlimitFunc<RiscvLinux32> },
613 { 165,
"getrusage", getrusageFunc<RiscvLinux32> },
617 { 169,
"gettimeofday", gettimeofdayFunc<RiscvLinux32> },
618 { 170,
"settimeofday" },
627 { 179,
"sysinfo", sysinfoFunc<RiscvLinux32> },
629 { 181,
"mq_unlink" },
630 { 182,
"mq_timedsend" },
631 { 183,
"mq_timedrecieve" },
632 { 184,
"mq_notify" },
633 { 185,
"mq_getsetattr" },
640 { 192,
"semtimedop" },
647 { 199,
"socketpair" },
652 { 204,
"getsockname" },
653 { 205,
"getpeername" },
656 { 208,
"setsockopt" },
657 { 209,
"getsockopt" },
661 { 213,
"readahead" },
664 { 216,
"mremap", mremapFunc<RiscvLinux32> },
666 { 218,
"request_key" },
668 { 220,
"clone", cloneBackwardsFunc<RiscvLinux32> },
669 { 221,
"execve", execveFunc<RiscvLinux32> },
670 { 222,
"mmap", mmapFunc<RiscvLinux32> },
671 { 223,
"fadvise64" },
682 { 234,
"remap_file_pages" },
684 { 236,
"get_mempolicy" },
685 { 237,
"set_mempolicy" },
686 { 238,
"migrate_pages" },
687 { 239,
"move_pages" },
688 { 240,
"tgsigqueueinfo" },
689 { 241,
"perf_event_open" },
693 { 261,
"prlimit64", prlimitFunc<RiscvLinux32> },
694 { 262,
"fanotify_init" },
695 { 263,
"fanotify_mark" },
696 { 264,
"name_to_handle_at" },
697 { 265,
"open_by_handle_at" },
698 { 266,
"clock_adjtime" },
702 { 270,
"process_vm_ready" },
703 { 271,
"process_vm_writev" },
705 { 273,
"finit_module" },
706 { 274,
"sched_setattr" },
707 { 275,
"sched_getattr" },
708 { 276,
"renameat2" },
710 { 278,
"getrandom" },
711 { 279,
"memfd_create" },
714 { 282,
"userfaultid" },
715 { 283,
"membarrier" },
717 { 285,
"copy_file_range" },
720 { 1024,
"open", openFunc<RiscvLinux32> },
724 { 1028,
"chmod", chmodFunc<RiscvLinux32> },
733 { 1037,
"utimes", utimesFunc<RiscvLinux32> },
734 { 1038,
"stat", statFunc<RiscvLinux32> },
735 { 1039,
"lstat", lstatFunc<RiscvLinux32> },
738 { 1042,
"epoll_create" },
739 { 1043,
"inotifiy_init" },
741 { 1045,
"signalfd" },
742 { 1046,
"sendfile" },
745 { 1049,
"stat", statFunc<RiscvLinux32> },
746 { 1050,
"lstat", lstatFunc<RiscvLinux32> },
747 { 1051,
"fstat", fstatFunc<RiscvLinux32> },
749 { 1053,
"fadvise64" },
750 { 1054,
"newfstatat" },
751 { 1055,
"fstatfs", fstatfsFunc<RiscvLinux32> },
752 { 1056,
"statfs", statfsFunc<RiscvLinux32> },
754 { 1058,
"mmap", mmapFunc<RiscvLinux32> },
758 { 1062,
"time", timeFunc<RiscvLinux32> },
761 { 1065,
"getdents" },
762 { 1066,
"futimesat" },
765 { 1069,
"epoll_wait" },
768 { 1072,
"oldwait4" },
776 { 2011,
"getmainvars" }