39#include <sys/syscall.h>
53 { 0,
"restart_syscall" },
56 { 3,
"read", readFunc<X86Linux32> },
57 { 4,
"write", writeFunc<X86Linux32> },
58 { 5,
"open", openFunc<X86Linux32> },
64 { 11,
"execve", execveFunc<X86Linux32> },
66 { 13,
"time", timeFunc<X86Linux32> },
72 { 19,
"lseek", lseekFunc<X86Linux32> },
96 { 43,
"times", timesFunc<X86Linux32> },
107 { 54,
"ioctl", ioctlFunc<X86Linux32> },
112 { 59,
"oldolduname" },
125 { 72,
"sigsuspend" },
126 { 73,
"sigpending" },
127 { 74,
"sethostname" },
129 { 76,
"getrlimit", getrlimitFunc<X86Linux32> },
130 { 77,
"getrusage", getrusageFunc<X86Linux32> },
131 { 78,
"gettimeofday" },
132 { 79,
"settimeofday" },
135 { 82,
"select", selectFunc<X86Linux32> },
138 { 85,
"readlink", readlinkFunc<X86Linux32> },
144 { 91,
"munmap", munmapFunc<X86Linux32> },
145 { 92,
"truncate", truncateFunc<X86Linux32> },
146 { 93,
"ftruncate", ftruncateFunc<X86Linux32> },
149 { 96,
"getpriority" },
155 { 102,
"socketcall" },
157 { 104,
"setitimer" },
158 { 105,
"getitimer" },
167 { 114,
"wait4", wait4Func<X86Linux32> },
169 { 116,
"sysinfo", sysinfoFunc<X86Linux32> },
172 { 119,
"sigreturn" },
173 { 120,
"clone", cloneFunc<X86Linux32> },
174 { 121,
"setdomainname" },
176 { 123,
"modify_ldt" },
179 { 126,
"sigprocmask" },
180 { 127,
"create_module" },
181 { 128,
"init_module" },
182 { 129,
"delete_module" },
183 { 130,
"get_kernel_syms" },
189 { 136,
"personality" },
190 { 137,
"afs_syscall" },
194#if defined(SYS_getdents)
195 { 141,
"getdents", getdentsFunc },
199 { 142,
"_newselect" },
202 { 145,
"readv", readvFunc<X86Linux32> },
203 { 146,
"writev", writevFunc<X86Linux32> },
205 { 148,
"fdatasync" },
210 { 153,
"munlockall" },
211 { 154,
"sched_setparam" },
212 { 155,
"sched_getparam" },
213 { 156,
"sched_setscheduler" },
214 { 157,
"sched_getscheduler" },
216 { 159,
"sched_get_priority_max" },
217 { 160,
"sched_get_priority_min" },
218 { 161,
"sched_rr_get_interval" },
222 { 165,
"getresuid" },
224 { 167,
"query_module" },
225 { 168,
"poll", pollFunc<X86Linux32> },
226 { 169,
"nfsservctl" },
227 { 170,
"setresgid" },
228 { 171,
"getresgid" },
230 { 173,
"rt_sigreturn" },
233 { 176,
"rt_sigpending" },
234 { 177,
"rt_sigtimedwait" },
235 { 178,
"rt_sigqueueinfo" },
236 { 179,
"rt_sigsuspend" },
237 { 180,
"pread64", pread64Func<X86Linux64> },
238 { 181,
"pwrite64", pwrite64Func<X86Linux64> },
240 { 183,
"getcwd", getcwdFunc<X86Linux32> },
243 { 186,
"sigaltstack" },
249 { 192,
"mmap2", mmap2Func<X86Linux32> },
252 { 195,
"stat64", stat64Func<X86Linux32> },
254 { 197,
"fstat64", fstat64Func<X86Linux32> },
260 { 203,
"setreuid32" },
261 { 204,
"setregid32" },
262 { 205,
"getgroups32" },
263 { 206,
"setgroups32" },
265 { 208,
"setresuid32" },
266 { 209,
"getresuid32" },
267 { 210,
"setresgid32" },
268 { 211,
"getresgid32" },
272 { 215,
"setfsuid32" },
273 { 216,
"setfsgid32" },
274 { 217,
"pivot_root" },
278#if defined(SYS_getdents64)
279 { 221,
"getdents64", getdents64Func },
281 { 221,
"getdents64" },
286 { 225,
"readahead" },
288 { 227,
"lsetxattr" },
289 { 228,
"fsetxattr" },
291 { 230,
"lgetxattr" },
292 { 231,
"fgetxattr" },
293 { 232,
"listxattr" },
294 { 233,
"llistxattr" },
295 { 234,
"flistxattr" },
296 { 235,
"removexattr" },
297 { 236,
"lremovexattr" },
298 { 237,
"fremovexattr" },
300 { 239,
"sendfile64" },
305 { 244,
"get_thread_area" },
307 { 246,
"io_destroy" },
308 { 247,
"io_getevents" },
309 { 248,
"io_submit" },
310 { 249,
"io_cancel" },
311 { 250,
"fadvise64" },
314 { 253,
"lookup_dcookie" },
315 { 254,
"epoll_create" },
316 { 255,
"epoll_ctl" },
317 { 256,
"epoll_wait" },
318 { 257,
"remap_file_pages" },
320 { 259,
"timer_create" },
321 { 260,
"timer_settime" },
322 { 261,
"timer_gettime" },
323 { 262,
"timer_getoverrun" },
324 { 263,
"timer_delete" },
325 { 264,
"clock_settime" },
326 { 265,
"clock_gettime", clock_gettimeFunc<X86Linux32> },
327 { 266,
"clock_getres" },
328 { 267,
"clock_nanosleep" },
330 { 269,
"fstatfs64" },
331 { 270,
"tgkill", tgkillFunc<X86Linux32> },
333 { 272,
"fadvise64_64" },
337 { 276,
"set_mempolicy" },
339 { 278,
"mq_unlink" },
340 { 279,
"mq_timedsend" },
341 { 280,
"mq_timedreceive" },
342 { 281,
"mq_notify" },
343 { 282,
"mq_getsetattr" },
344 { 283,
"kexec_load" },
346 { 285,
"sys_setaltroot" },
348 { 287,
"request_key" },
350 { 289,
"ioprio_set" },
351 { 290,
"ioprio_get" },
352 { 291,
"inotify_init" },
353 { 292,
"inotify_add_watch" },
354 { 293,
"inotify_rm_watch" },
355 { 294,
"migrate_pages" },
356 { 295,
"openat", openatFunc<X86Linux32> },
360 { 299,
"futimesat" },
361 { 300,
"fstatat64" },
365 { 304,
"symlinkat" },
366 { 305,
"readlinkat", readlinkFunc<X86Linux32> },
368 { 307,
"faccessat" },
375 { 314,
"sync_file_range" },
378 { 317,
"move_pages" },
380 { 319,
"epoll_pwait" },
381 { 320,
"utimensat" },
384 { 323,
"eventfd", eventfdFunc<X86Linux32> },
385 { 355,
"getrandom", getrandomFunc<X86Linux32>}
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 Arm Limited All rights reserved.
SyscallReturn gettidFunc(SyscallDesc *desc, ThreadContext *tc)
Target gettid() handler.
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 _llseekFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint32_t offset_high, uint32_t offset_low, VPtr<> result_ptr, int whence)
Target _llseek() 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 pipeFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> tgt_addr)
Target pipe() handler.
SyscallReturn mkdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode)
Target mkdir() 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 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 getegidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getegid() handler.
SyscallReturn getcpuFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< uint32_t > cpu, VPtr< uint32_t > node, VPtr< uint32_t > tcache)
SyscallReturn ignoreFunc(SyscallDesc *desc, ThreadContext *tc)
Handler for unimplemented syscalls that we never intend to implement (signal handling,...
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.