46 strcpy(name->
nodename,
"sim.gem5.org");
47 strcpy(name->
release, process->release.c_str());
48 strcpy(name->
version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
61 const uint64_t
id =
htobe(100);
65 BufferArg ruidBuff(ruid,
sizeof(uint64_t));
66 memcpy(ruidBuff.
bufferPtr(), &
id,
sizeof(uint64_t));
71 BufferArg euidBuff(euid,
sizeof(uint64_t));
72 memcpy(euidBuff.
bufferPtr(), &
id,
sizeof(uint64_t));
77 BufferArg suidBuff(suid,
sizeof(uint64_t));
78 memcpy(suidBuff.
bufferPtr(), &
id,
sizeof(uint64_t));
86 { 0,
"restart_syscall" },
89 { 3,
"read", readFunc<Sparc32Linux> },
90 { 4,
"write", writeFunc<Sparc32Linux> },
91 { 5,
"open", openFunc<Sparc32Linux> },
114 { 28,
"sigaltstack" },
138 { 52,
"memory_ordering" },
149 { 63,
"fstat64", fstat64Func<Sparc32Linux> },
150 { 64,
"getpagesize" },
157 { 71,
"mmap", mmapFunc<Sparc32Linux> },
158 { 72,
"setreuid32" },
163 { 77,
"truncate64" },
168 { 82,
"setgroups32" },
170 { 84,
"ftruncate64" },
174 { 88,
"sethostname" },
177 { 91,
"setfsuid32" },
180 { 94,
"setfsgid32" },
182 { 96,
"setpriority" },
186 { 100,
"getpriority" },
187 { 101,
"rt_sigreturn" },
190 { 104,
"rt_sigpending" },
191 { 105,
"rt_sigtimedwait" },
192 { 106,
"rt_sigqueueinfo" },
193 { 107,
"rt_sigsuspend" },
194 { 108,
"setresuid32" },
197 { 111,
"getresgid32" },
198 { 112,
"setregid32" },
201 { 115,
"getgroups32" },
202 { 116,
"gettimeofday", gettimeofdayFunc<Sparc32Linux> },
203 { 117,
"getrusage" },
204 { 118,
"getsockopt" },
208 { 122,
"settimeofday" },
216 { 130,
"ftruncate" },
221 { 135,
"socketpair" },
226 { 140,
"sendfile64" },
227 { 141,
"getpeername" },
230 { 144,
"getrlimit" },
231 { 145,
"setrlimit" },
232 { 146,
"pivot_root" },
234 { 148,
"pciconfig_read" },
235 { 149,
"pciconfig_write" },
236 { 150,
"getsockname" },
237 { 151,
"inotify_init" },
238 { 152,
"inotify_add_watch" },
240 { 154,
"getdents64" },
242 { 156,
"inotify_rm_watch" },
246 { 160,
"sched_setaffinity" },
247 { 161,
"sched_getaffinity" },
248 { 162,
"getdomainname" },
249 { 163,
"setdomainname" },
250 { 164,
"ni_syscall" },
252 { 166,
"set_tid_address" },
256 { 170,
"lsetxattr" },
257 { 171,
"fsetxattr" },
259 { 173,
"lgetxattr" },
263 { 177,
"fgetxattr" },
264 { 178,
"listxattr" },
265 { 179,
"llistxattr" },
266 { 180,
"flistxattr" },
267 { 181,
"removexattr" },
268 { 182,
"lremovexattr" },
269 { 183,
"sigpending" },
270 { 184,
"query_module" },
272 { 186,
"fremovexattr" },
276 { 190,
"init_module" },
277 { 191,
"personality" },
278 { 192,
"remap_file_pages" },
279 { 193,
"epoll_create" },
280 { 194,
"epoll_ctl" },
281 { 195,
"epoll_wait" },
282 { 196,
"ioprio_set" },
284 { 198,
"sigaction" },
287 { 201,
"sigsuspend" },
291 { 205,
"readahead" },
292 { 206,
"socketcall" },
294 { 208,
"lookup_dcookie" },
295 { 209,
"fadvise64" },
296 { 210,
"fadvise64_64" },
300 { 214,
"sysinfo", sysinfoFunc<Sparc32Linux> },
302 { 216,
"sigreturn" },
303 { 217,
"clone", cloneFunc<Sparc32Linux> },
304 { 218,
"ioprio_get" },
306 { 220,
"sigprocmask" },
307 { 221,
"create_module" },
308 { 222,
"delete_module" },
309 { 223,
"get_kernel_syms" },
313 { 227,
"afs_syscall" },
316 { 230,
"_newselect" },
321 { 235,
"fstatfs64" },
326 { 240,
"munlockall" },
327 { 241,
"sched_setparam" },
328 { 242,
"sched_getparam" },
329 { 243,
"sched_setscheduler" },
330 { 244,
"sched_getscheduler" },
331 { 245,
"sched_yield" },
332 { 246,
"sched_get_priority_max" },
333 { 247,
"sched_get_priority_min" },
334 { 248,
"sched_rr_get_interval" },
335 { 249,
"nanosleep" },
336 { 250,
"mremap", mremapFunc<Sparc32Linux> },
339 { 253,
"fdatasync" },
340 { 254,
"nfsservctl" },
342 { 256,
"clock_settime" },
343 { 257,
"clock_gettime" },
344 { 258,
"clock_getres" },
345 { 259,
"clock_nanosleep" },
346 { 260,
"sched_getaffinity" },
347 { 261,
"sched_setaffinity" },
348 { 262,
"timer_settime" },
349 { 263,
"timer_gettime" },
350 { 264,
"timer_getoverrun" },
351 { 265,
"timer_delete" },
352 { 266,
"timer_create" },
355 { 269,
"io_destroy" },
356 { 270,
"io_submit" },
357 { 271,
"io_cancel" },
358 { 272,
"io_getevents" },
360 { 274,
"mq_unlink" },
361 { 275,
"mq_timedsend" },
362 { 276,
"mq_timedreceive" },
363 { 277,
"mq_notify" },
364 { 278,
"mq_getsetattr" },
366 { 280,
"sys_setaltroot" },
368 { 282,
"request_key" },
374 { 288,
"futimesat" },
375 { 289,
"fstatat64" },
379 { 293,
"symlinkat" },
380 { 294,
"readlinkat" },
382 { 296,
"faccessat" },
390 { 0,
"restart_syscall" },
393 { 3,
"read", readFunc<SparcLinux> },
394 { 4,
"write", writeFunc<SparcLinux> },
395 { 5,
"open", openFunc<SparcLinux> },
405 { 15,
"chmod", chmodFunc<Linux> },
418 { 28,
"sigaltstack" },
442 { 52,
"memory_ordering" },
452 { 62,
"fstat", fstatFunc<SparcLinux> },
453 { 63,
"fstat64", fstat64Func<SparcLinux> },
454 { 64,
"getpagesize" },
461 { 71,
"mmap", mmapFunc<SparcLinux> },
462 { 72,
"setreuid32" },
467 { 77,
"truncate64" },
472 { 82,
"setgroups32" },
474 { 84,
"ftruncate64" },
478 { 88,
"sethostname" },
481 { 91,
"setfsuid32" },
484 { 94,
"setfsgid32" },
486 { 96,
"setpriority" },
490 { 100,
"getpriority" },
491 { 101,
"rt_sigreturn" },
494 { 104,
"rt_sigpending" },
495 { 105,
"rt_sigtimedwait" },
496 { 106,
"rt_sigqueueinfo" },
497 { 107,
"rt_sigsuspend" },
498 { 108,
"setresuid" },
501 { 111,
"getresgid" },
502 { 112,
"setregid32" },
505 { 115,
"getgroups32" },
506 { 116,
"gettimeofday", gettimeofdayFunc<SparcLinux> },
507 { 117,
"getrusage" },
508 { 118,
"getsockopt" },
512 { 122,
"settimeofday" },
520 { 130,
"ftruncate" },
525 { 135,
"socketpair" },
530 { 140,
"sendfile64" },
531 { 141,
"getpeername" },
534 { 144,
"getrlimit" },
535 { 145,
"setrlimit" },
536 { 146,
"pivot_root" },
538 { 148,
"pciconfig_read" },
539 { 149,
"pciconfig_write" },
540 { 150,
"getsockname" },
541 { 151,
"inotify_init" },
542 { 152,
"inotify_add_watch" },
544 { 154,
"getdents64" },
546 { 156,
"inotify_rm_watch" },
550 { 160,
"sched_set_affinity" },
551 { 161,
"sched_get_affinity" },
552 { 162,
"getdomainname" },
553 { 163,
"setdomainname" },
554 { 164,
"utrap_install" },
556 { 166,
"set_tid_address" },
560 { 170,
"lsetxattr" },
561 { 171,
"fsetxattr" },
563 { 173,
"lgetxattr" },
567 { 177,
"fgetxattr" },
568 { 178,
"listxattr" },
569 { 179,
"llistxattr" },
570 { 180,
"flistxattr" },
571 { 181,
"removexattr" },
572 { 182,
"lremovexattr" },
573 { 183,
"sigpending" },
574 { 184,
"query_module" },
576 { 186,
"fremovexattr" },
580 { 190,
"init_module" },
581 { 191,
"personality" },
582 { 192,
"remap_file_pages" },
583 { 193,
"epoll_create" },
584 { 194,
"epoll_ctl" },
585 { 195,
"epoll_wait" },
586 { 196,
"ioprio_set" },
591 { 201,
"sigsuspend" },
595 { 205,
"readahead" },
596 { 206,
"socketcall" },
598 { 208,
"lookup_dcookie" },
599 { 209,
"fadvise64" },
600 { 210,
"fadvise64_64" },
604 { 214,
"sysinfo", sysinfoFunc<SparcLinux> },
606 { 216,
"sigreturn" },
607 { 217,
"clone", cloneFunc<SparcLinux> },
608 { 218,
"ioprio_get" },
610 { 220,
"sigprocmask" },
611 { 221,
"create_module" },
612 { 222,
"delete_module" },
613 { 223,
"get_kernel_syms" },
617 { 227,
"afs_syscall" },
620 { 230,
"_newselect" },
625 { 235,
"fstatfs64" },
630 { 240,
"munlockall" },
631 { 241,
"sched_setparam" },
632 { 242,
"sched_getparam" },
633 { 243,
"sched_setscheduler" },
634 { 244,
"sched_getscheduler" },
635 { 245,
"sched_yield" },
636 { 246,
"sched_get_priority_max" },
637 { 247,
"sched_get_priority_min" },
638 { 248,
"sched_rr_get_interval" },
639 { 249,
"nanosleep" },
640 { 250,
"mremap", mremapFunc<SparcLinux> },
643 { 253,
"fdatasync" },
644 { 254,
"nfsservctl" },
646 { 256,
"clock_settime" },
647 { 257,
"clock_gettime" },
648 { 258,
"clock_getres" },
649 { 259,
"clock_nanosleep" },
650 { 260,
"sched_getaffinity" },
651 { 261,
"sched_setaffinity" },
652 { 262,
"timer_settime" },
653 { 263,
"timer_gettime" },
654 { 264,
"timer_getoverrun" },
655 { 265,
"timer_delete" },
656 { 266,
"timer_create" },
659 { 269,
"io_destroy" },
660 { 270,
"io_submit" },
661 { 271,
"io_cancel" },
662 { 272,
"io_getevents" },
664 { 274,
"mq_unlink" },
665 { 275,
"mq_timedsend" },
666 { 276,
"mq_timedreceive" },
667 { 277,
"mq_notify" },
668 { 278,
"mq_getsetattr" },
670 { 280,
"sys_setaltroot" },
672 { 282,
"request_key" },
SyscallReturn getpidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getpid() handler.
SyscallReturn closeFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd)
Target close() handler.
SyscallReturn ignoreFunc(SyscallDesc *desc, 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.
const std::string & name()
SyscallReturn readlinkFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, Addr buf_ptr, size_t bufsiz)
Target readlink() handler.
SyscallReturn getresuidFunc(SyscallDesc *desc, ThreadContext *tc, Addr ruid, Addr euid, Addr suid)
virtual PortProxy & getVirtProxy()=0
virtual Process * getProcessPtr()=0
char version[_SYS_NMLN]
OS version.
static SyscallReturn unameFunc(SyscallDesc *desc, ThreadContext *tc, Addr utsname)
Target uname() handler.
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...
char release[_SYS_NMLN]
OS release.
SyscallReturn getgidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getgid() handler.
SyscallReturn getcwdFunc(SyscallDesc *desc, ThreadContext *tc, Addr buf_ptr, unsigned long size)
Target getcwd() handler.
SyscallReturn munmapFunc(SyscallDesc *desc, ThreadContext *tc, Addr start, size_t length)
Target munmap() handler.
SyscallReturn getuidFunc(SyscallDesc *desc, ThreadContext *tc)
SyscallReturn getppidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getppid() handler.
SyscallReturn lseekFunc(SyscallDesc *desc, ThreadContext *tc, int tgt_fd, uint64_t offs, int whence)
Target lseek() handler.
SyscallReturn brkFunc(SyscallDesc *desc, ThreadContext *tc, Addr new_brk)
Target brk() handler: set brk address.
void * bufferPtr()
Return a pointer to the internal simulator-space buffer.
SyscallReturn pipePseudoFunc(SyscallDesc *desc, ThreadContext *tc)
Pseudo Funcs - These functions use a different return convension, returning a second value in a regis...
char sysname[_SYS_NMLN]
System name.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
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.
This class provides the wrapper interface for the system call implementations which are defined in th...
SyscallReturn mkdirFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, mode_t mode)
Target mkdir() handler.
This file defines objects used to emulate syscalls from the target application on the host machine...
bool copyOut(PortProxy &memproxy)
copy data out of simulator space (write to target memory)
SyscallReturn unlinkFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname)
Target unlink() handler.
static SyscallDescTable< Sparc32Process::SyscallABI > syscall32Descs
32 bit compatibility syscall descriptors, indexed by call number.
SyscallReturn exitGroupFunc(SyscallDesc *desc, ThreadContext *tc, int status)
Target exit_group() handler: terminate simulation. (exit all threads)
char nodename[_SYS_NMLN]
Node name.
static SyscallDescTable< Sparc64Process::SyscallABI > syscallDescs
64 bit syscall descriptors, indexed by call number.
BufferArg represents an untyped buffer in target user space that is passed by reference to an (emulat...
SyscallReturn geteuidFunc(SyscallDesc *desc, ThreadContext *tc)
Target geteuid() handler.
char machine[_SYS_NMLN]
Machine type.
SyscallReturn renameFunc(SyscallDesc *desc, ThreadContext *tc, Addr oldpath, Addr newpath)
Target rename() handler.
This class represents the return value from an emulated system call, including any errno setting...
SyscallReturn getegidFunc(SyscallDesc *desc, ThreadContext *tc)
Target getegid() handler.
SyscallReturn exitFunc(SyscallDesc *desc, ThreadContext *tc, int status)
Target exit() handler: terminate current context.
SyscallReturn chownFunc(SyscallDesc *desc, ThreadContext *tc, Addr pathname, uint32_t owner, uint32_t group)
Target chown() handler.