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

Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17