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

Generated on Fri Feb 28 2020 16:26:58 for gem5 by doxygen 1.8.13