gem5  v22.1.0.0
syscalls.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2005 The Regents of The University of Michigan
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met: redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
31 #include "sim/syscall_desc.hh"
32 #include "sim/syscall_emul.hh"
33 
34 namespace gem5
35 {
36 
37 class Process;
38 class ThreadContext;
39 
40 namespace SparcISA
41 {
42 
44 static SyscallReturn
46 {
47  auto process = tc->getProcessPtr();
48 
49  strcpy(name->sysname, "Linux");
50  strcpy(name->nodename, "sim.gem5.org");
51  strcpy(name->release, process->release.c_str());
52  strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
53  strcpy(name->machine, "sparc");
54 
55  return 0;
56 }
57 
58 
59 static SyscallReturn
61  VPtr<> ruid, VPtr<> euid, VPtr<> suid)
62 {
63  SETranslatingPortProxy proxy(tc);
64  const uint64_t id = htobe(100);
65  // Handle the EFAULT case
66  // Set the ruid
67  if (ruid) {
68  BufferArg ruidBuff(ruid, sizeof(uint64_t));
69  memcpy(ruidBuff.bufferPtr(), &id, sizeof(uint64_t));
70  ruidBuff.copyOut(proxy);
71  }
72  // Set the euid
73  if (euid) {
74  BufferArg euidBuff(euid, sizeof(uint64_t));
75  memcpy(euidBuff.bufferPtr(), &id, sizeof(uint64_t));
76  euidBuff.copyOut(proxy);
77  }
78  // Set the suid
79  if (suid) {
80  BufferArg suidBuff(suid, sizeof(uint64_t));
81  memcpy(suidBuff.bufferPtr(), &id, sizeof(uint64_t));
82  suidBuff.copyOut(proxy);
83  }
84  return 0;
85 }
86 
88  { 0, "restart_syscall" },
89  { 1, "exit", exitFunc }, // 32 bit
90  { 2, "fork" },
91  { 3, "read", readFunc<Sparc32Linux> },
92  { 4, "write", writeFunc<Sparc32Linux> },
93  { 5, "open", openFunc<Sparc32Linux> }, // 32 bit
94  { 6, "close", closeFunc },
95  { 7, "wait4" }, // 32 bit
96  { 8, "creat" }, // 32 bit
97  { 9, "link" },
98  { 10, "unlink", unlinkFunc },
99  { 11, "execv" },
100  { 12, "chdir" },
101  { 13, "chown", chownFunc }, // 32 bit
102  { 14, "mknod" },
103  { 15, "chmod" },
104  { 16, "lchown" }, // 32 bit
105  { 17, "brk", brkFunc },
106  { 18, "perfctr" }, // 32 bit
107  { 19, "lseek", lseekFunc }, // 32 bit
108  { 20, "getpid", getpidFunc },
109  { 21, "capget" },
110  { 22, "capset" },
111  { 23, "setuid", ignoreFunc }, // 32 bit
112  { 24, "getuid", getuidFunc }, // 32 bit
113  { 25, "time" },
114  { 26, "ptrace" },
115  { 27, "alarm" },
116  { 28, "sigaltstack" }, // 32 bit
117  { 29, "pause" }, // 32 bit
118  { 30, "utime" },
119  { 31, "lchown32" },
120  { 32, "fchown32" },
121  { 33, "access" }, // 32 bit
122  { 34, "nice" }, // 32 bit
123  { 35, "chown32" },
124  { 36, "sync" },
125  { 37, "kill" }, // 32 bit
126  { 38, "stat" },
127  { 39, "sendfile" }, // 32 bit
128  { 40, "lstat" },
129  { 41, "dup" },
130  { 42, "pipe", pipePseudoFunc },
131  { 43, "times", ignoreFunc },
132  { 44, "getuid32" },
133  { 45, "umount2" }, // 32 bit
134  { 46, "setgid" }, // 32 bit
135  { 47, "getgid", getgidFunc }, // 32 bit
136  { 48, "signal" }, // 32 bit
137  { 49, "geteuid", geteuidFunc }, // 32 bit
138  { 50, "getegid", getegidFunc }, // 32 bit
139  { 51, "acct" },
140  { 52, "memory_ordering" },
141  { 53, "getgid32" },
142  { 54, "ioctl" },
143  { 55, "reboot" }, // 32 bit
144  { 56, "mmap2" }, // 32 bit
145  { 57, "symlink" },
146  { 58, "readlink", readlinkFunc<Sparc32Linux> }, // 32 bit
147  { 59, "execve" }, // 32 bit
148  { 60, "umask" }, // 32 bit
149  { 61, "chroot" },
150  { 62, "fstat" },
151  { 63, "fstat64", fstat64Func<Sparc32Linux> },
152  { 64, "getpagesize" },
153  { 65, "msync" }, // 32 bit
154  { 66, "vfork" },
155  { 67, "pread64" }, // 32 bit
156  { 68, "pwrite64" }, // 32 bit
157  { 69, "geteuid32" },
158  { 70, "getegid32" },
159  { 71, "mmap", mmapFunc<Sparc32Linux> },
160  { 72, "setreuid32" },
161  { 73, "munmap", munmapFunc<Sparc32Linux> },
162  { 74, "mprotect", ignoreFunc },
163  { 75, "madvise" },
164  { 76, "vhangup" },
165  { 77, "truncate64" }, // 32 bit
166  { 78, "mincore" },
167  { 79, "getgroups" }, // 32 bit
168  { 80, "setgroups" }, // 32 bit
169  { 81, "getpgrp" },
170  { 82, "setgroups32" }, // 32 bit
171  { 83, "setitimer" }, // 32 bit
172  { 84, "ftruncate64" }, // 32 bit
173  { 85, "swapon" }, // 32 bit
174  { 86, "getitimer" }, // 32 bit
175  { 87, "setuid32" },
176  { 88, "sethostname" }, // 32 bit
177  { 89, "setgid32" },
178  { 90, "dup2" },
179  { 91, "setfsuid32" },
180  { 92, "fcntl" },
181  { 93, "select" }, // 32 bit
182  { 94, "setfsgid32" },
183  { 95, "fsync" },
184  { 96, "setpriority" }, // 32 bit
185  { 97, "socket" },
186  { 98, "connect" },
187  { 99, "accept" },
188  { 100, "getpriority" }, // 32 bit
189  { 101, "rt_sigreturn" }, // 32 bit
190  { 102, "rt_sigaction", ignoreFunc }, // 32 bit
191  { 103, "rt_sigprocmask", ignoreFunc }, // 32 bit
192  { 104, "rt_sigpending" }, // 32 bit
193  { 105, "rt_sigtimedwait" },
194  { 106, "rt_sigqueueinfo" }, // 32 bit
195  { 107, "rt_sigsuspend" },
196  { 108, "setresuid32" },
197  { 109, "getresuid32", getresuidFunc },
198  { 110, "setresgid32", ignoreFunc },
199  { 111, "getresgid32" },
200  { 112, "setregid32" },
201  { 113, "revcmsg" },
202  { 114, "sendmsg" },
203  { 115, "getgroups32" }, // 32 bit
204  { 116, "gettimeofday", gettimeofdayFunc<Sparc32Linux> }, // 32 bit
205  { 117, "getrusage" }, // 32 bit
206  { 118, "getsockopt" },
207  { 119, "getcwd", getcwdFunc },
208  { 120, "readv" },
209  { 121, "writev" },
210  { 122, "settimeofday" }, // 32 bit
211  { 123, "fchown" }, // 32 bit
212  { 124, "fchmod" },
213  { 125, "recvfrom" },
214  { 126, "setreuid" }, // 32 bit
215  { 127, "setregid" }, // 32 bit
216  { 128, "rename", renameFunc },
217  { 129, "truncate" },
218  { 130, "ftruncate" },
219  { 131, "flock" },
220  { 132, "lstat64" },
221  { 133, "sendto" },
222  { 134, "shutdown" },
223  { 135, "socketpair" },
224  { 136, "mkdir", mkdirFunc }, // 32 bit
225  { 137, "rmdir" },
226  { 138, "utimes" }, // 32 bit
227  { 139, "stat64" },
228  { 140, "sendfile64" }, // 32 bit
229  { 141, "getpeername" },
230  { 142, "futex" }, // 32 bit
231  { 143, "gettid" },
232  { 144, "getrlimit" },
233  { 145, "setrlimit" },
234  { 146, "pivot_root" },
235  { 147, "prctl" }, // 32 bit
236  { 148, "pciconfig_read" },
237  { 149, "pciconfig_write" },
238  { 150, "getsockname" },
239  { 151, "inotify_init" },
240  { 152, "inotify_add_watch" },
241  { 153, "poll" },
242  { 154, "getdents64" },
243  { 155, "fcntl64" },
244  { 156, "inotify_rm_watch" },
245  { 157, "statfs" },
246  { 158, "fstatfs" },
247  { 159, "umount" },
248  { 160, "sched_setaffinity" },
249  { 161, "sched_getaffinity" },
250  { 162, "getdomainname" }, // 32 bit
251  { 163, "setdomainname" }, // 32 bit
252  { 164, "ni_syscall" },
253  { 165, "quotactl" },
254  { 166, "set_tid_address" },
255  { 167, "mount" },
256  { 168, "ustat" },
257  { 169, "setxattr" }, // 32 bit
258  { 170, "lsetxattr" }, // 32 bit
259  { 171, "fsetxattr" }, // 32 bit
260  { 172, "getxattr" },
261  { 173, "lgetxattr" },
262  { 174, "getdents" },
263  { 175, "setsid" },
264  { 176, "fchdir" },
265  { 177, "fgetxattr" }, // 32 bit
266  { 178, "listxattr" },
267  { 179, "llistxattr" },
268  { 180, "flistxattr" }, // 32 bit
269  { 181, "removexattr" },
270  { 182, "lremovexattr" },
271  { 183, "sigpending" },
272  { 184, "query_module" },
273  { 185, "setpgid" }, // 32 bit
274  { 186, "fremovexattr" }, // 32 bit
275  { 187, "tkill" }, // 32 bit
276  { 188, "exit_group", exitGroupFunc }, // 32 bit
277  { 189, "uname", unameFunc },
278  { 190, "init_module" }, // 32 bit
279  { 191, "personality" },
280  { 192, "remap_file_pages" },
281  { 193, "epoll_create" }, // 32 bit
282  { 194, "epoll_ctl" }, // 32 bit
283  { 195, "epoll_wait" }, // 32 bit
284  { 196, "ioprio_set" }, // 32 bit
285  { 197, "getppid", getppidFunc },
286  { 198, "sigaction" }, // 32 bit
287  { 199, "sgetmask" },
288  { 200, "ssetmask" },
289  { 201, "sigsuspend" },
290  { 202, "oldlstat" },
291  { 203, "uselib" },
292  { 204, "readdir" },
293  { 205, "readahead" }, // 32 bit
294  { 206, "socketcall" }, // 32 bit
295  { 207, "syslog" }, // 32 bit
296  { 208, "lookup_dcookie" }, // 32 bit
297  { 209, "fadvise64" }, // 32 bit
298  { 210, "fadvise64_64" }, // 32 bit
299  { 211, "tgkill" }, // 32 bit
300  { 212, "waitpid" }, // 32 bit
301  { 213, "swapoff" },
302  { 214, "sysinfo", sysinfoFunc<Sparc32Linux> }, // 32 bit
303  { 215, "ipc" }, // 32 bit
304  { 216, "sigreturn" }, // 32 bit
305  { 217, "clone", cloneFunc<Sparc32Linux> },
306  { 218, "ioprio_get" }, // 32 bit
307  { 219, "adjtimex" }, // 32 bit
308  { 220, "sigprocmask" }, // 32 bit
309  { 221, "create_module" },
310  { 222, "delete_module" }, // 32 bit
311  { 223, "get_kernel_syms" },
312  { 224, "getpgid" }, // 32 bit
313  { 225, "bdflush" }, // 32 bit
314  { 226, "sysfs" }, // 32 bit
315  { 227, "afs_syscall" },
316  { 228, "setfsuid" }, // 32 bit
317  { 229, "setfsgid" }, // 32 bit
318  { 230, "_newselect" }, // 32 bit
319  { 231, "time", ignoreFunc },
320  { 232, "oldstat" },
321  { 233, "stime" },
322  { 234, "statfs64" },
323  { 235, "fstatfs64" },
324  { 236, "_llseek", _llseekFunc },
325  { 237, "mlock" },
326  { 238, "munlock" },
327  { 239, "mlockall" }, // 32 bit
328  { 240, "munlockall" },
329  { 241, "sched_setparam" }, // 32 bit
330  { 242, "sched_getparam" }, // 32 bit
331  { 243, "sched_setscheduler" }, // 32 bit
332  { 244, "sched_getscheduler" }, // 32 bit
333  { 245, "sched_yield" },
334  { 246, "sched_get_priority_max" }, // 32 bit
335  { 247, "sched_get_priority_min" }, // 32 bit
336  { 248, "sched_rr_get_interval" }, // 32 bit
337  { 249, "nanosleep" },
338  { 250, "mremap", mremapFunc<Sparc32Linux> }, // 32 bit
339  { 251, "_sysctl" }, // 32 bit
340  { 252, "getsid" }, // 32 bit
341  { 253, "fdatasync" },
342  { 254, "nfsservctl" }, // 32 bit
343  { 255, "aplib" },
344  { 256, "clock_settime" },
345  { 257, "clock_gettime" },
346  { 258, "clock_getres" },
347  { 259, "clock_nanosleep" }, // 32 bit
348  { 260, "sched_getaffinity" },
349  { 261, "sched_setaffinity" },
350  { 262, "timer_settime" }, // 32 bit
351  { 263, "timer_gettime" },
352  { 264, "timer_getoverrun" },
353  { 265, "timer_delete" },
354  { 266, "timer_create" },
355  { 267, "vserver" },
356  { 268, "io_setup" },
357  { 269, "io_destroy" },
358  { 270, "io_submit" }, // 32 bit
359  { 271, "io_cancel" },
360  { 272, "io_getevents" },
361  { 273, "mq_open" }, // 32 bit
362  { 274, "mq_unlink" },
363  { 275, "mq_timedsend" },
364  { 276, "mq_timedreceive" },
365  { 277, "mq_notify" },
366  { 278, "mq_getsetattr" },
367  { 279, "waitid" },
368  { 280, "sys_setaltroot" },
369  { 281, "add_key" },
370  { 282, "request_key" },
371  { 283, "keyctl" },
372  { 284, "openat" },
373  { 285, "mkdirat" },
374  { 286, "mknodat" },
375  { 287, "fchownat" },
376  { 288, "futimesat" },
377  { 289, "fstatat64" },
378  { 290, "unlinkat" },
379  { 291, "renameat" },
380  { 292, "linkat" },
381  { 293, "symlinkat" },
382  { 294, "readlinkat" },
383  { 295, "fchmodat" },
384  { 296, "faccessat" },
385  { 297, "pselect6" },
386  { 298, "ppoll" },
387  { 299, "unshare" }
388 };
389 
390 SyscallDescTable<SEWorkload::SyscallABI64> EmuLinux::syscallDescs = {
391  { 0, "restart_syscall" },
392  { 1, "exit", exitFunc },
393  { 2, "fork" },
394  { 3, "read", readFunc<SparcLinux> },
395  { 4, "write", writeFunc<SparcLinux> },
396  { 5, "open", openFunc<SparcLinux> },
397  { 6, "close", closeFunc },
398  { 7, "wait4" },
399  { 8, "creat" },
400  { 9, "link" },
401  { 10, "unlink", unlinkFunc },
402  { 11, "execv" },
403  { 12, "chdir" },
404  { 13, "chown", chownFunc },
405  { 14, "mknod" },
406  { 15, "chmod", chmodFunc<Linux> },
407  { 16, "lchown" },
408  { 17, "brk", brkFunc },
409  { 18, "perfctr" },
410  { 19, "lseek", lseekFunc },
411  { 20, "getpid", getpidFunc },
412  { 21, "capget" },
413  { 22, "capset" },
414  { 23, "setuid", ignoreFunc },
415  { 24, "getuid", getuidFunc },
416  { 25, "time" },
417  { 26, "ptrace" },
418  { 27, "alarm" },
419  { 28, "sigaltstack" },
420  { 29, "pause" },
421  { 30, "utime" },
422  { 31, "lchown32" },
423  { 32, "fchown32" },
424  { 33, "access" },
425  { 34, "nice" },
426  { 35, "chown32" },
427  { 36, "sync" },
428  { 37, "kill" },
429  { 38, "stat" },
430  { 39, "sendfile" },
431  { 40, "lstat" },
432  { 41, "dup" },
433  { 42, "pipe", pipePseudoFunc },
434  { 43, "times", ignoreFunc },
435  { 44, "getuid32" },
436  { 45, "umount2" },
437  { 46, "setgid" },
438  { 47, "getgid", getgidFunc },
439  { 48, "signal" },
440  { 49, "geteuid", geteuidFunc },
441  { 50, "getegid", getegidFunc },
442  { 51, "acct" },
443  { 52, "memory_ordering" },
444  { 53, "getgid32" },
445  { 54, "ioctl" },
446  { 55, "reboot" },
447  { 56, "mmap2" },
448  { 57, "symlink" },
449  { 58, "readlink", readlinkFunc<SparcLinux> },
450  { 59, "execve" },
451  { 60, "umask" },
452  { 61, "chroot" },
453  { 62, "fstat", fstatFunc<SparcLinux> },
454  { 63, "fstat64", fstat64Func<SparcLinux> },
455  { 64, "getpagesize" },
456  { 65, "msync" },
457  { 66, "vfork" },
458  { 67, "pread64" },
459  { 68, "pwrite64" },
460  { 69, "geteuid32" },
461  { 70, "getegid32" },
462  { 71, "mmap", mmapFunc<SparcLinux> },
463  { 72, "setreuid32" },
464  { 73, "munmap", munmapFunc<SparcLinux> },
465  { 74, "mprotect", ignoreFunc },
466  { 75, "madvise" },
467  { 76, "vhangup" },
468  { 77, "truncate64" },
469  { 78, "mincore" },
470  { 79, "getgroups" },
471  { 80, "setgroups" },
472  { 81, "getpgrp" },
473  { 82, "setgroups32" },
474  { 83, "setitimer" },
475  { 84, "ftruncate64" },
476  { 85, "swapon" },
477  { 86, "getitimer" },
478  { 87, "setuid32" },
479  { 88, "sethostname" },
480  { 89, "setgid32" },
481  { 90, "dup2" },
482  { 91, "setfsuid32" },
483  { 92, "fcntl" },
484  { 93, "select" },
485  { 94, "setfsgid32" },
486  { 95, "fsync" },
487  { 96, "setpriority" },
488  { 97, "socket" },
489  { 98, "connect" },
490  { 99, "accept" },
491  { 100, "getpriority" },
492  { 101, "rt_sigreturn" },
493  { 102, "rt_sigaction", ignoreFunc },
494  { 103, "rt_sigprocmask", ignoreFunc },
495  { 104, "rt_sigpending" },
496  { 105, "rt_sigtimedwait" },
497  { 106, "rt_sigqueueinfo" },
498  { 107, "rt_sigsuspend" },
499  { 108, "setresuid" },
500  { 109, "getresuid", getresuidFunc },
501  { 110, "setresgid", ignoreFunc },
502  { 111, "getresgid" },
503  { 112, "setregid32" },
504  { 113, "recvmsg" },
505  { 114, "sendmsg" },
506  { 115, "getgroups32" },
507  { 116, "gettimeofday", gettimeofdayFunc<SparcLinux> },
508  { 117, "getrusage" },
509  { 118, "getsockopt" },
510  { 119, "getcwd" },
511  { 120, "readv" },
512  { 121, "writev" },
513  { 122, "settimeofday" },
514  { 123, "fchown" },
515  { 124, "fchmod" },
516  { 125, "recvfrom" },
517  { 126, "setreuid" },
518  { 127, "setregid" },
519  { 128, "rename", renameFunc },
520  { 129, "truncate" },
521  { 130, "ftruncate" },
522  { 131, "flock" },
523  { 132, "lstat64" },
524  { 133, "sendto" },
525  { 134, "shutdown" },
526  { 135, "socketpair" },
527  { 136, "mkdir", mkdirFunc },
528  { 137, "rmdir" },
529  { 138, "utimes" },
530  { 139, "stat64" },
531  { 140, "sendfile64" },
532  { 141, "getpeername" },
533  { 142, "futex" },
534  { 143, "gettid" },
535  { 144, "getrlimit" },
536  { 145, "setrlimit" },
537  { 146, "pivot_root" },
538  { 147, "prctl" },
539  { 148, "pciconfig_read" },
540  { 149, "pciconfig_write" },
541  { 150, "getsockname" },
542  { 151, "inotify_init" },
543  { 152, "inotify_add_watch" },
544  { 153, "poll" },
545  { 154, "getdents64" },
546  { 155, "fcntl64" },
547  { 156, "inotify_rm_watch" },
548  { 157, "statfs" },
549  { 158, "fstatfs" },
550  { 159, "umount" },
551  { 160, "sched_set_affinity" },
552  { 161, "sched_get_affinity" },
553  { 162, "getdomainname" },
554  { 163, "setdomainname" },
555  { 164, "utrap_install" },
556  { 165, "quotactl" },
557  { 166, "set_tid_address" },
558  { 167, "mount" },
559  { 168, "ustat" },
560  { 169, "setxattr" },
561  { 170, "lsetxattr" },
562  { 171, "fsetxattr" },
563  { 172, "getxattr" },
564  { 173, "lgetxattr" },
565  { 174, "getdents" },
566  { 175, "setsid" },
567  { 176, "fchdir" },
568  { 177, "fgetxattr" },
569  { 178, "listxattr" },
570  { 179, "llistxattr" },
571  { 180, "flistxattr" },
572  { 181, "removexattr" },
573  { 182, "lremovexattr" },
574  { 183, "sigpending" },
575  { 184, "query_module" },
576  { 185, "setpgid" },
577  { 186, "fremovexattr" },
578  { 187, "tkill" },
579  { 188, "exit_group", exitGroupFunc },
580  { 189, "uname", unameFunc },
581  { 190, "init_module" },
582  { 191, "personality" },
583  { 192, "remap_file_pages" },
584  { 193, "epoll_create" },
585  { 194, "epoll_ctl" },
586  { 195, "epoll_wait" },
587  { 196, "ioprio_set" },
588  { 197, "getppid", getppidFunc },
589  { 198, "sigaction", ignoreFunc },
590  { 199, "sgetmask" },
591  { 200, "ssetmask" },
592  { 201, "sigsuspend" },
593  { 202, "oldlstat" },
594  { 203, "uselib" },
595  { 204, "readdir" },
596  { 205, "readahead" },
597  { 206, "socketcall" },
598  { 207, "syslog" },
599  { 208, "lookup_dcookie" },
600  { 209, "fadvise64" },
601  { 210, "fadvise64_64" },
602  { 211, "tgkill" },
603  { 212, "waitpid" },
604  { 213, "swapoff" },
605  { 214, "sysinfo", sysinfoFunc<SparcLinux> },
606  { 215, "ipc" },
607  { 216, "sigreturn" },
608  { 217, "clone", cloneFunc<SparcLinux> },
609  { 218, "ioprio_get" },
610  { 219, "adjtimex" },
611  { 220, "sigprocmask" },
612  { 221, "create_module" },
613  { 222, "delete_module" },
614  { 223, "get_kernel_syms" },
615  { 224, "getpgid" },
616  { 225, "bdflush" },
617  { 226, "sysfs" },
618  { 227, "afs_syscall" },
619  { 228, "setfsuid" },
620  { 229, "setfsgid" },
621  { 230, "_newselect" },
622  { 231, "time", ignoreFunc },
623  { 232, "oldstat" },
624  { 233, "stime" },
625  { 234, "statfs64" },
626  { 235, "fstatfs64" },
627  { 236, "_llseek", _llseekFunc },
628  { 237, "mlock" },
629  { 238, "munlock" },
630  { 239, "mlockall" },
631  { 240, "munlockall" },
632  { 241, "sched_setparam" },
633  { 242, "sched_getparam" },
634  { 243, "sched_setscheduler" },
635  { 244, "sched_getscheduler" },
636  { 245, "sched_yield" },
637  { 246, "sched_get_priority_max" },
638  { 247, "sched_get_priority_min" },
639  { 248, "sched_rr_get_interval" },
640  { 249, "nanosleep" },
641  { 250, "mremap", mremapFunc<SparcLinux> },
642  { 251, "_sysctl" },
643  { 252, "getsid" },
644  { 253, "fdatasync" },
645  { 254, "nfsservctl" },
646  { 255, "aplib" },
647  { 256, "clock_settime" },
648  { 257, "clock_gettime" },
649  { 258, "clock_getres" },
650  { 259, "clock_nanosleep" },
651  { 260, "sched_getaffinity" },
652  { 261, "sched_setaffinity" },
653  { 262, "timer_settime" },
654  { 263, "timer_gettime" },
655  { 264, "timer_getoverrun" },
656  { 265, "timer_delete" },
657  { 266, "timer_create" },
658  { 267, "vserver" },
659  { 268, "io_setup" },
660  { 269, "io_destroy" },
661  { 270, "io_submit" },
662  { 271, "io_cancel" },
663  { 272, "io_getevents" },
664  { 273, "mq_open" },
665  { 274, "mq_unlink" },
666  { 275, "mq_timedsend" },
667  { 276, "mq_timedreceive" },
668  { 277, "mq_notify" },
669  { 278, "mq_getsetattr" },
670  { 279, "waitid" },
671  { 280, "sys_setaltroot" },
672  { 281, "add_key" },
673  { 282, "request_key" },
674  { 283, "keyctl" }
675 };
676 
677 } // namespace SparcISA
678 } // namespace gem5
bool copyOut(const PortProxy &memproxy)
copy data out of simulator space (write to target memory)
BufferArg represents an untyped buffer in target user space that is passed by reference to an (emulat...
void * bufferPtr()
Return a pointer to the internal simulator-space buffer.
static SyscallDescTable< SEWorkload::SyscallABI64 > syscallDescs
64 bit syscall descriptors, indexed by call number.
Definition: se_workload.hh:47
static SyscallDescTable< SEWorkload::SyscallABI32 > syscall32Descs
32 bit compatibility syscall descriptors, indexed by call number.
Definition: se_workload.hh:50
This class provides the wrapper interface for the system call implementations which are defined in th...
Definition: syscall_desc.hh:70
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 Process * getProcessPtr()=0
static SyscallReturn getresuidFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> ruid, VPtr<> euid, VPtr<> suid)
Definition: syscalls.cc:60
static SyscallReturn unameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< Linux::utsname > name)
Target uname() handler.
Definition: syscalls.cc:45
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
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 brkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> new_brk)
Target brk() handler: set brk address.
SyscallReturn getpidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getpid() handler.
SyscallReturn getuidFunc(SyscallDesc *desc, ThreadContext *tc)
SyscallReturn pipePseudoFunc(SyscallDesc *desc, ThreadContext *tc)
Pseudo Funcs - These functions use a different return convension, returning a second value in a regis...
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 _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 geteuidFunc(SyscallDesc *desc, ThreadContext *tc)
Target geteuid() handler.
SyscallReturn getcwdFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> buf_ptr, unsigned long size)
Target getcwd() handler.
SyscallReturn unlinkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
Target unlink() handler.
SyscallReturn mkdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname, mode_t mode)
Target mkdir() handler.
T htobe(T value)
Definition: byteswap.hh:174
SyscallReturn getegidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getegid() handler.
SyscallReturn lseekFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint64_t offs, int whence)
Target lseek() handler.
SyscallReturn ignoreFunc(SyscallDesc *desc, ThreadContext *tc)
Handler for unimplemented syscalls that we never intend to implement (signal handling,...
Definition: syscall_emul.cc:72
SyscallReturn exitFunc(SyscallDesc *desc, ThreadContext *tc, int status)
Target exit() handler: terminate current context.
SyscallReturn getgidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getgid() handler.
SyscallReturn closeFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd)
Target close() handler.
This file defines objects used to emulate syscalls from the target application on the host machine.
const std::string & name()
Definition: trace.cc:49

Generated on Wed Dec 21 2022 10:22:27 for gem5 by doxygen 1.9.1