38 #include "debug/SyscallVerbose.hh"
45 using namespace AlphaISA;
55 strcpy(
name->sysname,
"Linux");
56 strcpy(
name->nodename,
"sim.gem5.org");
57 strcpy(
name->release,
"3.0.0");
58 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
59 strcpy(
name->machine,
"alpha");
88 cerr <<
"osf_getsysinfo: unknown op " << op << endl;
112 DPRINTFR(SyscallVerbose,
"osf_setsysinfo(SSI_IEEE_FP_CONTROL): "
113 " setting FPCR to 0x%x\n",
gtoh(*(uint64_t*)fpcr));
118 cerr <<
"osf_setsysinfo: unknown op " << op << endl;
272 SyscallDesc(
"getrlimit", getrlimitFunc<AlphaLinux>),
490 SyscallDesc(
"gettimeofday", gettimeofdayFunc<AlphaLinux>),
495 SyscallDesc(
"getrusage", getrusageFunc<AlphaLinux>),
575 AlphaLinuxProcess::AlphaLinuxProcess(ProcessParams * params,
578 Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(
SyscallDesc))
SyscallReturn ftruncateFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target ftruncate() handler.
SyscallReturn brkFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target brk() handler: set brk address.
const std::string & name()
SyscallReturn dupFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
FIXME: The file description is not shared among file descriptors created with dup.
SyscallReturn getcwdFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target getcwd() handler.
bool copyIn(SETranslatingPortProxy &memproxy)
copy data into simulator space (read from target memory)
SyscallReturn ignoreFunc(SyscallDesc *desc, int callnum, Process *process, 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 getpagesizeFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target getpagesize() handler.
SyscallReturn readlinkFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
virtual TheISA::IntReg getSyscallArg(ThreadContext *tc, int &i)=0
virtual SyscallDesc * getDesc(int callnum)
SyscallReturn getgidPseudoFunc(SyscallDesc *desc, int callnum, Process *process, 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...
static SyscallDesc syscallDescs[]
Array of syscall descriptors, indexed by call number.
SyscallReturn fcntlFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target fcntl() handler.
bool copyOut(SETranslatingPortProxy &memproxy)
copy data out of simulator space (write to target memory)
SyscallReturn munmapFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target munmap() handler.
SyscallReturn writeFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target write() handler.
SyscallReturn unimplementedFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Handler for unimplemented syscalls that we haven't thought about.
SyscallReturn exitGroupFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc)
Target exit_group() handler: terminate simulation. (exit all threads)
SyscallReturn lseekFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target lseek() handler.
static SyscallReturn unameFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target uname() handler.
SyscallReturn fchownFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target fchown() handler.
SyscallReturn unlinkFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
static SyscallReturn osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target osf_setsysinfo() handler.
virtual SETranslatingPortProxy & getMemProxy()=0
SyscallReturn getuidPseudoFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target getuidPseudo() handler.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
SyscallReturn mkdirFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target mkdir() handler.
SyscallReturn setuidFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target setuid() handler.
This class provides the wrapper interface for the system call implementations which are defined in th...
SyscallReturn truncateFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target truncate() handler.
SyscallReturn pipePseudoFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Pseudo Funcs - These functions use a different return convension, returning a second value in a regis...
SyscallReturn renameFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target rename() handler.
This file defines objects used to emulate syscalls from the target application on the host machine...
SyscallReturn umaskFunc(SyscallDesc *desc, int num, Process *process, ThreadContext *tc)
Target umask() handler.
SyscallReturn chownFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target chown() handler.
static SyscallReturn osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target osf_getsysyinfo() handler.
SyscallReturn gethostnameFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target gethostname() handler.
SyscallReturn getpidPseudoFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target getpidPseudo() handler.
SyscallReturn exitFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc)
Target exit() handler: terminate current context.
SyscallReturn closeFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target close() handler.
This class represents the return value from an emulated system call, including any errno setting...
SyscallReturn readFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
const int Num_Syscall_Descs