43 #include "debug/SyscallVerbose.hh"
52 using namespace RiscvISA;
62 strcpy(
name->sysname,
"Linux");
63 strcpy(
name->nodename,
"sim.gem5.org");
64 strcpy(
name->release,
"3.0.0");
65 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
66 strcpy(
name->machine,
"riscv");
78 {35,
SyscallDesc(
"unlinkat", unlinkatFunc<RiscvLinux>)},
80 {38,
SyscallDesc(
"renameat", renameatFunc<RiscvLinux>)},
82 {48,
SyscallDesc(
"faccessat", faccessatFunc<RiscvLinux>)},
84 {56,
SyscallDesc(
"openat", openatFunc<RiscvLinux>)},
90 {66,
SyscallDesc(
"writev", writevFunc<RiscvLinux>)},
92 {68,
SyscallDesc(
"pwrite", pwrite64Func<RiscvLinux>)},
93 {78,
SyscallDesc(
"readlinkat", readlinkatFunc<RiscvLinux>)},
94 {79,
SyscallDesc(
"fstatat", fstatat64Func<RiscvLinux>)},
95 {80,
SyscallDesc(
"fstat", fstat64Func<RiscvLinux>)},
98 {113,
SyscallDesc(
"clock_gettime", clock_gettimeFunc<RiscvLinux>)},
102 {153,
SyscallDesc(
"times", timesFunc<RiscvLinux>)},
104 {163,
SyscallDesc(
"getrlimit", getrlimitFunc<RiscvLinux>)},
106 {165,
SyscallDesc(
"getrusage", getrusageFunc<RiscvLinux>)},
107 {169,
SyscallDesc(
"gettimeofday", gettimeofdayFunc<RiscvLinux>)},
115 {216,
SyscallDesc(
"mremap", mremapFunc<RiscvLinux>)},
123 {1038,
SyscallDesc(
"stat", stat64Func<RiscvLinux>)},
124 {1039,
SyscallDesc(
"lstat", lstat64Func<RiscvLinux>)},
SyscallReturn brkFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target brk() handler: set brk address.
const std::string & name()
RiscvLinuxProcess(ProcessParams *params, ObjectFile *objFile)
Constructor.
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.
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.
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...
static std::map< int, SyscallDesc > syscallDescs
Array of syscall descriptors, indexed by call number.
SyscallReturn getegidFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target getegid() handler.
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.
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
Warn only once for unimplemented system calls.
SyscallReturn mkdirFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target mkdir() handler.
This class provides the wrapper interface for the system call implementations which are defined in th...
virtual SyscallDesc * getDesc(int callnum)
SyscallReturn getgidFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target getgid() handler.
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.
SyscallReturn accessFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc, int index)
SyscallReturn exitFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc)
Target exit() handler: terminate current context.
SyscallReturn ftruncate64Func(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target ftruncate64() handler.
static SyscallReturn unameFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target uname() handler.
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)