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

Generated on Mon Jan 13 2025 04:28:28 for gem5 by doxygen 1.9.8