This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1/2] Add syscall information for ARM


Add syscall information for ARM devices.  This allows tapsets to be
compiled on this architecture when CONFIG_UTRACE is enabled.

Signed-off-by: Wade Farnsworth <wade_farnsworth@mentor.com>
---

Fixed subject line.

 runtime/syscall.h |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/runtime/syscall.h b/runtime/syscall.h
index 786965f..2adcd3b 100644
--- a/runtime/syscall.h
+++ b/runtime/syscall.h
@@ -85,6 +85,14 @@
 #define MREMAP_SYSCALL_NO(tsk)		163
 #endif
 
+#if defined(__arm__)
+#define MMAP_SYSCALL_NO(tsk)		90
+#define MMAP2_SYSCALL_NO(tsk)		192
+#define MPROTECT_SYSCALL_NO(tsk)	125
+#define MUNMAP_SYSCALL_NO(tsk)		91
+#define MREMAP_SYSCALL_NO(tsk)		163
+#endif
+
 #if !defined(MMAP_SYSCALL_NO) || !defined(MMAP2_SYSCALL_NO)		\
 	|| !defined(MPROTECT_SYSCALL_NO) || !defined(MUNMAP_SYSCALL_NO)	\
 	|| !defined(MREMAP_SYSCALL_NO)
@@ -146,6 +154,14 @@ syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
 }
 #endif
 
+#if defined(__arm__)
+static inline long
+syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
+{
+	return regs->ARM_r7;
+}
+#endif
+
 #if defined(__i386__) || defined(__x86_64__)
 static inline long
 syscall_get_return_value(struct task_struct *task, struct pt_regs *regs)
@@ -196,6 +212,14 @@ syscall_get_return_value(struct task_struct *task, struct pt_regs *regs)
 }
 #endif
 
+#if defined(__arm__)
+static inline long
+syscall_get_return_value(struct task_struct *task, struct pt_regs *regs)
+{
+	return regs->ARM_r0;
+}
+
+#endif
 #if defined(__i386__) || defined(__x86_64__)
 static inline void
 syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
@@ -490,5 +514,19 @@ syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
 }
 #endif
 
+#if defined(__arm__)
+static inline void
+syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
+		      unsigned int i, unsigned int n, unsigned long *args)
+{
+	if (i + n > 6) {
+		_stp_error("invalid syscall arg request");
+		return;
+	}
+
+	memcpy(args, &regs->uregs[i], n * sizeof(args[0]));
+}
+#endif
+
 #endif /* !STAPCONF_ASM_SYSCALL_H */
 #endif /* _SYSCALL_H_ */
-- 
1.7.0.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]