28#include <sys/syscall.h>
42 { 0,
"restart_syscall" },
101 { 59,
"oldolduname" },
114 { 72,
"sigsuspend" },
115 { 73,
"sigpending" },
116 { 74,
"sethostname" },
120 { 78,
"gettimeofday" },
121 { 79,
"settimeofday" },
138 { 96,
"getpriority" },
144 { 102,
"socketcall" },
146 { 104,
"setitimer" },
147 { 105,
"getitimer" },
161 { 119,
"sigreturn" },
163 { 121,
"setdomainname" },
165 { 123,
"modify_ldt" },
168 { 126,
"sigprocmask" },
169 { 127,
"create_module" },
170 { 128,
"init_module" },
171 { 129,
"delete_module" },
172 { 130,
"get_kernel_syms" },
178 { 136,
"personality" },
179 { 137,
"afs_syscall" },
183#if defined(SYS_getdents)
184 { 141,
"getdents", getdentsFunc },
188 { 142,
"_newselect" },
194 { 148,
"fdatasync" },
199 { 153,
"munlockall" },
200 { 154,
"sched_setparam" },
201 { 155,
"sched_getparam" },
202 { 156,
"sched_setscheduler" },
203 { 157,
"sched_getscheduler" },
205 { 159,
"sched_get_priority_max" },
206 { 160,
"sched_get_priority_min" },
207 { 161,
"sched_rr_get_interval" },
211 { 165,
"getresuid" },
213 { 167,
"query_module" },
215 { 169,
"nfsservctl" },
216 { 170,
"setresgid" },
217 { 171,
"getresgid" },
219 { 173,
"rt_sigreturn" },
222 { 176,
"rt_sigpending" },
223 { 177,
"rt_sigtimedwait" },
224 { 178,
"rt_sigqueueinfo" },
225 { 179,
"rt_sigsuspend" },
232 { 186,
"sigaltstack" },
249 { 203,
"setreuid32" },
250 { 204,
"setregid32" },
251 { 205,
"getgroups32" },
252 { 206,
"setgroups32" },
254 { 208,
"setresuid32" },
255 { 209,
"getresuid32" },
256 { 210,
"setresgid32" },
257 { 211,
"getresgid32" },
261 { 215,
"setfsuid32" },
262 { 216,
"setfsgid32" },
263 { 217,
"pivot_root" },
267#if defined(SYS_getdents64)
268 { 221,
"getdents64", getdents64Func },
270 { 221,
"getdents64" },
275 { 225,
"readahead" },
277 { 227,
"lsetxattr" },
278 { 228,
"fsetxattr" },
280 { 230,
"lgetxattr" },
281 { 231,
"fgetxattr" },
282 { 232,
"listxattr" },
283 { 233,
"llistxattr" },
284 { 234,
"flistxattr" },
285 { 235,
"removexattr" },
286 { 236,
"lremovexattr" },
287 { 237,
"fremovexattr" },
289 { 239,
"sendfile64" },
294 { 244,
"get_thread_area" },
296 { 246,
"io_destroy" },
297 { 247,
"io_getevents" },
298 { 248,
"io_submit" },
299 { 249,
"io_cancel" },
300 { 250,
"fadvise64" },
303 { 253,
"lookup_dcookie" },
304 { 254,
"epoll_create" },
305 { 255,
"epoll_ctl" },
306 { 256,
"epoll_wait" },
307 { 257,
"remap_file_pages" },
309 { 259,
"timer_create" },
310 { 260,
"timer_settime" },
311 { 261,
"timer_gettime" },
312 { 262,
"timer_getoverrun" },
313 { 263,
"timer_delete" },
314 { 264,
"clock_settime" },
316 { 266,
"clock_getres" },
317 { 267,
"clock_nanosleep" },
319 { 269,
"fstatfs64" },
322 { 272,
"fadvise64_64" },
326 { 276,
"set_mempolicy" },
328 { 278,
"mq_unlink" },
329 { 279,
"mq_timedsend" },
330 { 280,
"mq_timedreceive" },
331 { 281,
"mq_notify" },
332 { 282,
"mq_getsetattr" },
333 { 283,
"kexec_load" },
335 { 285,
"sys_setaltroot" },
337 { 287,
"request_key" },
339 { 289,
"ioprio_set" },
340 { 290,
"ioprio_get" },
341 { 291,
"inotify_init" },
342 { 292,
"inotify_add_watch" },
343 { 293,
"inotify_rm_watch" },
344 { 294,
"migrate_pages" },
349 { 299,
"futimesat" },
350 { 300,
"fstatat64" },
354 { 304,
"symlinkat" },
357 { 307,
"faccessat" },
364 { 314,
"sync_file_range" },
367 { 317,
"move_pages" },
369 { 319,
"epoll_pwait" },
370 { 320,
"utimensat" },
static SyscallDescTable< SyscallABI32 > syscallDescs32
SyscallReturn unameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< Linux::utsname > name)
Target uname() handler.
SyscallReturn setThreadArea32Func(SyscallDesc *desc, ThreadContext *tc, VPtr< UserDesc32 > userDesc)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
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 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 getpidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getpid() handler.
SyscallReturn chdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
Target chdir() 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 cloneFunc(SyscallDesc *desc, ThreadContext *tc, RegVal flags, RegVal newStack, VPtr<> ptidPtr, VPtr<> ctidPtr, VPtr<> tlsPtr)
SyscallReturn readFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, int nbytes)
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 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 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 sysinfoFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< typename OS::tgt_sysinfo > sysinfo)
Target sysinfo() handler.
SyscallReturn pipeFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> tgt_addr)
Target pipe() handler.
SyscallReturn getrlimitFunc(SyscallDesc *desc, ThreadContext *tc, unsigned resource, VPtr< typename OS::rlimit > rlp)
Target getrlimit() handler.
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 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 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 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 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 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 tgkillFunc(SyscallDesc *desc, ThreadContext *tc, int tgid, int tid, int sig)
SyscallReturn pwrite64Func(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> bufPtr, int nbytes, int offset)
SyscallReturn ignoreFunc(SyscallDesc *desc, ThreadContext *tc)
Handler for unimplemented syscalls that we never intend to implement (signal handling,...
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 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 mmap2Func(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 mmap2() handler.
SyscallReturn readvFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint64_t tiov_base, typename OS::size_t count)
Target readv() handler.
This file defines objects used to emulate syscalls from the target application on the host machine.