diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2009-06-09 23:41:45 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2009-06-09 23:41:45 -0700 |
commit | b394242240db749b6a85e3e269c858d9cbd1aa69 (patch) | |
tree | d4be9dce9be903aa4ee67841d95f93b0eec3ef1d /src/arch/arm | |
parent | c913c64be22f0b91552fdebb16b1505591a32c64 (diff) | |
download | gem5-b394242240db749b6a85e3e269c858d9cbd1aa69.tar.xz |
ARM: Hook in the mmap2 system call. Make ArmLinuxProcess handle 5,6 syscall params.
Diffstat (limited to 'src/arch/arm')
-rw-r--r-- | src/arch/arm/linux/process.cc | 20 | ||||
-rw-r--r-- | src/arch/arm/linux/process.hh | 3 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/arch/arm/linux/process.cc b/src/arch/arm/linux/process.cc index a36d1fd8f..7158acfff 100644 --- a/src/arch/arm/linux/process.cc +++ b/src/arch/arm/linux/process.cc @@ -255,7 +255,7 @@ SyscallDesc ArmLinuxProcess::syscallDescs[] = { /* 189 */ SyscallDesc("putpmsg", unimplementedFunc), /* 190 */ SyscallDesc("vfork", unimplementedFunc), /* 191 */ SyscallDesc("getrlimit", unimplementedFunc), - /* 192 */ SyscallDesc("mmap2", unimplementedFunc), + /* 192 */ SyscallDesc("mmap2", mmapFunc<ArmLinux>), /* 193 */ SyscallDesc("truncate64", unimplementedFunc), /* 194 */ SyscallDesc("ftruncate64", unimplementedFunc), /* 195 */ SyscallDesc("stat64", unimplementedFunc), @@ -509,3 +509,21 @@ ArmLinuxProcess::startup() }; tc->getMemPort()->writeBlob(commPage + 0x0fe0, get_tls, sizeof(get_tls)); } + +ArmISA::IntReg +ArmLinuxProcess::getSyscallArg(ThreadContext *tc, int i) +{ + // Linux apparently allows more parameter than the ABI says it should. + // This limit may need to be increased even further. + assert(i < 6); + return tc->readIntReg(ArgumentReg0 + i); +} + +void +ArmLinuxProcess::setSyscallArg(ThreadContext *tc, int i, ArmISA::IntReg val) +{ + // Linux apparently allows more parameter than the ABI says it should. + // This limit may need to be increased even further. + assert(i < 6); + tc->setIntReg(ArgumentReg0 + i, val); +} diff --git a/src/arch/arm/linux/process.hh b/src/arch/arm/linux/process.hh index 835b94161..53b3781d2 100644 --- a/src/arch/arm/linux/process.hh +++ b/src/arch/arm/linux/process.hh @@ -44,6 +44,9 @@ class ArmLinuxProcess : public ArmLiveProcess void startup(); + ArmISA::IntReg getSyscallArg(ThreadContext *tc, int i); + void setSyscallArg(ThreadContext *tc, int i, ArmISA::IntReg val); + /// The target system's hostname. static const char *hostname; |