33#include <sys/syscall.h>
47class 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);
74LinuxLoader 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" },
157 { 30,
"ioprio_get" },
158 { 31,
"ioprio_set" },
168 { 41,
"pivot_root" },
169 { 42,
"nfsservctl" },
188#if defined(SYS_getdents64)
189 { 61,
"getdents64", getdents64Func },
191 { 61,
"getdents64" },
204 { 74,
"signalfd64" },
214 { 84,
"sync_file_range2" },
215 { 85,
"timerfd_create" },
216 { 86,
"timerfd_settime" },
217 { 87,
"timerfd_gettime" },
222 { 92,
"personality" },
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" },
245 { 115,
"clock_nanosleep" },
248 { 118,
"sched_setparam" },
249 { 119,
"sched_setscheduler" },
250 { 120,
"sched_getscheduler" },
251 { 121,
"sched_getparam" },
252 { 122,
"sched_setaffinity" },
255 { 125,
"sched_get_priority_max" },
256 { 126,
"sched_get_priority_min" },
257 { 127,
"scheD_rr_get_interval" },
258 { 128,
"restart_syscall" },
262 { 132,
"sigaltstack" },
270 { 140,
"setpriority" },
271 { 141,
"getpriority" },
277 { 147,
"setresuid" },
278 { 148,
"getresuid" },
279 { 149,
"getresgid" },
280 { 150,
"getresgid" },
288 { 158,
"getgroups" },
289 { 159,
"setgroups" },
291 { 161,
"sethostname" },
292 { 162,
"setdomainname" },
300 { 170,
"settimeofday" },
311 { 181,
"mq_unlink" },
312 { 182,
"mq_timedsend" },
313 { 183,
"mq_timedrecieve" },
314 { 184,
"mq_notify" },
315 { 185,
"mq_getsetattr" },
322 { 192,
"semtimedop" },
343 { 213,
"readahead" },
348 { 218,
"request_key" },
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" },
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" },
393 { 279,
"memfd_create" },
396 { 282,
"userfaultid" },
397 { 283,
"membarrier" },
399 { 285,
"copy_file_range" },
420 { 1042,
"epoll_create" },
421 { 1043,
"inotifiy_init" },
423 { 1045,
"signalfd" },
424 { 1046,
"sendfile" },
431 { 1053,
"fadvise64" },
443#if defined(SYS_getdents)
444 { 1065,
"getdents", getdentsFunc },
446 { 1065,
"getdents" },
448 { 1066,
"futimesat" },
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" },
496 { 30,
"ioprio_get" },
497 { 31,
"ioprio_set" },
507 { 41,
"pivot_root" },
508 { 42,
"nfsservctl" },
527#if defined(SYS_getdents64)
528 { 61,
"getdents64", getdents64Func },
530 { 61,
"getdents64" },
543 { 74,
"signalfd64" },
553 { 84,
"sync_file_range2" },
554 { 85,
"timerfd_create" },
555 { 86,
"timerfd_settime" },
556 { 87,
"timerfd_gettime" },
561 { 92,
"personality" },
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" },
584 { 115,
"clock_nanosleep" },
587 { 118,
"sched_setparam" },
588 { 119,
"sched_setscheduler" },
589 { 120,
"sched_getscheduler" },
590 { 121,
"sched_getparam" },
591 { 122,
"sched_setaffinity" },
594 { 125,
"sched_get_priority_max" },
595 { 126,
"sched_get_priority_min" },
596 { 127,
"scheD_rr_get_interval" },
597 { 128,
"restart_syscall" },
601 { 132,
"sigaltstack" },
609 { 140,
"setpriority" },
610 { 141,
"getpriority" },
616 { 147,
"setresuid" },
617 { 148,
"getresuid" },
618 { 149,
"getresgid" },
619 { 150,
"getresgid" },
627 { 158,
"getgroups" },
628 { 159,
"setgroups" },
630 { 161,
"sethostname" },
631 { 162,
"setdomainname" },
639 { 170,
"settimeofday" },
650 { 181,
"mq_unlink" },
651 { 182,
"mq_timedsend" },
652 { 183,
"mq_timedrecieve" },
653 { 184,
"mq_notify" },
654 { 185,
"mq_getsetattr" },
661 { 192,
"semtimedop" },
682 { 213,
"readahead" },
687 { 218,
"request_key" },
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" },
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" },
732 { 279,
"memfd_create" },
735 { 282,
"userfaultid" },
736 { 283,
"membarrier" },
738 { 285,
"copy_file_range" },
759 { 1042,
"epoll_create" },
760 { 1043,
"inotifiy_init" },
762 { 1045,
"signalfd" },
763 { 1046,
"sendfile" },
770 { 1053,
"fadvise64" },
782#if defined(SYS_getdents)
783 { 1065,
"getdents", getdentsFunc },
785 { 1065,
"getdents" },
787 { 1066,
"futimesat" },
790 { 1069,
"epoll_wait" },
793 { 1072,
"oldwait4" },
801 { 2011,
"getmainvars" }
static SyscallDescTable< SEWorkload::SyscallABI32 > syscallDescs32
32 bit syscall descriptors, indexed by call number.
void syscall(ThreadContext *tc) override
static SyscallDescTable< SEWorkload::SyscallABI64 > 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.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
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 getrandomFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> buf_ptr, typename OS::size_t count, unsigned int flags)
SyscallReturn pread64Func(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> bufPtr, int nbytes, int offset)
SyscallReturn recvmsgFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> msgPtr, int flags)
SyscallReturn fstat64Func(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr< typename OS::tgt_stat64 > tgt_stat)
Target fstat64() handler.
SyscallReturn wait4Func(SyscallDesc *desc, ThreadContext *tc, pid_t pid, VPtr<> statPtr, int options, VPtr<> rusagePtr)
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 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 fstatFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr< typename OS::tgt_stat > tgt_stat)
Target fstat() handler.
SyscallReturn truncate64Func(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, int64_t length)
Target truncate64() 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 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 selectFunc(SyscallDesc *desc, ThreadContext *tc, int nfds, VPtr< typename OS::fd_set > readfds, VPtr< typename OS::fd_set > writefds, VPtr< typename OS::fd_set > errorfds, VPtr< typename OS::timeval > timeout)
SyscallReturn utimesFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr< typename OS::timeval[2]> tp)
Target utimes() handler.
SyscallReturn socketFunc(SyscallDesc *desc, ThreadContext *tc, int domain, int type, int prot)
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 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 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 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 sysinfoFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< typename OS::tgt_sysinfo > sysinfo)
Target sysinfo() 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 pipeFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> tgt_addr)
Target pipe() 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 getsockoptFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int level, int optname, VPtr<> valPtr, VPtr<> lenPtr)
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 ignoreWarnOnceFunc(SyscallDesc *desc, ThreadContext *tc)
Like above, but only prints a warning once per syscall desc it's used with.
SyscallReturn socketpairFunc(SyscallDesc *desc, ThreadContext *tc, int domain, int type, int prot, VPtr<> svPtr)
SyscallReturn ftruncateFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, typename OS::off_t length)
Target ftruncate() handler.
SyscallReturn statfsFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr< typename OS::tgt_statfs > tgt_stat)
Target statfs() handler.
SyscallReturn setsockoptFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int level, int optname, VPtr<> valPtr, socklen_t len)
SyscallReturn lstatFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr< typename OS::tgt_stat > tgt_stat)
Target lstat() handler.
SyscallReturn rmdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
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 getpgrpFunc(SyscallDesc *desc, ThreadContext *tc)
Target getpgrpFunc() handler.
SyscallReturn eventfdFunc(SyscallDesc *desc, ThreadContext *tc, unsigned initval, int in_flags)
Target eventfd() function.
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 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 schedGetaffinityFunc(SyscallDesc *desc, ThreadContext *tc, pid_t pid, typename OS::size_t cpusetsize, VPtr<> cpu_set_mask)
Target sched_getaffinity.
SyscallReturn bindFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, int addrlen)
SyscallReturn pollFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> fdsPtr, int nfds, int tmout)
SyscallReturn getegidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getegid() handler.
SyscallReturn timeFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> taddr)
Target time() function.
SyscallReturn newfstatatFunc(SyscallDesc *desc, ThreadContext *tc, int dirfd, VPtr<> pathname, VPtr< typename OS::tgt_stat64 > tgt_stat, int flags)
Target newfstatat() handler.
SyscallReturn fchmodFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint32_t mode)
Target fchmod() handler.
SyscallReturn shutdownFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int how)
Target shutdown() handler.
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 getsocknameFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> addrPtr, VPtr<> lenPtr)
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 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 tgkillFunc(SyscallDesc *desc, ThreadContext *tc, int tgid, int tid, int sig)
SyscallReturn sendmsgFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> msgPtr, int flags)
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 pwrite64Func(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> bufPtr, int nbytes, int offset)
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 acceptFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> addrPtr, VPtr<> lenPtr)
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 fstatfsFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr< typename OS::tgt_statfs > tgt_stat)
Target fstatfs() handler.
SyscallReturn stat64Func(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr< typename OS::tgt_stat64 > tgt_stat)
Target stat64() handler.
SyscallReturn connectFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, int addrlen)
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 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 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()