summaryrefslogtreecommitdiffstats
path: root/runtime/syscall.h
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2008-11-04 12:52:21 -0600
committerDavid Smith <dsmith@redhat.com>2008-11-04 12:52:21 -0600
commit32f1f1a7b640cb110982b9ec364034645c0b0734 (patch)
tree5e14ee83fb436cdeb76b380ebae0d1fdf111a7ee /runtime/syscall.h
parent49c9622d4708c94922f351b83b7f2f729f7a1288 (diff)
downloadsystemtap-steved-32f1f1a7b640cb110982b9ec364034645c0b0734.tar.gz
systemtap-steved-32f1f1a7b640cb110982b9ec364034645c0b0734.tar.xz
systemtap-steved-32f1f1a7b640cb110982b9ec364034645c0b0734.zip
PR5274 - Added s390 task_finder support.
2008-11-04 David Smith <dsmith@redhat.com> PR 5274. * syscall.h: Added s390 task_finder support.
Diffstat (limited to 'runtime/syscall.h')
-rw-r--r--runtime/syscall.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/runtime/syscall.h b/runtime/syscall.h
index 24fc7b1c..ae451070 100644
--- a/runtime/syscall.h
+++ b/runtime/syscall.h
@@ -75,6 +75,14 @@
#define MREMAP_SYSCALL_NO(tsk) 1156
#endif
+#if defined(__s390__) || defined(__s390x__)
+#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)
@@ -111,6 +119,15 @@ __stp_user_syscall_nr(struct pt_regs *regs)
}
#endif
+#if defined(__s390__) || defined(__s390x__)
+static inline unsigned long
+__stp_user_syscall_nr(struct pt_regs *regs)
+{
+ // might need to be 'orig_gpr2'
+ return regs->gprs[2];
+}
+#endif
+
#if defined(__i386__) || defined(__x86_64__)
static inline long *
__stp_user_syscall_return_value(struct task_struct *task, struct pt_regs *regs)
@@ -153,6 +170,14 @@ __stp_user_syscall_return_value(struct task_struct *task, struct pt_regs *regs)
}
#endif
+#if defined(__s390__) || defined(__s390x__)
+static inline long *
+__stp_user_syscall_return_value(struct task_struct *task, struct pt_regs *regs)
+{
+ return &regs->gprs[2];
+}
+#endif
+
#if defined(__i386__) || defined(__x86_64__)
static inline long *
__stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs,
@@ -251,4 +276,27 @@ ____stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs,
}
#endif
+#if defined(__s390__) || defined(__s390x__)
+static inline long *
+__stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs,
+ unsigned int n)
+{
+ /* If we were returning a value, we could check for TIF_31BIT
+ * here and cast the value with '(u32)' to make sure it got
+ * down to 32bits. But, since we're returning an address,
+ * there isn't much we can do. */
+ switch (n) {
+ case 0: return &regs->orig_gpr2;
+ case 1: return &regs->gprs[3];
+ case 2: return &regs->gprs[4];
+ case 3: return &regs->gprs[5];
+ case 4: return &regs->gprs[6];
+ case 5: return &regs->args[0];
+ default:
+ _stp_error("syscall arg > 5");
+ return NULL;
+ }
+}
+#endif
+
#endif /* _SYSCALL_H_ */