33 #include <sys/syscall.h>
57 warn(
"Unknown operating system; assuming Linux.");
84 process->Process::syscall(tc);
99 strcpy(
name->sysname,
"Linux");
100 strcpy(
name->nodename,
"sim.gem5.org");
101 strcpy(
name->release, process->release.c_str());
102 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
103 strcpy(
name->machine,
"riscv64");
114 strcpy(
name->sysname,
"Linux");
115 strcpy(
name->nodename,
"sim.gem5.org");
116 strcpy(
name->release, process->release.c_str());
117 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
118 strcpy(
name->machine,
"riscv32");
128 { 4,
"io_getevents" },
136 { 12,
"llistxattr" },
137 { 13,
"flistxattr" },
138 { 14,
"removexattr" },
139 { 15,
"lremovexattr" },
140 { 16,
"fremovexattr" },
142 { 18,
"lookup_dcookie" },
144 { 20,
"epoll_create1" },
146 { 22,
"epoll_pwait" },
150 { 26,
"inotify_init1" },
151 { 27,
"inotify_add_watch" },
152 { 28,
"inotify_rm_watch" },
153 { 29,
"ioctl", ioctlFunc<RiscvLinux64> },
154 { 30,
"ioprio_get" },
155 { 31,
"ioprio_set" },
159 { 35,
"unlinkat", unlinkatFunc<RiscvLinux64> },
162 { 38,
"renameat", renameatFunc<RiscvLinux64> },
165 { 41,
"pivot_root" },
166 { 42,
"nfsservctl" },
167 { 43,
"statfs", statfsFunc<RiscvLinux64> },
168 { 44,
"fstatfs", fstatfsFunc<RiscvLinux64> },
172 { 48,
"faccessat", faccessatFunc<RiscvLinux64> },
176 { 52,
"fchmod", fchmodFunc<RiscvLinux64> },
180 { 56,
"openat", openatFunc<RiscvLinux64> },
185 { 61,
"getdents64" },
187 { 63,
"read", readFunc<RiscvLinux64> },
188 { 64,
"write", writeFunc<RiscvLinux64> },
189 { 66,
"writev", writevFunc<RiscvLinux64> },
191 { 68,
"pwrite64", pwrite64Func<RiscvLinux64> },
197 { 74,
"signalfd64" },
201 { 78,
"readlinkat", readlinkatFunc<RiscvLinux64> },
202 { 79,
"fstatat", fstatat64Func<RiscvLinux64> },
203 { 80,
"fstat", fstat64Func<RiscvLinux64> },
207 { 84,
"sync_file_range2" },
208 { 85,
"timerfd_create" },
209 { 86,
"timerfd_settime" },
210 { 87,
"timerfd_gettime" },
215 { 92,
"personality" },
221 { 98,
"futex", futexFunc<RiscvLinux64> },
225 { 102,
"getitimer" },
226 { 103,
"setitimer" },
227 { 104,
"kexec_load" },
228 { 105,
"init_module" },
229 { 106,
"delete_module" },
230 { 107,
"timer_create" },
231 { 108,
"timer_gettime" },
232 { 109,
"timer_getoverrun" },
233 { 110,
"timer_settime" },
234 { 111,
"timer_delete" },
235 { 112,
"clock_settime" },
236 { 113,
"clock_gettime", clock_gettimeFunc<RiscvLinux64> },
237 { 114,
"clock_getres", clock_getresFunc<RiscvLinux64> },
238 { 115,
"clock_nanosleep" },
241 { 118,
"sched_setparam" },
242 { 119,
"sched_setscheduler" },
243 { 120,
"sched_getscheduler" },
244 { 121,
"sched_getparam" },
245 { 122,
"sched_setaffinity" },
246 { 123,
"sched_getaffinity" },
248 { 125,
"sched_get_priority_max" },
249 { 126,
"sched_get_priority_min" },
250 { 127,
"scheD_rr_get_interval" },
251 { 128,
"restart_syscall" },
254 { 131,
"tgkill", tgkillFunc<RiscvLinux64> },
255 { 132,
"sigaltstack" },
263 { 140,
"setpriority" },
264 { 141,
"getpriority" },
270 { 147,
"setresuid" },
271 { 148,
"getresuid" },
272 { 149,
"getresgid" },
273 { 150,
"getresgid" },
276 { 153,
"times", timesFunc<RiscvLinux64> },
281 { 158,
"getgroups" },
282 { 159,
"setgroups" },
284 { 161,
"sethostname" },
285 { 162,
"setdomainname" },
286 { 163,
"getrlimit", getrlimitFunc<RiscvLinux64> },
288 { 165,
"getrusage", getrusageFunc<RiscvLinux64> },
292 { 169,
"gettimeofday", gettimeofdayFunc<RiscvLinux64> },
293 { 170,
"settimeofday" },
302 { 179,
"sysinfo", sysinfoFunc<RiscvLinux64> },
304 { 181,
"mq_unlink" },
305 { 182,
"mq_timedsend" },
306 { 183,
"mq_timedrecieve" },
307 { 184,
"mq_notify" },
308 { 185,
"mq_getsetattr" },
315 { 192,
"semtimedop" },
322 { 199,
"socketpair" },
327 { 204,
"getsockname" },
328 { 205,
"getpeername" },
331 { 208,
"setsockopt" },
332 { 209,
"getsockopt" },
336 { 213,
"readahead" },
339 { 216,
"mremap", mremapFunc<RiscvLinux64> },
341 { 218,
"request_key" },
343 { 220,
"clone", cloneBackwardsFunc<RiscvLinux64> },
344 { 221,
"execve", execveFunc<RiscvLinux64> },
345 { 222,
"mmap", mmapFunc<RiscvLinux64> },
346 { 223,
"fadvise64" },
357 { 234,
"remap_file_pages" },
359 { 236,
"get_mempolicy" },
360 { 237,
"set_mempolicy" },
361 { 238,
"migrate_pages" },
362 { 239,
"move_pages" },
363 { 240,
"tgsigqueueinfo" },
364 { 241,
"perf_event_open" },
368 { 261,
"prlimit64", prlimitFunc<RiscvLinux64> },
369 { 262,
"fanotify_init" },
370 { 263,
"fanotify_mark" },
371 { 264,
"name_to_handle_at" },
372 { 265,
"open_by_handle_at" },
373 { 266,
"clock_adjtime" },
377 { 270,
"process_vm_ready" },
378 { 271,
"process_vm_writev" },
380 { 273,
"finit_module" },
381 { 274,
"sched_setattr" },
382 { 275,
"sched_getattr" },
383 { 276,
"renameat2" },
385 { 278,
"getrandom" },
386 { 279,
"memfd_create" },
389 { 282,
"userfaultid" },
390 { 283,
"membarrier" },
392 { 285,
"copy_file_range" },
395 { 1024,
"open", openFunc<RiscvLinux64> },
399 { 1028,
"chmod", chmodFunc<RiscvLinux64> },
408 { 1037,
"utimes", utimesFunc<RiscvLinux64> },
409 { 1038,
"stat", stat64Func<RiscvLinux64> },
410 { 1039,
"lstat", lstat64Func<RiscvLinux64> },
413 { 1042,
"epoll_create" },
414 { 1043,
"inotifiy_init" },
416 { 1045,
"signalfd" },
417 { 1046,
"sendfile" },
420 { 1049,
"stat", stat64Func<RiscvLinux64> },
421 { 1050,
"lstat", lstat64Func<RiscvLinux64> },
422 { 1051,
"fstat", fstat64Func<RiscvLinux64> },
424 { 1053,
"fadvise64" },
425 { 1054,
"newfstatat" },
426 { 1055,
"fstatfs", fstatfsFunc<RiscvLinux64> },
427 { 1056,
"statfs", statfsFunc<RiscvLinux64> },
429 { 1058,
"mmap", mmapFunc<RiscvLinux64> },
433 { 1062,
"time", timeFunc<RiscvLinux64> },
436 { 1065,
"getdents" },
437 { 1066,
"futimesat" },
440 { 1069,
"epoll_wait" },
443 { 1072,
"oldwait4" },
451 { 2011,
"getmainvars" }
459 { 4,
"io_getevents" },
467 { 12,
"llistxattr" },
468 { 13,
"flistxattr" },
469 { 14,
"removexattr" },
470 { 15,
"lremovexattr" },
471 { 16,
"fremovexattr" },
473 { 18,
"lookup_dcookie" },
475 { 20,
"epoll_create1" },
477 { 22,
"epoll_pwait" },
481 { 26,
"inotify_init1" },
482 { 27,
"inotify_add_watch" },
483 { 28,
"inotify_rm_watch" },
484 { 29,
"ioctl", ioctlFunc<RiscvLinux32> },
485 { 30,
"ioprio_get" },
486 { 31,
"ioprio_set" },
490 { 35,
"unlinkat", unlinkatFunc<RiscvLinux32> },
493 { 38,
"renameat", renameatFunc<RiscvLinux32> },
496 { 41,
"pivot_root" },
497 { 42,
"nfsservctl" },
498 { 43,
"statfs", statfsFunc<RiscvLinux32> },
499 { 44,
"fstatfs", fstatfsFunc<RiscvLinux32> },
503 { 48,
"faccessat", faccessatFunc<RiscvLinux32> },
507 { 52,
"fchmod", fchmodFunc<RiscvLinux32> },
511 { 56,
"openat", openatFunc<RiscvLinux32> },
516 { 61,
"getdents64" },
518 { 63,
"read", readFunc<RiscvLinux32> },
519 { 64,
"write", writeFunc<RiscvLinux32> },
520 { 66,
"writev", writevFunc<RiscvLinux32> },
522 { 68,
"pwrite64", pwrite64Func<RiscvLinux32> },
528 { 74,
"signalfd64" },
532 { 78,
"readlinkat", readlinkatFunc<RiscvLinux32> },
534 { 80,
"fstat", fstatFunc<RiscvLinux32> },
538 { 84,
"sync_file_range2" },
539 { 85,
"timerfd_create" },
540 { 86,
"timerfd_settime" },
541 { 87,
"timerfd_gettime" },
546 { 92,
"personality" },
552 { 98,
"futex", futexFunc<RiscvLinux32> },
555 { 101,
"nanosleep" },
556 { 102,
"getitimer" },
557 { 103,
"setitimer" },
558 { 104,
"kexec_load" },
559 { 105,
"init_module" },
560 { 106,
"delete_module" },
561 { 107,
"timer_create" },
562 { 108,
"timer_gettime" },
563 { 109,
"timer_getoverrun" },
564 { 110,
"timer_settime" },
565 { 111,
"timer_delete" },
566 { 112,
"clock_settime" },
567 { 113,
"clock_gettime", clock_gettimeFunc<RiscvLinux32> },
568 { 114,
"clock_getres", clock_getresFunc<RiscvLinux32> },
569 { 115,
"clock_nanosleep" },
572 { 118,
"sched_setparam" },
573 { 119,
"sched_setscheduler" },
574 { 120,
"sched_getscheduler" },
575 { 121,
"sched_getparam" },
576 { 122,
"sched_setaffinity" },
577 { 123,
"sched_getaffinity" },
579 { 125,
"sched_get_priority_max" },
580 { 126,
"sched_get_priority_min" },
581 { 127,
"scheD_rr_get_interval" },
582 { 128,
"restart_syscall" },
585 { 131,
"tgkill", tgkillFunc<RiscvLinux32> },
586 { 132,
"sigaltstack" },
594 { 140,
"setpriority" },
595 { 141,
"getpriority" },
601 { 147,
"setresuid" },
602 { 148,
"getresuid" },
603 { 149,
"getresgid" },
604 { 150,
"getresgid" },
607 { 153,
"times", timesFunc<RiscvLinux32> },
612 { 158,
"getgroups" },
613 { 159,
"setgroups" },
615 { 161,
"sethostname" },
616 { 162,
"setdomainname" },
617 { 163,
"getrlimit", getrlimitFunc<RiscvLinux32> },
619 { 165,
"getrusage", getrusageFunc<RiscvLinux32> },
623 { 169,
"gettimeofday", gettimeofdayFunc<RiscvLinux32> },
624 { 170,
"settimeofday" },
633 { 179,
"sysinfo", sysinfoFunc<RiscvLinux32> },
635 { 181,
"mq_unlink" },
636 { 182,
"mq_timedsend" },
637 { 183,
"mq_timedrecieve" },
638 { 184,
"mq_notify" },
639 { 185,
"mq_getsetattr" },
646 { 192,
"semtimedop" },
653 { 199,
"socketpair" },
658 { 204,
"getsockname" },
659 { 205,
"getpeername" },
662 { 208,
"setsockopt" },
663 { 209,
"getsockopt" },
667 { 213,
"readahead" },
670 { 216,
"mremap", mremapFunc<RiscvLinux32> },
672 { 218,
"request_key" },
674 { 220,
"clone", cloneBackwardsFunc<RiscvLinux32> },
675 { 221,
"execve", execveFunc<RiscvLinux32> },
676 { 222,
"mmap", mmapFunc<RiscvLinux32> },
677 { 223,
"fadvise64" },
688 { 234,
"remap_file_pages" },
690 { 236,
"get_mempolicy" },
691 { 237,
"set_mempolicy" },
692 { 238,
"migrate_pages" },
693 { 239,
"move_pages" },
694 { 240,
"tgsigqueueinfo" },
695 { 241,
"perf_event_open" },
699 { 261,
"prlimit64", prlimitFunc<RiscvLinux32> },
700 { 262,
"fanotify_init" },
701 { 263,
"fanotify_mark" },
702 { 264,
"name_to_handle_at" },
703 { 265,
"open_by_handle_at" },
704 { 266,
"clock_adjtime" },
708 { 270,
"process_vm_ready" },
709 { 271,
"process_vm_writev" },
711 { 273,
"finit_module" },
712 { 274,
"sched_setattr" },
713 { 275,
"sched_getattr" },
714 { 276,
"renameat2" },
716 { 278,
"getrandom" },
717 { 279,
"memfd_create" },
720 { 282,
"userfaultid" },
721 { 283,
"membarrier" },
723 { 285,
"copy_file_range" },
726 { 1024,
"open", openFunc<RiscvLinux32> },
730 { 1028,
"chmod", chmodFunc<RiscvLinux32> },
739 { 1037,
"utimes", utimesFunc<RiscvLinux32> },
740 { 1038,
"stat", statFunc<RiscvLinux32> },
741 { 1039,
"lstat", lstatFunc<RiscvLinux32> },
744 { 1042,
"epoll_create" },
745 { 1043,
"inotifiy_init" },
747 { 1045,
"signalfd" },
748 { 1046,
"sendfile" },
751 { 1049,
"stat", statFunc<RiscvLinux32> },
752 { 1050,
"lstat", lstatFunc<RiscvLinux32> },
753 { 1051,
"fstat", fstatFunc<RiscvLinux32> },
755 { 1053,
"fadvise64" },
756 { 1054,
"newfstatat" },
757 { 1055,
"fstatfs", fstatfsFunc<RiscvLinux32> },
758 { 1056,
"statfs", statfsFunc<RiscvLinux32> },
760 { 1058,
"mmap", mmapFunc<RiscvLinux32> },
764 { 1062,
"time", timeFunc<RiscvLinux32> },
767 { 1065,
"getdents" },
768 { 1066,
"futimesat" },
771 { 1069,
"epoll_wait" },
774 { 1072,
"oldwait4" },
782 { 2011,
"getmainvars" }