gem5  v21.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
syscall_tbl32.cc
Go to the documentation of this file.
1 /*
2  * Copyright 2020 Google Inc.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met: redistributions of source code must retain the above copyright
7  * notice, this list of conditions and the following disclaimer;
8  * redistributions in binary form must reproduce the above copyright
9  * notice, this list of conditions and the following disclaimer in the
10  * documentation and/or other materials provided with the distribution;
11  * neither the name of the copyright holders nor the names of its
12  * contributors may be used to endorse or promote products derived from
13  * this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #include <sys/syscall.h>
29 
30 #include "arch/x86/linux/linux.hh"
33 #include "sim/syscall_emul.hh"
34 
35 namespace X86ISA
36 {
37 
39  { 0, "restart_syscall" },
40  { 1, "exit", exitFunc },
41  { 2, "fork" },
42  { 3, "read", readFunc<X86Linux32> },
43  { 4, "write", writeFunc<X86Linux32> },
44  { 5, "open", openFunc<X86Linux32> },
45  { 6, "close", closeFunc },
46  { 7, "waitpid" },
47  { 8, "creat" },
48  { 9, "link" },
49  { 10, "unlink" },
50  { 11, "execve", execveFunc<X86Linux32> },
51  { 12, "chdir", chdirFunc },
52  { 13, "time", timeFunc<X86Linux32> },
53  { 14, "mknod", mknodFunc },
54  { 15, "chmod" },
55  { 16, "lchown" },
56  { 17, "break" },
57  { 18, "oldstat" },
58  { 19, "lseek" },
59  { 20, "getpid", getpidFunc },
60  { 21, "mount" },
61  { 22, "umount" },
62  { 23, "setuid" },
63  { 24, "getuid", getuidFunc },
64  { 25, "stime" },
65  { 26, "ptrace" },
66  { 27, "alarm" },
67  { 28, "oldfstat" },
68  { 29, "pause" },
69  { 30, "utime" },
70  { 31, "stty" },
71  { 32, "gtty" },
72  { 33, "access", ignoreFunc },
73  { 34, "nice" },
74  { 35, "ftime" },
75  { 36, "sync" },
76  { 37, "kill" },
77  { 38, "rename" },
78  { 39, "mkdir", mkdirFunc },
79  { 40, "rmdir", mkdirFunc },
80  { 41, "dup", dupFunc },
81  { 42, "pipe", pipeFunc },
82  { 43, "times", timesFunc<X86Linux32> },
83  { 44, "prof" },
84  { 45, "brk", brkFunc },
85  { 46, "setgid" },
86  { 47, "getgid", getgidFunc },
87  { 48, "signal" },
88  { 49, "geteuid", geteuidFunc },
89  { 50, "getegid", getegidFunc },
90  { 51, "acct" },
91  { 52, "umount2" },
92  { 53, "lock" },
93  { 54, "ioctl", ioctlFunc<X86Linux32> },
94  { 55, "fcntl", fcntlFunc },
95  { 56, "mpx" },
96  { 57, "setpgid", setpgidFunc },
97  { 58, "ulimit" },
98  { 59, "oldolduname" },
99  { 60, "umask", umaskFunc },
100  { 61, "chroot" },
101  { 62, "ustat" },
102  { 63, "dup2", dup2Func },
103  { 64, "getppid" },
104  { 65, "getpgrp" },
105  { 66, "setsid" },
106  { 67, "sigaction" },
107  { 68, "sgetmask" },
108  { 69, "ssetmask" },
109  { 70, "setreuid" },
110  { 71, "setregid" },
111  { 72, "sigsuspend" },
112  { 73, "sigpending" },
113  { 74, "sethostname" },
114  { 75, "setrlimit", ignoreFunc },
115  { 76, "getrlimit", getrlimitFunc<X86Linux32> },
116  { 77, "getrusage", getrusageFunc<X86Linux32> },
117  { 78, "gettimeofday" },
118  { 79, "settimeofday" },
119  { 80, "getgroups" },
120  { 81, "setgroups" },
121  { 82, "select", selectFunc<X86Linux32> },
122  { 83, "symlink" },
123  { 84, "oldlstat" },
124  { 85, "readlink", readlinkFunc },
125  { 86, "uselib" },
126  { 87, "swapon" },
127  { 88, "reboot" },
128  { 89, "readdir" },
129  { 90, "mmap" },
130  { 91, "munmap", munmapFunc },
131  { 92, "truncate", truncateFunc },
132  { 93, "ftruncate", ftruncateFunc },
133  { 94, "fchmod" },
134  { 95, "fchown" },
135  { 96, "getpriority" },
136  { 97, "setpriority", ignoreFunc },
137  { 98, "profil" },
138  { 99, "statfs", ignoreFunc },
139  { 100, "fstatfs" },
140  { 101, "ioperm" },
141  { 102, "socketcall" },
142  { 103, "syslog" },
143  { 104, "setitimer" },
144  { 105, "getitimer" },
145  { 106, "stat" },
146  { 107, "lstat" },
147  { 108, "fstat" },
148  { 109, "olduname" },
149  { 110, "iopl" },
150  { 111, "vhangup" },
151  { 112, "idle" },
152  { 113, "vm86old" },
153  { 114, "wait4", wait4Func<X86Linux32> },
154  { 115, "swapoff" },
155  { 116, "sysinfo", sysinfoFunc<X86Linux32> },
156  { 117, "ipc" },
157  { 118, "fsync" },
158  { 119, "sigreturn" },
159  { 120, "clone", cloneFunc<X86Linux32> },
160  { 121, "setdomainname" },
161  { 122, "uname", unameFunc },
162  { 123, "modify_ldt" },
163  { 124, "adjtimex" },
164  { 125, "mprotect", ignoreFunc },
165  { 126, "sigprocmask" },
166  { 127, "create_module" },
167  { 128, "init_module" },
168  { 129, "delete_module" },
169  { 130, "get_kernel_syms" },
170  { 131, "quotactl" },
171  { 132, "getpgid" },
172  { 133, "fchdir" },
173  { 134, "bdflush" },
174  { 135, "sysfs" },
175  { 136, "personality" },
176  { 137, "afs_syscall" },
177  { 138, "setfsuid" },
178  { 139, "setfsgid" },
179  { 140, "_llseek", _llseekFunc },
180 #if defined(SYS_getdents)
181  { 141, "getdents", getdentsFunc },
182 #else
183  { 141, "getdents" },
184 #endif
185  { 142, "_newselect" },
186  { 143, "flock" },
187  { 144, "msync" },
188  { 145, "readv", readvFunc<X86Linux32> },
189  { 146, "writev", writevFunc<X86Linux32> },
190  { 147, "getsid" },
191  { 148, "fdatasync" },
192  { 149, "_sysctl" },
193  { 150, "mlock" },
194  { 151, "munlock" },
195  { 152, "mlockall" },
196  { 153, "munlockall" },
197  { 154, "sched_setparam" },
198  { 155, "sched_getparam" },
199  { 156, "sched_setscheduler" },
200  { 157, "sched_getscheduler" },
201  { 158, "sched_yield", ignoreFunc },
202  { 159, "sched_get_priority_max" },
203  { 160, "sched_get_priority_min" },
204  { 161, "sched_rr_get_interval" },
205  { 162, "nanosleep", ignoreFunc },
206  { 163, "mremap" },
207  { 164, "setresuid", ignoreFunc },
208  { 165, "getresuid" },
209  { 166, "vm86" },
210  { 167, "query_module" },
211  { 168, "poll", pollFunc<X86Linux32> },
212  { 169, "nfsservctl" },
213  { 170, "setresgid" },
214  { 171, "getresgid" },
215  { 172, "prctl" },
216  { 173, "rt_sigreturn" },
217  { 174, "rt_sigaction", ignoreFunc },
218  { 175, "rt_sigprocmask", ignoreFunc },
219  { 176, "rt_sigpending" },
220  { 177, "rt_sigtimedwait" },
221  { 178, "rt_sigqueueinfo" },
222  { 179, "rt_sigsuspend" },
223  { 180, "pread64", pread64Func<X86Linux64> },
224  { 181, "pwrite64", pwrite64Func<X86Linux64> },
225  { 182, "chown" },
226  { 183, "getcwd", getcwdFunc },
227  { 184, "capget" },
228  { 185, "capset" },
229  { 186, "sigaltstack" },
230  { 187, "sendfile" },
231  { 188, "getpmsg" },
232  { 189, "putpmsg" },
233  { 190, "vfork" },
234  { 191, "ugetrlimit", ignoreFunc },
235  { 192, "mmap2", mmap2Func<X86Linux32> },
236  { 193, "truncate64", truncate64Func },
237  { 194, "ftruncate64", ftruncate64Func },
238  { 195, "stat64", stat64Func<X86Linux32> },
239  { 196, "lstat64" },
240  { 197, "fstat64", fstat64Func<X86Linux32> },
241  { 198, "lchown32" },
242  { 199, "getuid32", getuidFunc },
243  { 200, "getgid32", getgidFunc },
244  { 201, "geteuid32", geteuidFunc },
245  { 202, "getegid32", getegidFunc },
246  { 203, "setreuid32" },
247  { 204, "setregid32" },
248  { 205, "getgroups32" },
249  { 206, "setgroups32" },
250  { 207, "fchown32" },
251  { 208, "setresuid32" },
252  { 209, "getresuid32" },
253  { 210, "setresgid32" },
254  { 211, "getresgid32" },
255  { 212, "chown32" },
256  { 213, "setuid32" },
257  { 214, "setgid32" },
258  { 215, "setfsuid32" },
259  { 216, "setfsgid32" },
260  { 217, "pivot_root" },
261  { 218, "mincore" },
262  { 219, "madvise", ignoreFunc },
263  { 220, "madvise1" },
264  { 221, "getdents64" },
265  { 222, "fcntl64" },
266  { 223, "unused" },
267  { 224, "gettid", gettidFunc },
268  { 225, "readahead" },
269  { 226, "setxattr" },
270  { 227, "lsetxattr" },
271  { 228, "fsetxattr" },
272  { 229, "getxattr" },
273  { 230, "lgetxattr" },
274  { 231, "fgetxattr" },
275  { 232, "listxattr" },
276  { 233, "llistxattr" },
277  { 234, "flistxattr" },
278  { 235, "removexattr" },
279  { 236, "lremovexattr" },
280  { 237, "fremovexattr" },
281  { 238, "tkill" },
282  { 239, "sendfile64" },
283  { 240, "futex" },
284  { 241, "sched_setaffinity", ignoreFunc },
285  { 242, "sched_getaffinity", ignoreFunc },
286  { 243, "set_thread_area", setThreadArea32Func },
287  { 244, "get_thread_area" },
288  { 245, "io_setup" },
289  { 246, "io_destroy" },
290  { 247, "io_getevents" },
291  { 248, "io_submit" },
292  { 249, "io_cancel" },
293  { 250, "fadvise64" },
294  { 251, "unused" },
295  { 252, "exit_group", exitFunc },
296  { 253, "lookup_dcookie" },
297  { 254, "epoll_create" },
298  { 255, "epoll_ctl" },
299  { 256, "epoll_wait" },
300  { 257, "remap_file_pages" },
301  { 258, "set_tid_address", setTidAddressFunc },
302  { 259, "timer_create" },
303  { 260, "timer_settime" },
304  { 261, "timer_gettime" },
305  { 262, "timer_getoverrun" },
306  { 263, "timer_delete" },
307  { 264, "clock_settime" },
308  { 265, "clock_gettime", clock_gettimeFunc<X86Linux32> },
309  { 266, "clock_getres" },
310  { 267, "clock_nanosleep" },
311  { 268, "statfs64" },
312  { 269, "fstatfs64" },
313  { 270, "tgkill", tgkillFunc<X86Linux32> },
314  { 271, "utimes" },
315  { 272, "fadvise64_64" },
316  { 273, "vserver" },
317  { 274, "mbind" },
318  { 275, "get_mempolicy", ignoreFunc },
319  { 276, "set_mempolicy" },
320  { 277, "mq_open" },
321  { 278, "mq_unlink" },
322  { 279, "mq_timedsend" },
323  { 280, "mq_timedreceive" },
324  { 281, "mq_notify" },
325  { 282, "mq_getsetattr" },
326  { 283, "kexec_load" },
327  { 284, "waitid" },
328  { 285, "sys_setaltroot" },
329  { 286, "add_key" },
330  { 287, "request_key" },
331  { 288, "keyctl" },
332  { 289, "ioprio_set" },
333  { 290, "ioprio_get" },
334  { 291, "inotify_init" },
335  { 292, "inotify_add_watch" },
336  { 293, "inotify_rm_watch" },
337  { 294, "migrate_pages" },
338  { 295, "openat", openatFunc<X86Linux32> },
339  { 296, "mkdirat" },
340  { 297, "mknodat" },
341  { 298, "fchownat" },
342  { 299, "futimesat" },
343  { 300, "fstatat64" },
344  { 301, "unlinkat" },
345  { 302, "renameat" },
346  { 303, "linkat" },
347  { 304, "symlinkat" },
348  { 305, "readlinkat", readlinkFunc },
349  { 306, "fchmodat" },
350  { 307, "faccessat" },
351  { 308, "pselect6" },
352  { 309, "ppoll" },
353  { 310, "unshare" },
354  { 311, "set_robust_list", ignoreFunc },
355  { 312, "get_robust_list", ignoreFunc },
356  { 313, "splice" },
357  { 314, "sync_file_range" },
358  { 315, "tee" },
359  { 316, "vmsplice" },
360  { 317, "move_pages" },
361  { 318, "getcpu", getcpuFunc },
362  { 319, "epoll_pwait" },
363  { 320, "utimensat" },
364  { 321, "signalfd" },
365  { 322, "timerfd" },
366  { 323, "eventfd", eventfdFunc<X86Linux32> }
367 };
368 
369 } // namespace X86ISA
geteuidFunc
SyscallReturn geteuidFunc(SyscallDesc *desc, ThreadContext *tc)
Target geteuid() handler.
Definition: syscall_emul.cc:954
pipeFunc
SyscallReturn pipeFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> tgt_addr)
Target pipe() handler.
Definition: syscall_emul.cc:794
dupFunc
SyscallReturn dupFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd)
FIXME: The file description is not shared among file descriptors created with dup.
Definition: syscall_emul.cc:669
brkFunc
SyscallReturn brkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> new_brk)
Target brk() handler: set brk address.
Definition: syscall_emul.cc:246
ignoreFunc
SyscallReturn ignoreFunc(SyscallDesc *desc, ThreadContext *tc)
Handler for unimplemented syscalls that we never intend to implement (signal handling,...
Definition: syscall_emul.cc:70
_llseekFunc
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.
Definition: syscall_emul.cc:301
se_workload.hh
mkdirFunc
SyscallReturn mkdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode)
Target mkdir() handler.
Definition: syscall_emul.cc:505
SyscallDescTable< EmuLinux::SyscallABI32 >
readlinkFunc
SyscallReturn readlinkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, VPtr<> buf_ptr, size_t bufsiz)
Target readlink() handler.
Definition: syscall_emul.cc:390
mknodFunc
SyscallReturn mknodFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode, dev_t dev)
Target mknod() handler.
Definition: syscall_emul.cc:1013
getegidFunc
SyscallReturn getegidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getegid() handler.
Definition: syscall_emul.cc:968
ftruncateFunc
SyscallReturn ftruncateFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, off_t length)
Target ftruncate() handler.
Definition: syscall_emul.cc:558
umaskFunc
SyscallReturn umaskFunc(SyscallDesc *desc, ThreadContext *tc)
Target umask() handler.
Definition: syscall_emul.cc:612
X86ISA::unameFunc
SyscallReturn unameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< Linux::utsname > name)
Target uname() handler.
Definition: syscalls.cc:45
munmapFunc
SyscallReturn munmapFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> start, size_t length)
Target munmap() handler.
Definition: syscall_emul.cc:328
exitFunc
SyscallReturn exitFunc(SyscallDesc *desc, ThreadContext *tc, int status)
Target exit() handler: terminate current context.
Definition: syscall_emul.cc:227
X86ISA::setThreadArea32Func
SyscallReturn setThreadArea32Func(SyscallDesc *desc, ThreadContext *tc, VPtr< UserDesc32 > userDesc)
Definition: syscalls.cc:96
getpidFunc
SyscallReturn getpidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getpid() handler.
Definition: syscall_emul.cc:926
setpgidFunc
SyscallReturn setpgidFunc(SyscallDesc *desc, ThreadContext *tc, int pid, int pgid)
Target setpgid() handler.
Definition: syscall_emul.cc:892
ftruncate64Func
SyscallReturn ftruncate64Func(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int64_t length)
Target ftruncate64() handler.
Definition: syscall_emul.cc:593
X86ISA
This is exposed globally, independent of the ISA.
Definition: acpi.hh:55
setTidAddressFunc
SyscallReturn setTidAddressFunc(SyscallDesc *desc, ThreadContext *tc, uint64_t tidPtr)
Target set_tid_address() handler.
Definition: syscall_emul.cc:268
truncateFunc
SyscallReturn truncateFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, off_t length)
Target truncate() handler.
Definition: syscall_emul.cc:541
X86ISA::EmuLinux::syscallDescs32
static SyscallDescTable< SyscallABI32 > syscallDescs32
Definition: se_workload.hh:80
fcntlFunc
SyscallReturn fcntlFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, int cmd, GuestABI::VarArgs< int > varargs)
Target fcntl() handler.
Definition: syscall_emul.cc:717
chdirFunc
SyscallReturn chdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
Target chdir() handler.
Definition: syscall_emul.cc:1028
gettidFunc
SyscallReturn gettidFunc(SyscallDesc *desc, ThreadContext *tc)
Target gettid() handler.
Definition: syscall_emul.cc:933
syscalls.hh
getuidFunc
SyscallReturn getuidFunc(SyscallDesc *desc, ThreadContext *tc)
Definition: syscall_emul.cc:947
syscall_emul.hh
closeFunc
SyscallReturn closeFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd)
Target close() handler.
Definition: syscall_emul.cc:277
linux.hh
getcwdFunc
SyscallReturn getcwdFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> buf_ptr, unsigned long size)
Target getcwd() handler.
Definition: syscall_emul.cc:360
getgidFunc
SyscallReturn getgidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getgid() handler.
Definition: syscall_emul.cc:961
truncate64Func
SyscallReturn truncate64Func(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, int64_t length)
Target truncate64() handler.
Definition: syscall_emul.cc:572
getcpuFunc
SyscallReturn getcpuFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< uint32_t > cpu, VPtr< uint32_t > node, VPtr< uint32_t > tcache)
Definition: syscall_emul.cc:1639
dup2Func
SyscallReturn dup2Func(SyscallDesc *desc, ThreadContext *tc, int old_tgt_fd, int new_tgt_fd)
Target dup2() handler.
Definition: syscall_emul.cc:689

Generated on Tue Mar 23 2021 19:41:23 for gem5 by doxygen 1.8.17