39 #include "debug/SyscallVerbose.hh" 55 load(ProcessParams *params,
ObjectFile *obj_file)
override 63 warn(
"Unknown operating system; assuming Linux.");
74 AlphaLinuxObjectFileLoader loader;
86 strcpy(
name->sysname,
"Linux");
87 strcpy(
name->nodename,
"sim.gem5.org");
88 strcpy(
name->release, process->release.c_str());
89 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
90 strcpy(
name->machine,
"alpha");
104 unsigned op = process->getSyscallArg(tc, index);
105 Addr bufPtr = process->getSyscallArg(tc, index);
119 cerr <<
"osf_getsysinfo: unknown op " << op << endl;
133 unsigned op = process->getSyscallArg(tc, index);
134 Addr bufPtr = process->getSyscallArg(tc, index);
143 DPRINTFR(SyscallVerbose,
"osf_setsysinfo(SSI_IEEE_FP_CONTROL): " 144 " setting FPCR to 0x%x\n",
letoh(*(uint64_t*)fpcr));
149 cerr <<
"osf_setsysinfo: unknown op " << op << endl;
162 {
"read", readFunc<AlphaLinux> },
163 {
"write", writeFunc<AlphaLinux> },
174 {
"chmod", chmodFunc<AlphaLinux> },
184 {
"exec_with_loader" },
190 {
"osf_ngetpeername" },
191 {
"osf_ngetsockname" },
202 {
"osf_set_program_attributes" },
204 {
"open", openFunc<AlphaLinux> },
205 {
"osf_old_sigaction" },
213 {
"ioctl", ioctlFunc<AlphaLinux> },
226 {
"stat", statFunc<AlphaLinux> },
227 {
"lstat", lstatFunc<AlphaLinux> },
230 {
"mmap", mmapFunc<AlphaLinux> },
231 {
"osf_old_vadvise" },
240 {
"osf_old_getpgrp" },
250 {
"fstat", fstatFunc<AlphaLinux> },
267 {
"osf_old_sigvec" },
268 {
"osf_old_sigblock" },
269 {
"osf_old_sigsetmask" },
274 {
"osf_old_vtrace" },
275 {
"osf_gettimeofday" },
280 {
"writev", writevFunc<AlphaLinux> },
281 {
"osf_settimeofday" },
283 {
"fchmod", fchmodFunc<AlphaLinux> },
298 {
"osf_old_sigreturn" },
303 {
"getrlimit", getrlimitFunc<AlphaLinux> },
305 {
"osf_old_killpg" },
313 {
"osf_pid_unblock" },
314 {
"osf_signal_urti" },
316 {
"osf_sigwaitprim" },
318 {
"osf_getdirentries" },
322 {
"osf_async_daemon" },
324 {
"osf_getdomainname" },
346 {
"osf_alt_sigpending" },
347 {
"osf_alt_setsid" },
373 {
"osf_getaddressconf" },
378 {
"osf_utc_gettime" },
379 {
"osf_utc_adjtime" },
396 {
"osf_priocntlset" },
397 {
"osf_sigsendset" },
398 {
"osf_set_speculative" },
399 {
"osf_msfs_syscall" },
403 {
"osf_proplist_syscall" },
404 {
"osf_ntp_adjtime" },
405 {
"osf_ntp_gettime" },
410 {
"osf_usleep_thread" },
414 {
"osf_subsys_info" },
417 {
"osf_afs_syscall" },
471 {
"get_kernel_syms" },
474 {
"clone", cloneFunc<AlphaLinux> },
480 {
"sysinfo", sysinfoFunc<AlphaLinux> },
492 {
"sched_setparam" },
493 {
"sched_getparam" },
494 {
"sched_setscheduler" },
495 {
"sched_getscheduler" },
497 {
"sched_get_priority_max" },
498 {
"sched_get_priority_min" },
499 {
"sched_rr_get_interval" },
503 {
"mremap", mremapFunc<AlphaLinux> },
507 {
"pciconfig_read" },
508 {
"pciconfig_write" },
515 {
"rt_sigprocmask" },
517 {
"rt_sigtimedwait" },
518 {
"rt_sigqueueinfo" },
521 {
"gettimeofday", gettimeofdayFunc<AlphaLinux> },
525 {
"utimes", utimesFunc<AlphaLinux> },
526 {
"getrusage", getrusageFunc<AlphaLinux> },
538 {
"pciconfig_iobase" },
557 {
"sched_setaffinity" },
558 {
"sched_getaffinity" },
568 {
"lookup_dcookie" },
569 {
"sys_epoll_create" },
571 {
"sys_epoll_wait" },
572 {
"remap_file_pages" },
573 {
"set_tid_address" },
574 {
"restart_syscall" },
579 {
"timer_getoverrun" },
584 {
"clock_nanosleep" },
587 {
"stat64", stat64Func<AlphaLinux> },
588 {
"lstat64", lstat64Func<AlphaLinux> },
589 {
"fstat64", fstat64Func<AlphaLinux> },
597 {
"mq_timedreceive" },
606 AlphaLinuxProcess::AlphaLinuxProcess(ProcessParams * params,
609 Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(
SyscallDesc))
const std::string & name()
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 RegVal readIntReg(RegIndex reg_idx) const =0
bool copyIn(PortProxy &memproxy)
copy data into simulator space (read from target memory)
virtual PortProxy & getVirtProxy()=0
virtual Process * getProcessPtr()=0
SyscallReturn fcntlFunc(SyscallDesc *desc, int num, ThreadContext *tc)
Target fcntl() handler.
Overload hash function for BasicBlockRange type.
void doSyscall(int64_t callnum, ThreadContext *tc, Fault *fault)
SyscallReturn getuidPseudoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target getuidPseudo() handler.
SyscallReturn getgidPseudoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target getgidPseudo() 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...
SyscallReturn closeFunc(SyscallDesc *desc, int num, ThreadContext *tc, int tgt_fd)
Target close() handler.
SyscallReturn gethostnameFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr buf_ptr, int name_len)
Target gethostname() handler.
SyscallReturn renameFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr oldpath, Addr newpath)
Target rename() handler.
SyscallReturn umaskFunc(SyscallDesc *desc, int num, ThreadContext *tc)
Target umask() handler.
SyscallReturn munmapFunc(SyscallDesc *desc, int num, ThreadContext *tc)
Target munmap() handler.
static SyscallReturn osf_setsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target osf_setsysinfo() handler.
SyscallReturn unlinkFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr pathname)
Target unlink() handler.
SyscallReturn fchownFunc(SyscallDesc *desc, int num, ThreadContext *tc, int tgt_fd, uint32_t owner, uint32_t group)
Target fchown() 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 getpidPseudoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target getpidPseudo() handler.
SyscallDesc * getDesc(int callnum) override
SyscallReturn readlinkFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr pathname, Addr buf_ptr, size_t bufsiz)
Target readlink() handler.
SyscallReturn ftruncateFunc(SyscallDesc *desc, int num, ThreadContext *tc, int tgt_fd, off_t length)
Target ftruncate() handler.
void syscall(ThreadContext *tc, Fault *fault) override
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.
SyscallReturn dupFunc(SyscallDesc *desc, int num, ThreadContext *tc, int tgt_fd)
FIXME: The file description is not shared among file descriptors created with dup.
SyscallReturn getpagesizeFunc(SyscallDesc *desc, int num, ThreadContext *tc)
Target getpagesize() handler.
This class provides the wrapper interface for the system call implementations which are defined in th...
SyscallReturn truncateFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr pathname, off_t length)
Target truncate() handler.
SyscallReturn lseekFunc(SyscallDesc *desc, int num, ThreadContext *tc, int tgt_fd, uint64_t offs, int whence)
Target lseek() handler.
static SyscallReturn osf_getsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target osf_getsysyinfo() handler.
This file defines objects used to emulate syscalls from the target application on the host machine...
A process with emulated Alpha/Linux syscalls.
bool copyOut(PortProxy &memproxy)
copy data out of simulator space (write to target memory)
static SyscallDescABI< DefaultSyscallABI > syscallDescs[]
Array of syscall descriptors, indexed by call number.
SyscallReturn chownFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr pathname, uint32_t owner, uint32_t group)
Target chown() handler.
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...
Each instance of a Loader subclass will have a chance to try to load an object file when tryLoaders i...
static SyscallReturn unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target uname() handler.
std::shared_ptr< FaultBase > Fault
const int Num_Syscall_Descs
SyscallReturn exitFunc(SyscallDesc *desc, int callnum, ThreadContext *tc, int status)
Target exit() handler: terminate current context.