39#include <sys/syscall.h>
53 { 0,
"read", readFunc<X86Linux64> },
54 { 1,
"write", writeFunc<X86Linux64> },
55 { 2,
"open", openFunc<X86Linux64> },
57 { 4,
"stat", stat64Func<X86Linux64> },
58 { 5,
"fstat", fstat64Func<X86Linux64> },
59 { 6,
"lstat", lstat64Func<X86Linux64> },
60 { 7,
"poll", pollFunc<X86Linux64> },
61 { 8,
"lseek", lseekFunc<X86Linux64> },
62 { 9,
"mmap", mmapFunc<X86Linux64> },
64 { 11,
"munmap", munmapFunc<X86Linux64> },
68 { 15,
"rt_sigreturn" },
69 { 16,
"ioctl", ioctlFunc<X86Linux64> },
70 { 17,
"pread64", pread64Func<X86Linux64> },
71 { 18,
"pwrite64", pwrite64Func<X86Linux64> },
72 { 19,
"readv", readvFunc<X86Linux64> },
73 { 20,
"writev", writevFunc<X86Linux64> },
76 { 23,
"select", selectFunc<X86Linux64> },
78 { 25,
"mremap", mremapFunc<X86Linux64> },
94 { 41,
"socket", socketFunc<X86Linux64> },
96 { 43,
"accept", acceptFunc<X86Linux64> },
97 { 44,
"sendto", sendtoFunc<X86Linux64> },
98 { 45,
"recvfrom", recvfromFunc<X86Linux64> },
106 { 53,
"socketpair", socketpairFunc<X86Linux64> },
109 { 56,
"clone", cloneFunc<X86Linux64> },
112 { 59,
"execve", execveFunc<X86Linux64> },
114 { 61,
"wait4", wait4Func<X86Linux64> },
129 { 76,
"truncate", truncateFunc<X86Linux64> },
130 { 77,
"ftruncate", ftruncateFunc<X86Linux64> },
131#if defined(SYS_getdents)
132 { 78,
"getdents", getdentsFunc },
136 { 79,
"getcwd", getcwdFunc<X86Linux64> },
146 { 89,
"readlink", readlinkFunc<X86Linux64> },
147 { 90,
"chmod", chmodFunc<X86Linux64> },
148 { 91,
"fchmod", fchmodFunc<X86Linux64> },
153 { 96,
"gettimeofday", gettimeofdayFunc<X86Linux64> },
154 { 97,
"getrlimit", getrlimitFunc<X86Linux64> },
155 { 98,
"getrusage", getrusageFunc<X86Linux64> },
156 { 99,
"sysinfo", sysinfoFunc<X86Linux64> },
157 { 100,
"times", timesFunc<X86Linux64> },
172 { 115,
"getgroups" },
173 { 116,
"setgroups" },
175 { 118,
"getresuid" },
176 { 119,
"setresgid" },
177 { 120,
"getresgid" },
184 { 127,
"rt_sigpending" },
185 { 128,
"rt_sigtimedwait" },
186 { 129,
"rt_sigqueueinfo" },
187 { 130,
"rt_sigsuspend" },
192 { 135,
"personality" },
194 { 137,
"statfs", statfsFunc<X86Linux64> },
195 { 138,
"fstatfs", fstatfsFunc<X86Linux64> },
197 { 140,
"getpriority" },
199 { 142,
"sched_setparam" },
200 { 143,
"sched_getparam" },
201 { 144,
"sched_setscheduler" },
202 { 145,
"sched_getscheduler" },
203 { 146,
"sched_get_priority_max" },
204 { 147,
"sched_get_priority_min" },
205 { 148,
"sched_rr_get_interval" },
209 { 152,
"munlockall" },
212 { 155,
"pivot_root" },
221 { 164,
"settimeofday" },
227 { 170,
"sethostname" },
228 { 171,
"setdomainname" },
231 { 174,
"create_module" },
232 { 175,
"init_module" },
233 { 176,
"delete_module" },
234 { 177,
"get_kernel_syms" },
235 { 178,
"query_module" },
237 { 180,
"nfsservctl" },
240 { 183,
"afs_syscall" },
244 { 187,
"readahead" },
246 { 189,
"lsetxattr" },
247 { 190,
"fsetxattr" },
249 { 192,
"lgetxattr" },
250 { 193,
"fgetxattr" },
251 { 194,
"listxattr" },
252 { 195,
"llistxattr" },
253 { 196,
"flistxattr" },
254 { 197,
"removexattr" },
255 { 198,
"lremovexattr" },
256 { 199,
"fremovexattr" },
258 { 201,
"time", timeFunc<X86Linux64> },
259 { 202,
"futex", futexFunc<X86Linux64> },
261 { 204,
"sched_getaffinity", schedGetaffinityFunc<X86Linux64> },
262 { 205,
"set_thread_area" },
264 { 207,
"io_destroy" },
265 { 208,
"io_getevents" },
266 { 209,
"io_submit" },
267 { 210,
"io_cancel" },
268 { 211,
"get_thread_area" },
269 { 212,
"lookup_dcookie" },
270 { 213,
"epoll_create" },
271 { 214,
"epoll_ctl_old" },
272 { 215,
"epoll_wait_old" },
273 { 216,
"remap_file_pages" },
274#if defined(SYS_getdents64)
275 { 217,
"getdents64", getdents64Func },
277 { 217,
"getdents64" },
280 { 219,
"restart_syscall" },
281 { 220,
"semtimedop" },
283 { 222,
"timer_create" },
284 { 223,
"timer_settime" },
285 { 224,
"timer_gettime" },
286 { 225,
"timer_getoverrun" },
287 { 226,
"timer_delete" },
288 { 227,
"clock_settime" },
289 { 228,
"clock_gettime", clock_gettimeFunc<X86Linux64> },
290 { 229,
"clock_getres", clock_getresFunc<X86Linux64> },
291 { 230,
"clock_nanosleep" },
293 { 232,
"epoll_wait" },
294 { 233,
"epoll_ctl" },
295 { 234,
"tgkill", tgkillFunc<X86Linux64> },
296 { 235,
"utimes", utimesFunc<X86Linux64> },
299 { 238,
"set_mempolicy" },
302 { 241,
"mq_unlink" },
303 { 242,
"mq_timedsend" },
304 { 243,
"mq_timedreceive" },
305 { 244,
"mq_notify" },
306 { 245,
"mq_getsetattr" },
307 { 246,
"kexec_load" },
310 { 249,
"request_key" },
312 { 251,
"ioprio_set" },
313 { 252,
"ioprio_get" },
314 { 253,
"inotify_init" },
315 { 254,
"inotify_add_watch" },
316 { 255,
"inotify_rm_watch" },
317 { 256,
"migrate_pages" },
318 { 257,
"openat", openatFunc<X86Linux64> },
319 { 258,
"mkdirat", mkdiratFunc<X86Linux64> },
320 { 259,
"mknodat", mknodatFunc<X86Linux64> },
321 { 260,
"fchownat", fchownatFunc<X86Linux64> },
322 { 261,
"futimesat", futimesatFunc<X86Linux64> },
323 { 262,
"newfstatat", newfstatatFunc<X86Linux64> },
324 { 263,
"unlinkat", unlinkatFunc<X86Linux64> },
325 { 264,
"renameat", renameatFunc<X86Linux64> },
327 { 266,
"symlinkat" },
328 { 267,
"readlinkat", readlinkFunc<X86Linux64> },
329 { 268,
"fchmodat", fchmodatFunc<X86Linux64> },
330 { 269,
"faccessat", faccessatFunc<X86Linux64> },
335 { 274,
"get_robust_list" },
338 { 277,
"sync_file_range" },
340 { 279,
"move_pages" },
341 { 280,
"utimensat" },
342 { 281,
"epoll_pwait" },
344 { 283,
"timerfd_create" },
345 { 284,
"eventfd", eventfdFunc<X86Linux64> },
346 { 285,
"fallocate", fallocateFunc<X86Linux64> },
347 { 286,
"timerfd_settime" },
348 { 287,
"timerfd_gettime" },
350 { 289,
"signalfd4" },
351 { 290,
"eventfd2", eventfdFunc<X86Linux64> },
352 { 291,
"epoll_create1" },
355 { 294,
"inotify_init1" },
358 { 297,
"rt_tgsigqueueinfo" },
359 { 298,
"perf_event_open" },
361 { 300,
"fanotify_init" },
362 { 301,
"fanotify_mark" },
363 { 302,
"prlimit64", prlimitFunc<X86Linux64> },
364 { 303,
"name_to_handle_at" },
365 { 304,
"open_by_handle_at" },
366 { 305,
"clock_adjtime" },
371 { 310,
"proess_vm_readv" },
372 { 311,
"proess_vm_writev" },
374 { 313,
"finit_module" },
375 { 318,
"getrandom", getrandomFunc<X86Linux64> },
376 { 319,
"memfd_create" },
377 { 320,
"kexec_file_load" },
380 { 323,
"userfaultfd" },
381 { 324,
"membarrier" },
383 { 326,
"copy_file_range" },
386 { 329,
"pkey_mprotect" },
387 { 330,
"pkey_alloc" },
388 { 331,
"pkey_free" },
389 { 332,
"statx", statxFunc<X86Linux64> },
390 { 333,
"io_pgetevents" },
392 { 424,
"pidfd_send_signal" },
393 { 425,
"io_uring_setup" },
394 { 426,
"io_uring_enter" },
395 { 427,
"io_uring_register" },
396 { 428,
"open_tree" },
397 { 429,
"move_mount" },
402 { 434,
"pidfd_open" },
403 { 435,
"clone3", clone3Func<X86Linux64> },
404 { 436,
"close_range" },
406 { 438,
"pidfd_getfd" },
407 { 439,
"faccessat2" },
408 { 440,
"process_madvise" },
409 { 441,
"epoll_pwait2" },
410 { 442,
"mount_setattr" },
411 { 443,
"quotactl_fd" },
412 { 444,
"landlock_create_ruleset" },
413 { 445,
"landlock_add_rule" },
414 { 446,
"landlock_restrict_self" },
415 { 447,
"memfd_secret" },
416 { 448,
"process_mrelease" },
417 { 449,
"futex_waitv" },
418 { 450,
"set_mempolicy_home_node" }
static SyscallDescTable< SyscallABI64 > syscallDescs64
SyscallReturn unameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< Linux::utsname > name)
Target uname() handler.
SyscallReturn archPrctlFunc(SyscallDesc *desc, ThreadContext *tc, int code, uint64_t addr)
Copyright (c) 2024 Arm Limited 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 recvmsgFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> msgPtr, int flags)
SyscallReturn brkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> new_brk)
Target brk() handler: set brk address.
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 getuidFunc(SyscallDesc *desc, ThreadContext *tc)
SyscallReturn chownFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, uint32_t owner, uint32_t group)
Target chown() 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 setpgidFunc(SyscallDesc *desc, ThreadContext *tc, int pid, int pgid)
Target setpgid() handler.
SyscallReturn geteuidFunc(SyscallDesc *desc, ThreadContext *tc)
Target geteuid() 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 pipeFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> tgt_addr)
Target pipe() handler.
SyscallReturn getsockoptFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int level, int optname, VPtr<> valPtr, VPtr<> lenPtr)
SyscallReturn ignoreWarnOnceFunc(SyscallDesc *desc, ThreadContext *tc)
Like above, but only prints a warning once per syscall desc it's used with.
SyscallReturn setsockoptFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int level, int optname, VPtr<> valPtr, socklen_t len)
SyscallReturn rmdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
SyscallReturn mkdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode)
Target mkdir() handler.
SyscallReturn getpgrpFunc(SyscallDesc *desc, ThreadContext *tc)
Target getpgrpFunc() handler.
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 fchownFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint32_t owner, uint32_t group)
Target fchown() handler.
SyscallReturn setTidAddressFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> tidPtr)
Target set_tid_address() handler.
SyscallReturn fcntlFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int cmd, guest_abi::VarArgs< int > varargs)
Target fcntl() handler.
SyscallReturn bindFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, int addrlen)
SyscallReturn getegidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getegid() handler.
SyscallReturn shutdownFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int how)
Target shutdown() 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 getpeernameFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> sockAddrPtr, VPtr<> addrlenPtr)
SyscallReturn accessFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode)
Target access() handler.
SyscallReturn sendmsgFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> msgPtr, int flags)
SyscallReturn ignoreFunc(SyscallDesc *desc, ThreadContext *tc)
Handler for unimplemented syscalls that we never intend to implement (signal handling,...
SyscallReturn connectFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, VPtr<> buf_ptr, int addrlen)
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 closeFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd)
Target close() handler.
SyscallReturn umaskFunc(SyscallDesc *desc, ThreadContext *tc)
Target umask() handler.
This file defines objects used to emulate syscalls from the target application on the host machine.