43#include <sys/syscall.h>
58class LinuxLoader :
public Process::Loader
62 load(
const ProcessParams ¶ms, loader::ObjectFile *obj)
override
64 auto arch = obj->getArch();
65 auto opsys = obj->getOpSys();
73 warn(
"Unknown operating system; assuming Linux.");
78 fatal(
"gem5 does not support ARM OABI binaries. Please recompile "
79 "with an EABI compiler.");
86 return new ArmLinuxProcess64(params, obj, arch);
88 return new ArmLinuxProcess32(params, obj, arch);
92LinuxLoader linuxLoader;
105 strcpy(
name->sysname,
"Linux");
106 strcpy(
name->nodename,
"m5.eecs.umich.edu");
107 strcpy(
name->release, process->release.c_str());
108 strcpy(
name->version,
"#1 SMP Sat Dec 1 00:00:00 GMT 2012");
109 strcpy(
name->machine,
"armv7l");
120 strcpy(
name->sysname,
"Linux");
121 strcpy(
name->nodename,
"gem5");
122 strcpy(
name->release, process->release.c_str());
123 strcpy(
name->version,
"#1 SMP Sat Dec 1 00:00:00 GMT 2012");
124 strcpy(
name->machine,
"armv8l");
150 {
base + 0,
"syscall" },
152 {
base + 2,
"fork" },
157 {
base + 8,
"creat" },
158 {
base + 9,
"link" },
168 {
base + 21,
"mount" },
169 {
base + 22,
"umount" },
172 {
base + 25,
"stime" },
173 {
base + 26,
"ptrace" },
174 {
base + 27,
"alarm" },
175 {
base + 29,
"pause" },
176 {
base + 30,
"utime" },
178 {
base + 34,
"nice" },
179 {
base + 36,
"sync" },
183 {
base + 40,
"rmdir" },
188 {
base + 46,
"setgid" },
192 {
base + 51,
"acct" },
193 {
base + 52,
"umount2" },
196 {
base + 57,
"setpgid" },
198 {
base + 61,
"chroot" },
199 {
base + 62,
"ustat" },
200 {
base + 63,
"dup2" },
202 {
base + 65,
"getpgrp" },
203 {
base + 66,
"setsid" },
204 {
base + 67,
"sigaction" },
205 {
base + 70,
"setreuid" },
206 {
base + 71,
"setregid" },
207 {
base + 72,
"sigsuspend" },
208 {
base + 73,
"sigpending" },
214 {
base + 79,
"settimeofday" },
215 {
base + 80,
"getgroups" },
216 {
base + 81,
"setgroups" },
217 {
base + 82,
"reserved#82" },
218 {
base + 83,
"symlink" },
220 {
base + 86,
"uselib" },
221 {
base + 87,
"swapon" },
222 {
base + 88,
"reboot" },
223 {
base + 89,
"readdir" },
228 {
base + 94,
"fchmod" },
230 {
base + 96,
"getpriority" },
231 {
base + 97,
"setpriority" },
232 {
base + 99,
"statfs" },
233 {
base + 100,
"fstatfs" },
234 {
base + 102,
"socketcall" },
235 {
base + 103,
"syslog" },
236 {
base + 104,
"setitimer" },
237 {
base + 105,
"getitimer" },
239 {
base + 107,
"lstat" },
241 {
base + 111,
"vhangup" },
242 {
base + 113,
"syscall" },
243 {
base + 114,
"wait4" },
244 {
base + 115,
"swapoff" },
246 {
base + 117,
"ipc" },
247 {
base + 118,
"fsync" },
248 {
base + 119,
"sigreturn" },
250 {
base + 121,
"setdomainname" },
252 {
base + 124,
"adjtimex" },
255 {
base + 128,
"init_module" },
256 {
base + 129,
"delete_module" },
257 {
base + 131,
"quotactl" },
258 {
base + 132,
"getpgid" },
259 {
base + 133,
"fchdir" },
260 {
base + 134,
"bdflush" },
261 {
base + 135,
"sysfs" },
262 {
base + 136,
"personality" },
263 {
base + 137,
"reserved#138" },
264 {
base + 138,
"setfsuid" },
265 {
base + 139,
"setfsgid" },
267#if defined(SYS_getdents)
268 {
base + 141,
"getdents", getdentsFunc },
270 {
base + 141,
"getdents" },
272 {
base + 142,
"newselect" },
273 {
base + 143,
"flock" },
274 {
base + 144,
"msync" },
275 {
base + 145,
"readv" },
277 {
base + 147,
"getsid" },
278 {
base + 148,
"fdatasync" },
279 {
base + 149,
"sysctl" },
280 {
base + 150,
"mlock" },
281 {
base + 151,
"munlock" },
282 {
base + 152,
"mlockall" },
283 {
base + 153,
"munlockall" },
294 {
base + 164,
"setresuid" },
295 {
base + 165,
"getresuid" },
296 {
base + 168,
"poll" },
297 {
base + 169,
"nfsservctl" },
298 {
base + 170,
"setresgid" },
299 {
base + 171,
"getresgid" },
300 {
base + 172,
"prctl" },
301 {
base + 173,
"rt_sigreturn" },
304 {
base + 176,
"rt_sigpending" },
305 {
base + 177,
"rt_sigtimedwait" },
307 {
base + 179,
"rt_sigsuspend" },
308 {
base + 180,
"pread64" },
309 {
base + 181,
"pwrite64" },
310 {
base + 182,
"chown" },
312 {
base + 184,
"capget" },
313 {
base + 185,
"capset" },
314 {
base + 186,
"sigaltstack" },
315 {
base + 187,
"sendfile" },
316 {
base + 190,
"vfork" },
319 {
base + 193,
"truncate64" },
324 {
base + 198,
"lchown" },
329 {
base + 203,
"setreuid" },
330 {
base + 204,
"setregid" },
331 {
base + 205,
"getgroups" },
332 {
base + 206,
"setgroups" },
334 {
base + 208,
"setresuid" },
335 {
base + 209,
"getresuid" },
336 {
base + 210,
"setresgid" },
337 {
base + 211,
"getresgid" },
338 {
base + 212,
"chown" },
339 {
base + 213,
"setuid" },
340 {
base + 214,
"setgid" },
341 {
base + 215,
"setfsuid" },
342 {
base + 216,
"setfsgid" },
343#if defined(SYS_getdents64)
344 {
base + 217,
"getdents64", getdents64Func },
346 {
base + 217,
"getdents64" },
348 {
base + 218,
"pivot_root" },
349 {
base + 219,
"mincore" },
353 {
base + 225,
"readahead" },
354 {
base + 226,
"setxattr" },
355 {
base + 227,
"lsetxattr" },
356 {
base + 228,
"fsetxattr" },
357 {
base + 229,
"getxattr" },
358 {
base + 230,
"lgetxattr" },
359 {
base + 231,
"fgetxattr" },
360 {
base + 232,
"listxattr" },
361 {
base + 233,
"llistxattr" },
362 {
base + 234,
"flistxattr" },
363 {
base + 235,
"removexattr" },
364 {
base + 236,
"lremovexattr" },
365 {
base + 237,
"fremovexattr" },
366 {
base + 238,
"tkill" },
367 {
base + 239,
"sendfile64" },
371 {
base + 243,
"io_setup" },
372 {
base + 244,
"io_destroy" },
373 {
base + 245,
"io_getevents" },
374 {
base + 246,
"io_submit" },
375 {
base + 247,
"io_cancel" },
377 {
base + 249,
"lookup_dcookie" },
378 {
base + 250,
"epoll_create" },
379 {
base + 251,
"epoll_ctl" },
380 {
base + 252,
"epoll_wait" },
381 {
base + 253,
"remap_file_pages" },
383 {
base + 257,
"timer_create" },
384 {
base + 258,
"timer_settime" },
385 {
base + 259,
"timer_gettime" },
386 {
base + 260,
"timer_getoverrun" },
387 {
base + 261,
"timer_delete" },
388 {
base + 262,
"clock_settime" },
391 {
base + 265,
"clock_nanosleep" },
392 {
base + 266,
"statfs64" },
393 {
base + 267,
"fstatfs64" },
396 {
base + 270,
"arm_fadvise64_64" },
397 {
base + 271,
"pciconfig_iobase" },
398 {
base + 272,
"pciconfig_read" },
399 {
base + 273,
"pciconfig_write" },
400 {
base + 274,
"mq_open" },
401 {
base + 275,
"mq_unlink" },
402 {
base + 276,
"mq_timedsend" },
403 {
base + 277,
"mq_timedreceive" },
404 {
base + 278,
"mq_notify" },
405 {
base + 279,
"mq_getsetattr" },
406 {
base + 280,
"waitid" },
407 {
base + 281,
"socket" },
408 {
base + 282,
"bind" },
409 {
base + 283,
"connect" },
410 {
base + 284,
"listen" },
411 {
base + 285,
"accept" },
412 {
base + 286,
"getsockname" },
413 {
base + 287,
"getpeername" },
414 {
base + 288,
"socketpair" },
415 {
base + 289,
"send" },
417 {
base + 291,
"recv" },
419 {
base + 293,
"shutdown" },
420 {
base + 294,
"setsockopt" },
421 {
base + 295,
"getsockopt" },
422 {
base + 296,
"sendmsg" },
423 {
base + 297,
"rcvmsg" },
424 {
base + 298,
"semop" },
425 {
base + 299,
"semget" },
426 {
base + 300,
"semctl" },
427 {
base + 301,
"msgsend" },
428 {
base + 302,
"msgrcv" },
429 {
base + 303,
"msgget" },
430 {
base + 304,
"msgctl" },
431 {
base + 305,
"shmat" },
432 {
base + 306,
"shmdt" },
433 {
base + 307,
"shmget" },
434 {
base + 308,
"shmctl" },
435 {
base + 309,
"add_key" },
436 {
base + 310,
"request_key" },
437 {
base + 311,
"keyctl" },
438 {
base + 312,
"semtimedop" },
439 {
base + 314,
"ioprio_set" },
440 {
base + 315,
"ioprio_get" },
441 {
base + 316,
"inotify_init" },
442 {
base + 317,
"inotify_add_watch" },
443 {
base + 318,
"inotify_rm_watch" },
444 {
base + 319,
"mbind" },
445 {
base + 320,
"get_mempolicy" },
446 {
base + 321,
"set_mempolicy" },
452 {
base + 327,
"fstatat64" },
455 {
base + 330,
"linkat" },
456 {
base + 331,
"symlinkat" },
460 {
base + 335,
"pselect6" },
461 {
base + 336,
"ppoll" },
462 {
base + 337,
"unshare" },
464 {
base + 339,
"get_robust_list" },
465 {
base + 340,
"splice" },
466 {
base + 341,
"arm_sync_file_range" },
467 {
base + 342,
"tee" },
468 {
base + 343,
"vmsplice" },
469 {
base + 344,
"move_pages" },
471 {
base + 346,
"epoll_pwait" },
472 {
base + 347,
"sys_kexec_load" },
473 {
base + 348,
"sys_utimensat" },
474 {
base + 349,
"sys_signalfd" },
475 {
base + 350,
"sys_timerfd_create" },
476 {
base + 351,
"sys_eventfd" },
477 {
base + 352,
"sys_fallocate" },
478 {
base + 353,
"sys_timerfd_settime" },
479 {
base + 354,
"sys_timerfd_gettime" },
480 {
base + 355,
"sys_signalfd4" },
481 {
base + 356,
"sys_eventfd2" },
482 {
base + 357,
"sys_epoll_create1" },
483 {
base + 358,
"sys_dup3" },
484 {
base + 359,
"sys_pipe2" },
485 {
base + 360,
"sys_inotify_init1" },
486 {
base + 361,
"sys_preadv" },
487 {
base + 362,
"sys_pwritev" },
488 {
base + 363,
"sys_rt_tgsigqueueinfo" },
489 {
base + 364,
"sys_perf_event_open" },
490 {
base + 365,
"sys_recvmmsg" },
502 {
base + 0,
"io_setup" },
503 {
base + 1,
"io_destroy" },
504 {
base + 2,
"io_submit" },
505 {
base + 3,
"io_cancel" },
506 {
base + 4,
"io_getevents" },
507 {
base + 5,
"setxattr" },
508 {
base + 6,
"lsetxattr" },
509 {
base + 7,
"fsetxattr" },
510 {
base + 8,
"getxattr" },
511 {
base + 9,
"lgetxattr" },
512 {
base + 10,
"fgetxattr" },
513 {
base + 11,
"listxattr" },
514 {
base + 12,
"llistxattr" },
515 {
base + 13,
"flistxattr" },
516 {
base + 14,
"removexattr" },
517 {
base + 15,
"lremovexattr" },
518 {
base + 16,
"fremovexattr" },
520 {
base + 18,
"lookup_dcookie" },
521 {
base + 19,
"eventfd2" },
522 {
base + 20,
"epoll_create1" },
523 {
base + 21,
"epoll_ctl" },
524 {
base + 22,
"epoll_pwait" },
526 {
base + 24,
"dup3" },
528 {
base + 26,
"inotify_init1" },
529 {
base + 27,
"inotify_add_watch" },
530 {
base + 28,
"inotify_rm_watch" },
532 {
base + 30,
"ioprio_set" },
533 {
base + 31,
"ioprio_get" },
534 {
base + 32,
"flock" },
538 {
base + 36,
"symlinkat" },
539 {
base + 37,
"linkat" },
541 {
base + 39,
"umount2" },
542 {
base + 40,
"mount" },
543 {
base + 41,
"pivot_root" },
544 {
base + 42,
"nfsservctl" },
545 {
base + 43,
"statfs64" },
546 {
base + 44,
"fstatfs64" },
547 {
base + 45,
"truncate64" },
552 {
base + 50,
"fchdir" },
553 {
base + 51,
"chroot" },
554 {
base + 52,
"fchmod" },
560 {
base + 58,
"vhangup" },
561 {
base + 59,
"pipe2" },
562 {
base + 60,
"quotactl" },
563#if defined(SYS_getdents64)
564 {
base + 61,
"getdents64", getdents64Func },
566 {
base + 61,
"getdents64" },
571 {
base + 65,
"readv" },
573 {
base + 67,
"pread64" },
574 {
base + 68,
"pwrite64" },
575 {
base + 69,
"preadv" },
576 {
base + 70,
"pwritev" },
577 {
base + 71,
"sendfile64" },
578 {
base + 72,
"pselect6" },
579 {
base + 73,
"ppoll" },
580 {
base + 74,
"signalfd4" },
581 {
base + 75,
"vmsplice" },
582 {
base + 76,
"splice" },
583 {
base + 77,
"tee" },
587 {
base + 81,
"sync" },
588 {
base + 82,
"fsync" },
589 {
base + 83,
"fdatasync" },
590 {
base + 84,
"sync_file_range" },
591 {
base + 85,
"timerfd_create" },
592 {
base + 86,
"timerfd_settime" },
593 {
base + 87,
"timerfd_gettime" },
594 {
base + 88,
"utimensat" },
595 {
base + 89,
"acct" },
596 {
base + 90,
"capget" },
597 {
base + 91,
"capset" },
598 {
base + 92,
"personality" },
601 {
base + 95,
"waitid" },
603 {
base + 97,
"unshare" },
606 {
base + 100,
"get_robust_list" },
608 {
base + 102,
"getitimer" },
609 {
base + 103,
"setitimer" },
610 {
base + 104,
"kexec_load" },
611 {
base + 105,
"init_module" },
612 {
base + 106,
"delete_module" },
613 {
base + 107,
"timer_create" },
614 {
base + 108,
"timer_gettime" },
615 {
base + 109,
"timer_getoverrun" },
616 {
base + 110,
"timer_settime" },
617 {
base + 111,
"timer_delete" },
618 {
base + 112,
"clock_settime" },
620 {
base + 114,
"clock_getres" },
621 {
base + 115,
"clock_nanosleep" },
622 {
base + 116,
"syslog" },
623 {
base + 117,
"ptrace" },
634 {
base + 128,
"restart_syscall" },
636 {
base + 130,
"tkill" },
638 {
base + 132,
"sigaltstack" },
639 {
base + 133,
"rt_sigsuspend" },
642 {
base + 136,
"rt_sigpending" },
643 {
base + 137,
"rt_sigtimedwait" },
645 {
base + 139,
"rt_sigreturn" },
646 {
base + 140,
"setpriority" },
647 {
base + 141,
"getpriority" },
648 {
base + 142,
"reboot" },
649 {
base + 143,
"setregid" },
650 {
base + 144,
"setgid" },
651 {
base + 145,
"setreuid" },
652 {
base + 146,
"setuid" },
653 {
base + 147,
"setresuid" },
654 {
base + 148,
"getresuid" },
655 {
base + 149,
"setresgid" },
656 {
base + 150,
"getresgid" },
657 {
base + 151,
"setfsuid" },
658 {
base + 152,
"setfsgid" },
660 {
base + 154,
"setpgid" },
661 {
base + 155,
"getpgid" },
662 {
base + 156,
"getsid" },
663 {
base + 157,
"setsid" },
664 {
base + 158,
"getgroups" },
665 {
base + 159,
"setgroups" },
668 {
base + 162,
"setdomainname" },
672 {
base + 166,
"umask" },
673 {
base + 167,
"prctl" },
676 {
base + 170,
"settimeofday" },
677 {
base + 171,
"adjtimex" },
686 {
base + 180,
"mq_open" },
687 {
base + 181,
"mq_unlink" },
688 {
base + 182,
"mq_timedsend" },
689 {
base + 183,
"mq_timedreceive" },
690 {
base + 184,
"mq_notify" },
691 {
base + 185,
"mq_getsetattr" },
692 {
base + 186,
"msgget" },
693 {
base + 187,
"msgctl" },
694 {
base + 188,
"msgrcv" },
695 {
base + 189,
"msgsnd" },
696 {
base + 190,
"semget" },
697 {
base + 191,
"semctl" },
698 {
base + 192,
"semtimedop" },
699 {
base + 193,
"semop" },
700 {
base + 194,
"shmget" },
701 {
base + 195,
"shmctl" },
702 {
base + 196,
"shmat" },
703 {
base + 197,
"shmdt" },
704 {
base + 198,
"socket" },
705 {
base + 199,
"socketpair" },
706 {
base + 200,
"bind" },
707 {
base + 201,
"listen" },
708 {
base + 202,
"accept" },
709 {
base + 203,
"connect" },
710 {
base + 204,
"getsockname" },
711 {
base + 205,
"getpeername" },
714 {
base + 208,
"setsockopt" },
715 {
base + 209,
"getsockopt" },
716 {
base + 210,
"shutdown" },
717 {
base + 211,
"sendmsg" },
718 {
base + 212,
"recvmsg" },
719 {
base + 213,
"readahead" },
723 {
base + 217,
"add_key" },
724 {
base + 218,
"request_key" },
725 {
base + 219,
"keyctl" },
729 {
base + 223,
"fadvise64_64" },
730 {
base + 224,
"swapon" },
731 {
base + 225,
"swapoff" },
733 {
base + 227,
"msync" },
734 {
base + 228,
"mlock" },
735 {
base + 229,
"munlock" },
736 {
base + 230,
"mlockall" },
737 {
base + 231,
"munlockall" },
738 {
base + 232,
"mincore" },
740 {
base + 234,
"remap_file_pages" },
741 {
base + 235,
"mbind" },
742 {
base + 236,
"get_mempolicy" },
743 {
base + 237,
"set_mempolicy" },
744 {
base + 238,
"migrate_pages" },
745 {
base + 239,
"move_pages" },
746 {
base + 240,
"rt_tgsigqueueinfo" },
747 {
base + 241,
"perf_event_open" },
748 {
base + 242,
"accept4" },
749 {
base + 243,
"recvmmsg" },
750 {
base + 260,
"wait4" },
752 {
base + 262,
"fanotify_init" },
753 {
base + 263,
"fanotify_mark" },
754 {
base + 264,
"name_to_handle_at" },
755 {
base + 265,
"open_by_handle_at" },
756 {
base + 266,
"clock_adjtime" },
757 {
base + 267,
"syncfs" },
758 {
base + 268,
"setns" },
759 {
base + 269,
"sendmmsg" },
760 {
base + 270,
"process_vm_readv" },
761 {
base + 271,
"process_vm_writev" },
762 {
base + 272,
"kcmp" },
763 {
base + 273,
"finit_module" },
764 {
base + 274,
"sched_setattr"},
765 {
base + 275,
"sched_getattr"},
766 {
base + 276,
"renameat2"},
767 {
base + 277,
"seccomp"},
769 {
base + 279,
"memfd_create" },
770 {
base + 280,
"bpf" },
771 {
base + 281,
"execveat"},
772 {
base + 282,
"userfaultfd"},
773 {
base + 283,
"membarrier"},
774 {
base + 284,
"mlock2"},
775 {
base + 285,
"copy_file_range"},
776 {
base + 286,
"preadv2"},
777 {
base + 287,
"pwritev2"},
778 {
base + 288,
"pkey_mprotect"},
779 {
base + 289,
"pkey_alloc"},
780 {
base + 290,
"pkey_free"},
781 {
base + 291,
"statx"},
782 {
base + 292,
"io_pgetevents"},
784 {
base + 294,
"kexec_file_load"},
786 {
base + 1025,
"link" },
790 {
base + 1029,
"chown" },
792 {
base + 1031,
"rmdir" },
793 {
base + 1032,
"lchown" },
797 {
base + 1036,
"symlink" },
802 {
base + 1041,
"dup2" },
803 {
base + 1042,
"epoll_create" },
804 {
base + 1043,
"inotify_init" },
805 {
base + 1044,
"eventfd" },
806 {
base + 1045,
"signalfd" },
807 {
base + 1046,
"sendfile" },
811 {
base + 1050,
"lstat" },
814 {
base + 1053,
"fadvise64" },
815 {
base + 1054,
"newfstatat" },
816 {
base + 1055,
"fstatfs" },
817 {
base + 1056,
"statfs" },
820 {
base + 1059,
"alarm" },
821 {
base + 1060,
"getpgrp" },
822 {
base + 1061,
"pause" },
824 {
base + 1063,
"utime" },
825 {
base + 1064,
"creat" },
826#if defined(SYS_getdents)
827 {
base + 1065,
"getdents", getdentsFunc },
829 {
base + 1065,
"getdents" },
832 {
base + 1067,
"select" },
833 {
base + 1068,
"poll" },
834 {
base + 1069,
"epoll_wait" },
835 {
base + 1070,
"ustat" },
836 {
base + 1071,
"vfork" },
837 {
base + 1072,
"oldwait4" },
838 {
base + 1073,
"recv" },
839 {
base + 1074,
"send" },
840 {
base + 1075,
"bdflush" },
841 {
base + 1076,
"umount" },
842 {
base + 1077,
"uselib" },
843 {
base + 1078,
"_sysctl" },
844 {
base + 1079,
"fork" }
852 { 0xf0001,
"breakpoint" },
853 { 0xf0002,
"cacheflush" },
854 { 0xf0003,
"usr26" },
855 { 0xf0004,
"usr32" },
861 { 0x1002,
"cacheflush" },
871 process->Process::syscall(tc);
void syscall(ThreadContext *tc) override
static const Addr commPage
A page to hold "kernel" provided functions. The name might be wrong.
A process with emulated Arm/Linux syscalls.
void writeBlob(Addr addr, const void *p, uint64_t size) const
Same as tryWriteBlob, but insists on success.
SyscallDesc * get(int num, bool fatal_if_missing=true)
This class provides the wrapper interface for the system call implementations which are defined in th...
void doSyscall(ThreadContext *tc)
Interface for invoking the system call funcion pointer.
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 void setMiscReg(RegIndex misc_reg, RegVal val)=0
virtual RegVal getReg(const RegId ®) const
virtual Process * getProcessPtr()=0
#define fatal(...)
This implements a cprintf based fatal() function.
static SyscallReturn unameFunc32(SyscallDesc *desc, ThreadContext *tc, VPtr< Linux::utsname > name)
Target uname() handler.
static SyscallReturn setTLSFunc64(SyscallDesc *desc, ThreadContext *tc, uint32_t tlsPtr)
static SyscallDescTable< EmuLinux::SyscallABI64 > privSyscallDescs64
static SyscallTable32 syscallDescs32High(0x900000)
static SyscallTable64 syscallDescs64Low(0)
static SyscallReturn setTLSFunc32(SyscallDesc *desc, ThreadContext *tc, uint32_t tlsPtr)
Target set_tls() handler.
static SyscallTable64 syscallDescs64High(0x900000)
static SyscallTable32 syscallDescs32Low(0)
static SyscallReturn unameFunc64(SyscallDesc *desc, ThreadContext *tc, VPtr< Linux::utsname > name)
Target uname() handler.
static SyscallDescTable< EmuLinux::SyscallABI32 > privSyscallDescs32
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
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 getrandomFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> buf_ptr, typename OS::size_t count, unsigned int flags)
SyscallReturn fstat64Func(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr< typename OS::tgt_stat64 > tgt_stat)
Target fstat64() handler.
SyscallReturn clock_gettimeFunc(SyscallDesc *desc, ThreadContext *tc, int clk_id, VPtr< typename OS::timespec > tp)
Target clock_gettime() function.
SyscallReturn brkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> new_brk)
Target brk() handler: set brk address.
SyscallReturn mmapFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> start, typename OS::size_t length, int prot, int tgt_flags, int tgt_fd, typename OS::off_t offset)
Target mmap() handler.
SyscallReturn getpidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getpid() handler.
SyscallReturn chdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
Target chdir() handler.
SyscallReturn fstatFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr< typename OS::tgt_stat > tgt_stat)
Target fstat() handler.
SyscallReturn getuidFunc(SyscallDesc *desc, ThreadContext *tc)
SyscallReturn getrusageFunc(SyscallDesc *desc, ThreadContext *tc, int who, VPtr< typename OS::rusage > rup)
Target getrusage() function.
SyscallReturn readFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, int nbytes)
SyscallReturn pipePseudoFunc(SyscallDesc *desc, ThreadContext *tc)
Pseudo Funcs - These functions use a different return convension, returning a second value in a regis...
SyscallReturn recvfromFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, typename OS::size_t buf_len, int flags, VPtr<> addr_ptr, VPtr<> addrlen_ptr)
SyscallReturn utimesFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr< typename OS::timeval[2]> tp)
Target utimes() handler.
SyscallReturn chownFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, uint32_t owner, uint32_t group)
Target chown() handler.
SyscallReturn statFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr< typename OS::tgt_stat > tgt_stat)
Target stat() handler.
SyscallReturn chmodFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode)
Target chmod() 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 _llseekFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint64_t offset_high, uint32_t offset_low, VPtr<> result_ptr, int whence)
Target _llseek() handler.
SyscallReturn setTidAddressFunc(SyscallDesc *desc, ThreadContext *tc, uint64_t tidPtr)
Target set_tid_address() handler.
SyscallReturn truncateFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, typename OS::off_t length)
Target truncate() 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 unlinkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
Target unlink() handler.
SyscallReturn sysinfoFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< typename OS::tgt_sysinfo > sysinfo)
Target sysinfo() handler.
SyscallReturn fchownatFunc(SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, uint32_t owner, uint32_t group, int flags)
Target fchownat() handler.
SyscallReturn gettimeofdayFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< typename OS::timeval > tp, VPtr<> tz_ptr)
Target gettimeofday() handler.
SyscallReturn unlinkatFunc(SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, int flags)
Target unlinkat() handler.
SyscallReturn prlimitFunc(SyscallDesc *desc, ThreadContext *tc, int pid, int resource, VPtr<> n, VPtr< typename OS::rlimit > rlp)
SyscallReturn clock_getresFunc(SyscallDesc *desc, ThreadContext *tc, int clk_id, VPtr< typename OS::timespec > tp)
Target clock_getres() function.
SyscallReturn faccessatFunc(SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, int mode)
Target facessat() handler.
SyscallReturn getrlimitFunc(SyscallDesc *desc, ThreadContext *tc, unsigned resource, VPtr< typename OS::rlimit > rlp)
Target getrlimit() handler.
SyscallReturn mknodatFunc(SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, mode_t mode, dev_t dev)
Target mknodat() handler.
SyscallReturn fallocateFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int mode, typename OS::off_t offset, typename OS::off_t len)
SyscallReturn fcntl64Func(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int cmd)
Target fcntl64() handler.
SyscallReturn futimesatFunc(SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, VPtr< typename OS::timeval[2]> tp)
Target futimesat() handler.
SyscallReturn ignoreWarnOnceFunc(SyscallDesc *desc, ThreadContext *tc)
Like above, but only prints a warning once per syscall desc it's used with.
SyscallReturn ftruncateFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, typename OS::off_t length)
Target ftruncate() handler.
SyscallReturn mkdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode)
Target mkdir() handler.
SyscallReturn readlinkatFunc(SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, VPtr<> buf_ptr, typename OS::size_t bufsiz)
Target readlinkat() handler.
SyscallReturn dupFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd)
FIXME: The file description is not shared among file descriptors created with dup.
SyscallReturn ftruncate64Func(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int64_t length)
Target ftruncate64() handler.
SyscallReturn fchmodatFunc(SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, mode_t mode)
Target chmod() handler.
SyscallReturn openatFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_dirfd, VPtr<> pathname, int tgt_flags, int mode)
Target open() handler.
SyscallReturn fchownFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint32_t owner, uint32_t group)
Target fchown() handler.
SyscallReturn munmapFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> start, typename OS::size_t length)
Target munmap() handler.
SyscallReturn readlinkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr<> buf_ptr, typename OS::size_t bufsiz)
Target readlink() handler.
SyscallReturn timesFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< typename OS::tms > bufp)
Target times() function.
SyscallReturn fcntlFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int cmd, guest_abi::VarArgs< int > varargs)
Target fcntl() handler.
SyscallReturn openFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, int tgt_flags, int mode)
Target open() handler.
SyscallReturn getegidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getegid() handler.
SyscallReturn timeFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> taddr)
Target time() function.
SyscallReturn renameatFunc(SyscallDesc *desc, ThreadContext *tc, int olddirfd, VPtr<> oldpath, int newdirfd, VPtr<> newpath)
Target renameat() handler.
SyscallReturn getcpuFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< uint32_t > cpu, VPtr< uint32_t > node, VPtr< uint32_t > tcache)
SyscallReturn ioctlFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, unsigned req, VPtr<> addr)
Target ioctl() handler.
SyscallReturn writevFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint64_t tiov_base, typename OS::size_t count)
Target writev() handler.
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 tgkillFunc(SyscallDesc *desc, ThreadContext *tc, int tgid, int tid, int sig)
SyscallReturn cloneBackwardsFunc(SyscallDesc *desc, ThreadContext *tc, RegVal flags, RegVal newStack, VPtr<> ptidPtr, VPtr<> tlsPtr, VPtr<> ctidPtr)
SyscallReturn mremapFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> start, uint64_t old_length, uint64_t new_length, uint64_t flags, guest_abi::VarArgs< uint64_t > varargs)
Target mremap() handler.
SyscallReturn lstat64Func(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr< typename OS::tgt_stat64 > tgt_stat)
Target lstat64() handler.
SyscallReturn fstatat64Func(SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, VPtr< typename OS::tgt_stat64 > tgt_stat)
Target fstatat64() handler.
SyscallReturn ignoreFunc(SyscallDesc *desc, ThreadContext *tc)
Handler for unimplemented syscalls that we never intend to implement (signal handling,...
SyscallReturn futexFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> uaddr, int op, int val, int timeout, VPtr<> uaddr2, int val3)
Futex system call Implemented by Daniel Sanchez Used by printf's in multi-threaded apps.
SyscallReturn stat64Func(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr< typename OS::tgt_stat64 > tgt_stat)
Target stat64() handler.
SyscallReturn execveFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr<> argv_mem_loc, VPtr<> envp_mem_loc)
SyscallReturn exitFunc(SyscallDesc *desc, ThreadContext *tc, int status)
Target exit() handler: terminate current context.
SyscallReturn getgidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getgid() handler.
SyscallReturn writeFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, int nbytes)
SyscallReturn closeFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd)
Target close() handler.
SyscallReturn umaskFunc(SyscallDesc *desc, ThreadContext *tc)
Target umask() handler.
SyscallReturn sendtoFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, typename OS::size_t buf_len, int flags, VPtr<> addr_ptr, socklen_t addr_len)
SyscallReturn mkdiratFunc(SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, mode_t mode)
Target mkdirat() handler.
This file defines objects used to emulate syscalls from the target application on the host machine.
const std::string & name()