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