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] ia64: add utrace support on ia64


Hi,

Here is a patch which add utrace on ia64 support to systemtap.
I just checked it on rhel5.2 kernel (this means old utrace interface).

Thank you,

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

---
 runtime/syscall.h |   47 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 46 insertions(+), 1 deletion(-)

Index: systemtap/runtime/syscall.h
===================================================================
--- systemtap.orig/runtime/syscall.h
+++ systemtap/runtime/syscall.h
@@ -66,7 +66,15 @@
 #define MUNMAP_SYSCALL_NO(tsk)		91
 #define MREMAP_SYSCALL_NO(tsk)		163
 #endif
- 
+
+#if defined(__ia64__)
+#define MMAP_SYSCALL_NO(tsk)		1151
+#define MMAP2_SYSCALL_NO(tsk)		1172
+#define MPROTECT_SYSCALL_NO(tsk)	1155
+#define MUNMAP_SYSCALL_NO(tsk)		1152
+#define MREMAP_SYSCALL_NO(tsk)		1156
+#endif
+
 #if !defined(MMAP_SYSCALL_NO) || !defined(MMAP2_SYSCALL_NO)		\
 	|| !defined(MPROTECT_SYSCALL_NO) || !defined(MUNMAP_SYSCALL_NO)	\
 	|| !defined(MREMAP_SYSCALL_NO)
@@ -95,6 +103,14 @@ __stp_user_syscall_nr(struct pt_regs *re
 }
 #endif
 
+#if defined(__ia64__)
+static inline unsigned long
+__stp_user_syscall_nr(struct pt_regs *regs)
+{
+        return regs->r15;
+}
+#endif
+
 #if defined(__i386__) || defined(__x86_64__)
 static inline long *
 __stp_user_syscall_return_value(struct task_struct *task, struct pt_regs *regs)
@@ -129,6 +145,14 @@ __stp_user_syscall_return_value(struct t
 } 
 #endif
 
+#if defined(__ia64__)
+static inline long *
+__stp_user_syscall_return_value(struct task_struct *task, struct pt_regs *regs)
+{
+	return &regs->r8;
+}
+#endif
+
 #if defined(__i386__) || defined(__x86_64__)
 static inline long *
 __stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs,
@@ -211,4 +235,25 @@ __stp_user_syscall_arg(struct task_struc
 }
 #endif
 
+#if defined(__ia64__)
+static inline long *
+__stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs,
+		       unsigned int n)
+{
+	struct ia64_stap_get_arbsp_param pa;
+	if (n > 5) {
+		_stp_error("syscall arg > 5");
+		return NULL;
+	}
+
+	pa.ip = regs->cr_iip;
+	unw_init_running(ia64_stap_get_arbsp, &pa);
+	if (pa.address == 0)
+		return NULL;
+
+	return ia64_rse_skip_regs(pa.address, n);
+
+}
+#endif
+
 #endif /* _SYSCALL_H_ */

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