60 using namespace ArmISA;
70 strcpy(
name->sysname,
"Linux");
71 strcpy(
name->nodename,
"m5.eecs.umich.edu");
72 strcpy(
name->release,
"3.0.0");
73 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
74 strcpy(
name->machine,
"armv7l");
88 strcpy(
name->sysname,
"Linux");
89 strcpy(
name->nodename,
"gem5");
90 strcpy(
name->release,
"3.7.0+");
91 strcpy(
name->version,
"#1 SMP Sat Dec 1 00:00:00 GMT 2012");
92 strcpy(
name->machine,
"armv8l");
107 (uint8_t *)&tlsPtr,
sizeof(tlsPtr));
200 SyscallDesc(
"getrlimit", getrlimitFunc<ArmLinux32>),
201 SyscallDesc(
"getrusage", getrusageFunc<ArmLinux32>),
202 SyscallDesc(
"gettimeofday", gettimeofdayFunc<ArmLinux32>),
315 SyscallDesc(
"getrlimit", getrlimitFunc<ArmLinux32>),
387 SyscallDesc(
"clock_gettime", clock_gettimeFunc<ArmLinux32>),
388 SyscallDesc(
"clock_getres", clock_getresFunc<ArmLinux32>),
541 SyscallDesc(
"faccessat", faccessatFunc<ArmLinux64>),
571 SyscallDesc(
"readlinkat", readlinkatFunc<ArmLinux64>),
572 SyscallDesc(
"fstatat64", fstatat64Func<ArmLinux64>),
606 SyscallDesc(
"clock_gettime", clock_gettimeFunc<ArmLinux64>),
656 SyscallDesc(
"getrlimit", getrlimitFunc<ArmLinux64>),
658 SyscallDesc(
"getrusage", getrusageFunc<ArmLinux64>),
662 SyscallDesc(
"gettimeofday", gettimeofdayFunc<ArmLinux64>),
1602 table.
base = 0x900000;
1607 table.
base = 0xf0001;
1621 table.
base = 0x900000;
1626 table.
base = 0x1001;
1636 if (callnum == 0x123456)
1637 panic(
"Attempt to execute an ANGEL_SWI system call (newlib-related)");
1650 if (offset < 0 || offset >=
size)
1674 uint8_t swiNeg1[] = {
1675 0xff, 0xff, 0xff, 0xef
1681 swiNeg1,
sizeof(swiNeg1));
1684 uint8_t memory_barrier[] =
1686 0x5f, 0xf0, 0x7f, 0xf5,
1687 0x0e, 0xf0, 0xa0, 0xe1
1690 sizeof(memory_barrier));
1694 0x9f, 0x3f, 0x92, 0xe1,
1695 0x00, 0x30, 0x53, 0xe0,
1696 0x91, 0x3f, 0x82, 0x01,
1697 0x01, 0x00, 0x33, 0x03,
1698 0xfa, 0xff, 0xff, 0x0a,
1699 0x00, 0x00, 0x73, 0xe2,
1700 0x5f, 0xf0, 0x7f, 0xf5,
1701 0x0e, 0xf0, 0xa0, 0xe1
1708 0x70, 0x0f, 0x1d, 0xee,
1709 0x0e, 0xf0, 0xa0, 0xe1
SyscallReturn ftruncateFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target ftruncate() handler.
static SyscallDesc syscallDescs32[]
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.
static SyscallReturn setTLSFunc32(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target set_tls() 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.
SyscallReturn getppidFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target getppid() handler.
virtual void setMiscReg(int misc_reg, const MiscReg &val)=0
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.
ArmLinuxProcess32(ProcessParams *params, ObjectFile *objFile, ObjectFile::Arch _arch)
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 SyscallReturn unameFunc32(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target uname() handler.
static SyscallReturn setTLSFunc64(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
SyscallReturn getegidFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target getegid() handler.
SyscallDesc * getLinuxDesc(int callnum)
SyscallReturn _llseekFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target _llseek() handler.
SyscallReturn fcntlFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target fcntl() handler.
void initState()
initState() is called on each SimObject when not restoring from a checkpoint.
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 SyscallDesc syscallDescs64[]
SyscallReturn unlinkFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
void initState()
initState() is called on each SimObject when not restoring from a checkpoint.
SyscallReturn geteuidFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target geteuid() handler.
virtual SETranslatingPortProxy & getMemProxy()=0
Warn only once for unimplemented system calls.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
SyscallDesc * getDesc(int callnum)
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.
static SyscallDesc privSyscallDescs32[]
static SyscallReturn unameFunc64(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc)
Target uname() 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.
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.
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 umaskFunc(SyscallDesc *desc, int num, Process *process, ThreadContext *tc)
Target umask() handler.
SyscallReturn accessFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc, int index)
SyscallReturn chownFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target chown() handler.
SyscallDesc * getDesc(int offset) const
ArmLinuxProcess64(ProcessParams *params, ObjectFile *objFile, ObjectFile::Arch _arch)
SyscallReturn exitFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc)
Target exit() handler: terminate current context.
std::vector< SyscallTable > syscallTables
static const Addr commPage
A page to hold "kernel" provided functions. The name might be wrong.
SyscallReturn ftruncate64Func(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target ftruncate64() handler.
SyscallReturn closeFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
Target close() handler.
SyscallDesc * getDesc(int callnum)
This class represents the return value from an emulated system call, including any errno setting...
static SyscallDesc privSyscallDescs64[]
SyscallReturn readFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
void initState()
initState() is called on each SimObject when not restoring from a checkpoint.
virtual void writeBlob(Addr addr, const uint8_t *p, int size) const
Write size bytes from p to address.
void initState()
initState() is called on each SimObject when not restoring from a checkpoint.