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");
75 const uint64_t
id =
htobe(100);
79 BufferArg ruidBuff(ruid,
sizeof(uint64_t));
80 memcpy(ruidBuff.
bufferPtr(), &
id,
sizeof(uint64_t));
85 BufferArg euidBuff(euid,
sizeof(uint64_t));
86 memcpy(euidBuff.
bufferPtr(), &
id,
sizeof(uint64_t));
91 BufferArg suidBuff(suid,
sizeof(uint64_t));
92 memcpy(suidBuff.
bufferPtr(), &
id,
sizeof(uint64_t));
99 { 0,
"restart_syscall" },
102 { 3,
"read", readFunc<Sparc32Linux> },
103 { 4,
"write", writeFunc<Sparc32Linux> },
104 { 5,
"open", openFunc<Sparc32Linux> },
118 { 19,
"lseek", lseekFunc<Sparc32Linux> },
127 { 28,
"sigaltstack" },
151 { 52,
"memory_ordering" },
157 { 58,
"readlink", readlinkFunc<Sparc32Linux> },
162 { 63,
"fstat64", fstat64Func<Sparc32Linux> },
163 { 64,
"getpagesize" },
170 { 71,
"mmap", mmapFunc<Sparc32Linux> },
171 { 72,
"setreuid32" },
172 { 73,
"munmap", munmapFunc<Sparc32Linux> },
176 { 77,
"truncate64" },
181 { 82,
"setgroups32" },
183 { 84,
"ftruncate64" },
187 { 88,
"sethostname" },
190 { 91,
"setfsuid32" },
193 { 94,
"setfsgid32" },
195 { 96,
"setpriority" },
199 { 100,
"getpriority" },
200 { 101,
"rt_sigreturn" },
203 { 104,
"rt_sigpending" },
204 { 105,
"rt_sigtimedwait" },
205 { 106,
"rt_sigqueueinfo" },
206 { 107,
"rt_sigsuspend" },
207 { 108,
"setresuid32" },
210 { 111,
"getresgid32" },
211 { 112,
"setregid32" },
214 { 115,
"getgroups32" },
215 { 116,
"gettimeofday", gettimeofdayFunc<Sparc32Linux> },
216 { 117,
"getrusage" },
217 { 118,
"getsockopt" },
218 { 119,
"getcwd", getcwdFunc<Sparc32Linux> },
221 { 122,
"settimeofday" },
229 { 130,
"ftruncate" },
234 { 135,
"socketpair" },
239 { 140,
"sendfile64" },
240 { 141,
"getpeername" },
243 { 144,
"getrlimit" },
244 { 145,
"setrlimit" },
245 { 146,
"pivot_root" },
247 { 148,
"pciconfig_read" },
248 { 149,
"pciconfig_write" },
249 { 150,
"getsockname" },
250 { 151,
"inotify_init" },
251 { 152,
"inotify_add_watch" },
253 { 154,
"getdents64" },
255 { 156,
"inotify_rm_watch" },
259 { 160,
"sched_setaffinity" },
260 { 161,
"sched_getaffinity" },
261 { 162,
"getdomainname" },
262 { 163,
"setdomainname" },
263 { 164,
"ni_syscall" },
265 { 166,
"set_tid_address" },
269 { 170,
"lsetxattr" },
270 { 171,
"fsetxattr" },
272 { 173,
"lgetxattr" },
276 { 177,
"fgetxattr" },
277 { 178,
"listxattr" },
278 { 179,
"llistxattr" },
279 { 180,
"flistxattr" },
280 { 181,
"removexattr" },
281 { 182,
"lremovexattr" },
282 { 183,
"sigpending" },
283 { 184,
"query_module" },
285 { 186,
"fremovexattr" },
289 { 190,
"init_module" },
290 { 191,
"personality" },
291 { 192,
"remap_file_pages" },
292 { 193,
"epoll_create" },
293 { 194,
"epoll_ctl" },
294 { 195,
"epoll_wait" },
295 { 196,
"ioprio_set" },
297 { 198,
"sigaction" },
300 { 201,
"sigsuspend" },
304 { 205,
"readahead" },
305 { 206,
"socketcall" },
307 { 208,
"lookup_dcookie" },
308 { 209,
"fadvise64" },
309 { 210,
"fadvise64_64" },
313 { 214,
"sysinfo", sysinfoFunc<Sparc32Linux> },
315 { 216,
"sigreturn" },
316 { 217,
"clone", cloneFunc<Sparc32Linux> },
317 { 218,
"ioprio_get" },
319 { 220,
"sigprocmask" },
320 { 221,
"create_module" },
321 { 222,
"delete_module" },
322 { 223,
"get_kernel_syms" },
326 { 227,
"afs_syscall" },
329 { 230,
"_newselect" },
334 { 235,
"fstatfs64" },
339 { 240,
"munlockall" },
340 { 241,
"sched_setparam" },
341 { 242,
"sched_getparam" },
342 { 243,
"sched_setscheduler" },
343 { 244,
"sched_getscheduler" },
344 { 245,
"sched_yield" },
345 { 246,
"sched_get_priority_max" },
346 { 247,
"sched_get_priority_min" },
347 { 248,
"sched_rr_get_interval" },
348 { 249,
"nanosleep" },
349 { 250,
"mremap", mremapFunc<Sparc32Linux> },
352 { 253,
"fdatasync" },
353 { 254,
"nfsservctl" },
355 { 256,
"clock_settime" },
356 { 257,
"clock_gettime" },
357 { 258,
"clock_getres" },
358 { 259,
"clock_nanosleep" },
359 { 260,
"sched_getaffinity" },
360 { 261,
"sched_setaffinity" },
361 { 262,
"timer_settime" },
362 { 263,
"timer_gettime" },
363 { 264,
"timer_getoverrun" },
364 { 265,
"timer_delete" },
365 { 266,
"timer_create" },
368 { 269,
"io_destroy" },
369 { 270,
"io_submit" },
370 { 271,
"io_cancel" },
371 { 272,
"io_getevents" },
373 { 274,
"mq_unlink" },
374 { 275,
"mq_timedsend" },
375 { 276,
"mq_timedreceive" },
376 { 277,
"mq_notify" },
377 { 278,
"mq_getsetattr" },
379 { 280,
"sys_setaltroot" },
381 { 282,
"request_key" },
387 { 288,
"futimesat" },
388 { 289,
"fstatat64" },
392 { 293,
"symlinkat" },
393 { 294,
"readlinkat" },
395 { 296,
"faccessat" },
402 { 0,
"restart_syscall" },
405 { 3,
"read", readFunc<SparcLinux> },
406 { 4,
"write", writeFunc<SparcLinux> },
407 { 5,
"open", openFunc<SparcLinux> },
417 { 15,
"chmod", chmodFunc<Linux> },
421 { 19,
"lseek", lseekFunc<SparcLinux> },
430 { 28,
"sigaltstack" },
454 { 52,
"memory_ordering" },
460 { 58,
"readlink", readlinkFunc<SparcLinux> },
464 { 62,
"fstat", fstatFunc<SparcLinux> },
465 { 63,
"fstat64", fstat64Func<SparcLinux> },
466 { 64,
"getpagesize" },
473 { 71,
"mmap", mmapFunc<SparcLinux> },
474 { 72,
"setreuid32" },
475 { 73,
"munmap", munmapFunc<SparcLinux> },
479 { 77,
"truncate64" },
484 { 82,
"setgroups32" },
486 { 84,
"ftruncate64" },
490 { 88,
"sethostname" },
493 { 91,
"setfsuid32" },
496 { 94,
"setfsgid32" },
498 { 96,
"setpriority" },
502 { 100,
"getpriority" },
503 { 101,
"rt_sigreturn" },
506 { 104,
"rt_sigpending" },
507 { 105,
"rt_sigtimedwait" },
508 { 106,
"rt_sigqueueinfo" },
509 { 107,
"rt_sigsuspend" },
510 { 108,
"setresuid" },
513 { 111,
"getresgid" },
514 { 112,
"setregid32" },
517 { 115,
"getgroups32" },
518 { 116,
"gettimeofday", gettimeofdayFunc<SparcLinux> },
519 { 117,
"getrusage" },
520 { 118,
"getsockopt" },
524 { 122,
"settimeofday" },
532 { 130,
"ftruncate" },
537 { 135,
"socketpair" },
542 { 140,
"sendfile64" },
543 { 141,
"getpeername" },
546 { 144,
"getrlimit" },
547 { 145,
"setrlimit" },
548 { 146,
"pivot_root" },
550 { 148,
"pciconfig_read" },
551 { 149,
"pciconfig_write" },
552 { 150,
"getsockname" },
553 { 151,
"inotify_init" },
554 { 152,
"inotify_add_watch" },
556 { 154,
"getdents64" },
558 { 156,
"inotify_rm_watch" },
562 { 160,
"sched_set_affinity" },
563 { 161,
"sched_get_affinity" },
564 { 162,
"getdomainname" },
565 { 163,
"setdomainname" },
566 { 164,
"utrap_install" },
568 { 166,
"set_tid_address" },
572 { 170,
"lsetxattr" },
573 { 171,
"fsetxattr" },
575 { 173,
"lgetxattr" },
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" },
588 { 186,
"fremovexattr" },
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" },
603 { 201,
"sigsuspend" },
607 { 205,
"readahead" },
608 { 206,
"socketcall" },
610 { 208,
"lookup_dcookie" },
611 { 209,
"fadvise64" },
612 { 210,
"fadvise64_64" },
616 { 214,
"sysinfo", sysinfoFunc<SparcLinux> },
618 { 216,
"sigreturn" },
619 { 217,
"clone", cloneFunc<SparcLinux> },
620 { 218,
"ioprio_get" },
622 { 220,
"sigprocmask" },
623 { 221,
"create_module" },
624 { 222,
"delete_module" },
625 { 223,
"get_kernel_syms" },
629 { 227,
"afs_syscall" },
632 { 230,
"_newselect" },
637 { 235,
"fstatfs64" },
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> },
655 { 253,
"fdatasync" },
656 { 254,
"nfsservctl" },
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" },
671 { 269,
"io_destroy" },
672 { 270,
"io_submit" },
673 { 271,
"io_cancel" },
674 { 272,
"io_getevents" },
676 { 274,
"mq_unlink" },
677 { 275,
"mq_timedsend" },
678 { 276,
"mq_timedreceive" },
679 { 277,
"mq_notify" },
680 { 278,
"mq_getsetattr" },
682 { 280,
"sys_setaltroot" },
684 { 282,
"request_key" },
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)
static SyscallReturn unameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< Linux::utsname > name)
Target uname() handler.
Copyright (c) 2024 Arm Limited All rights reserved.
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.
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()