# HG changeset patch
# User Gabe Black <[email protected]>
# Date 1244530437 25200
# Node ID 8379905a430091750495fab821f428fca4f951b2
# Parent  1ac3b66da1bab6e4c8321d670d56bfd53af7eab5
ARM: Hook in the mmap2 system call. Make ArmLinuxProcess handle 5,6 syscall 
params.

diff --git a/src/arch/arm/linux/process.cc b/src/arch/arm/linux/process.cc
--- a/src/arch/arm/linux/process.cc
+++ b/src/arch/arm/linux/process.cc
@@ -255,7 +255,7 @@
     /* 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 @@
     };
     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
--- a/src/arch/arm/linux/process.hh
+++ b/src/arch/arm/linux/process.hh
@@ -44,6 +44,9 @@
 
     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;
 
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to