39 #include "debug/SyscallVerbose.hh"
48 using namespace MipsISA;
58 strcpy(
name->sysname,
"Linux");
59 strcpy(
name->nodename,
"sim.gem5.org");
60 strcpy(
name->release,
"3.0.0");
61 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
62 strcpy(
name->machine,
"mips");
91 cerr <<
"sys_getsysinfo: unknown op " << op << endl;
117 DPRINTFR(SyscallVerbose,
"sys_setsysinfo(SSI_IEEE_FP_CONTROL): "
118 " setting FPCR to 0x%x\n",
gtoh(*(uint64_t*)fpcr));
122 cerr <<
"sys_setsysinfo: unknown op " << op << endl;
218 SyscallDesc(
"getrusage", getrusageFunc<MipsLinux>),
466 Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(
SyscallDesc))
473 int m5_sys_idx = callnum - 4000;
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.
static SyscallReturn sys_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target sys_setsysinfo() handler.
const std::string & name()
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
SyscallReturn getpidFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target getpid() 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 getegidFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target getegid() handler.
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)
static SyscallDesc syscallDescs[]
Array of syscall descriptors, indexed by call number.
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 lseekFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target lseek() handler.
SyscallReturn fchownFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target fchown() handler.
SyscallReturn unlinkFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
SyscallReturn geteuidFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target geteuid() handler.
virtual SETranslatingPortProxy & getMemProxy()=0
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 getgidFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target getgid() handler.
virtual SyscallDesc * getDesc(int callnum)
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 fcntl64Func(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target fcntl64() handler.
This file defines objects used to emulate syscalls from the target application on the host machine...
SyscallReturn getuidFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target getuid() handler.
static SyscallReturn unameFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target uname() handler.
static SyscallReturn setThreadAreaFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
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.
SyscallReturn gethostnameFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target gethostname() handler.
const int Num_Syscall_Descs
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...
virtual void setMiscRegNoEffect(int misc_reg, const MiscReg &val)=0
MipsLinuxProcess(ProcessParams *params, ObjectFile *objFile)
Constructor.
SyscallReturn readFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
static SyscallReturn sys_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target sys_getsysyinfo() handler.