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");
63 const uint64_t
id =
htobe(100);
66 Addr ruid =
p->getSyscallArg(tc, index);
67 Addr euid =
p->getSyscallArg(tc, index);
68 Addr suid =
p->getSyscallArg(tc, index);
72 BufferArg ruidBuff(ruid,
sizeof(uint64_t));
73 memcpy(ruidBuff.
bufferPtr(), &
id,
sizeof(uint64_t));
78 BufferArg euidBuff(euid,
sizeof(uint64_t));
79 memcpy(euidBuff.
bufferPtr(), &
id,
sizeof(uint64_t));
84 BufferArg suidBuff(suid,
sizeof(uint64_t));
85 memcpy(suidBuff.
bufferPtr(), &
id,
sizeof(uint64_t));
92 {
"restart_syscall" },
95 {
"read", readFunc<Sparc32Linux> },
96 {
"write", writeFunc<Sparc32Linux> },
97 {
"open", openFunc<Sparc32Linux> },
144 {
"memory_ordering" },
155 {
"fstat64", fstat64Func<Sparc32Linux> },
163 {
"mmap", mmapFunc<Sparc32Linux> },
197 {
"rt_sigtimedwait" },
198 {
"rt_sigqueueinfo" },
208 {
"gettimeofday", gettimeofdayFunc<Sparc32Linux> },
240 {
"pciconfig_read" },
241 {
"pciconfig_write" },
244 {
"inotify_add_watch" },
248 {
"inotify_rm_watch" },
252 {
"sched_setaffinity" },
253 {
"sched_getaffinity" },
258 {
"set_tid_address" },
284 {
"remap_file_pages" },
300 {
"lookup_dcookie" },
306 {
"sysinfo", sysinfoFunc<Sparc32Linux> },
309 {
"clone", cloneFunc<Sparc32Linux> },
315 {
"get_kernel_syms" },
333 {
"sched_setparam" },
334 {
"sched_getparam" },
335 {
"sched_setscheduler" },
336 {
"sched_getscheduler" },
338 {
"sched_get_priority_max" },
339 {
"sched_get_priority_min" },
340 {
"sched_rr_get_interval" },
342 {
"mremap", mremapFunc<Sparc32Linux> },
351 {
"clock_nanosleep" },
352 {
"sched_getaffinity" },
353 {
"sched_setaffinity" },
356 {
"timer_getoverrun" },
368 {
"mq_timedreceive" },
372 {
"sys_setaltroot" },
398 {
"restart_syscall" },
401 {
"read", readFunc<SparcLinux> },
402 {
"write", writeFunc<SparcLinux> },
403 {
"open", openFunc<SparcLinux> },
413 {
"chmod", chmodFunc<Linux> },
450 {
"memory_ordering" },
460 {
"fstat", fstatFunc<SparcLinux> },
469 {
"mmap", mmapFunc<SparcLinux> },
503 {
"rt_sigtimedwait" },
504 {
"rt_sigqueueinfo" },
514 {
"gettimeofday", gettimeofdayFunc<SparcLinux> },
546 {
"pciconfig_read" },
547 {
"pciconfig_write" },
550 {
"inotify_add_watch" },
554 {
"inotify_rm_watch" },
558 {
"sched_set_affinity" },
559 {
"sched_get_affinity" },
564 {
"set_tid_address" },
590 {
"remap_file_pages" },
606 {
"lookup_dcookie" },
612 {
"sysinfo", sysinfoFunc<SparcLinux> },
615 {
"clone", cloneFunc<SparcLinux> },
621 {
"get_kernel_syms" },
639 {
"sched_setparam" },
640 {
"sched_getparam" },
641 {
"sched_setscheduler" },
642 {
"sched_getscheduler" },
644 {
"sched_get_priority_max" },
645 {
"sched_get_priority_min" },
646 {
"sched_rr_get_interval" },
648 {
"mremap", mremapFunc<SparcLinux> },
657 {
"clock_nanosleep" },
658 {
"sched_getaffinity" },
659 {
"sched_setaffinity" },
662 {
"timer_getoverrun" },
674 {
"mq_timedreceive" },
678 {
"sys_setaltroot" },
static SyscallDescABI< DefaultSyscallABI > syscall32Descs[]
Array of 32 bit compatibility syscall descriptors, indexed by call number.
const std::string & name()
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.
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.
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.
static SyscallReturn unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target uname() handler.
SyscallReturn getgidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target getgid() handler.
static const int Num_Syscall_Descs
This class provides the wrapper interface for the system call implementations which are defined in th...
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...
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)
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...
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