58 load(ProcessParams *params,
ObjectFile *obj_file)
override 66 warn(
"Unknown operating system; assuming Linux.");
77 PowerLinuxObjectFileLoader loader;
89 strcpy(
name->sysname,
"Linux");
90 strcpy(
name->nodename,
"sim.gem5.org");
91 strcpy(
name->release, process->release.c_str());
92 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
93 strcpy(
name->machine,
"power");
103 {
"read", readFunc<PowerLinux> },
104 {
"write", writeFunc<PowerLinux> },
105 {
"open", openFunc<PowerLinux> },
113 {
"time", timeFunc<PowerLinux> },
115 {
"chmod", chmodFunc<PowerLinux> },
143 {
"times", timesFunc<PowerLinux> },
154 {
"ioctl", ioctlFunc<PowerLinux> },
190 {
"mmap", mmapFunc<PowerLinux> },
206 {
"stat", statFunc<PowerLinux> },
208 {
"fstat", fstatFunc<PowerLinux> },
230 {
"get_kernel_syms" },
246 {
"writev", writevFunc<PowerLinux> },
254 {
"sched_setparam" },
255 {
"sched_getparam" },
256 {
"sched_setscheduler" },
257 {
"sched_getscheduler" },
259 {
"sched_get_priority_max" },
260 {
"sched_get_priority_min" },
261 {
"sched_rr_get_interval" },
274 {
"rt_sigprocmask" },
277 {
"rt_sigtimedwait" },
292 {
"mmap2", mmapFunc<PowerLinux> },
295 {
"stat64", stat64Func<PowerLinux> },
296 {
"lstat64", lstat64Func<PowerLinux> },
297 {
"fstat64", fstat64Func<PowerLinux> },
341 {
"sched_setaffinity" },
342 {
"sched_getaffinity" },
349 {
"lookup_dcookie" },
353 {
"remap_file_pages" },
354 {
"set_thread_area" },
355 {
"get_thread_area" },
356 {
"set_tid_address" },
360 {
"timer_getoverrun" },
365 {
"clock_nanosleep" },
370 {
"arm_fadvise64_64" },
371 {
"pciconfig_iobase" },
372 {
"pciconfig_read" },
373 {
"pciconfig_write" },
377 {
"mq_timedreceive" },
417 {
"inotify_add_watch" },
418 {
"inotify_rm_watch" },
438 {
"set_robust_list" },
439 {
"get_robust_list" },
441 {
"arm_sync_file_range" },
452 Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(
SyscallDesc))
const std::string & name()
SyscallDesc * getDesc(int callnum) override
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.
virtual RegVal readIntReg(RegIndex reg_idx) const =0
virtual PortProxy & getVirtProxy()=0
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
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)
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 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 umaskFunc(SyscallDesc *desc, int num, ThreadContext *tc)
Target umask() 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)
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
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 ftruncateFunc(SyscallDesc *desc, int num, ThreadContext *tc, int tgt_fd, off_t length)
Target ftruncate() handler.
static SyscallReturn unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target uname() handler.
SyscallReturn brkFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr new_brk)
Target brk() handler: set brk address.
SyscallReturn dupFunc(SyscallDesc *desc, int num, ThreadContext *tc, int tgt_fd)
FIXME: The file description is not shared among file descriptors created with dup.
RegVal getSyscallArg(ThreadContext *tc, int &i) override
SyscallReturn getgidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
Target getgid() handler.
PowerLinuxProcess(ProcessParams *params, ObjectFile *objFile)
A process with emulated PPC/Linux syscalls.
SyscallReturn getpagesizeFunc(SyscallDesc *desc, int num, ThreadContext *tc)
Target getpagesize() handler.
void syscall(ThreadContext *tc, Fault *fault) override
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 fcntl64Func(SyscallDesc *desc, int num, ThreadContext *tc)
Target fcntl64() handler.
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...
SyscallReturn chownFunc(SyscallDesc *desc, int num, ThreadContext *tc, Addr pathname, uint32_t owner, uint32_t group)
Target chown() handler.
static SyscallDescABI< DefaultSyscallABI > syscallDescs[]
Array of syscall descriptors, indexed by call number.
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...
const int Num_Syscall_Descs
std::shared_ptr< FaultBase > Fault
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.
SyscallReturn ftruncate64Func(SyscallDesc *desc, int num, ThreadContext *tc)
Target ftruncate64() handler.