summaryrefslogtreecommitdiffstats
path: root/runtime/current.c
diff options
context:
space:
mode:
authordwilder <dwilder>2006-10-19 18:37:15 +0000
committerdwilder <dwilder>2006-10-19 18:37:15 +0000
commit24cb8c3b07c5fed086555b54f9f753bb78df6837 (patch)
tree9cdfcd666b46b16944ad23f41686cf7bfebfaafb /runtime/current.c
parent0b951e7c1aa8653655d63bda882d392f0c2216c8 (diff)
downloadsystemtap-steved-24cb8c3b07c5fed086555b54f9f753bb78df6837.tar.gz
systemtap-steved-24cb8c3b07c5fed086555b54f9f753bb78df6837.tar.xz
systemtap-steved-24cb8c3b07c5fed086555b54f9f753bb78df6837.zip
Adding s390x support
Diffstat (limited to 'runtime/current.c')
-rw-r--r--runtime/current.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/runtime/current.c b/runtime/current.c
index 5dbc06ef..809f253b 100644
--- a/runtime/current.c
+++ b/runtime/current.c
@@ -44,6 +44,8 @@ unsigned long _stp_ret_addr (struct pt_regs *regs)
return REG_LINK(regs);
#elif defined (__ia64__)
return regs->b0;
+#elif defined (__s390__) || defined (__s390x__)
+ return regs->gprs[14];
#else
#error Unimplemented architecture
#endif
@@ -208,6 +210,37 @@ void _stp_sprint_regs(String str, struct pt_regs * regs)
_stp_string_cat(str, "\n");
}
+#elif defined (__s390x__) || defined (__s390__)
+
+#ifdef __s390x__
+#define GPRSIZE "%016lX "
+#else /* s390 */
+#define GPRSIZE "%08lX "
+#endif
+
+void _stp_sprint_regs(String str, struct pt_regs * regs)
+{
+ char *mode;
+ int i;
+
+ mode = (regs->psw.mask & PSW_MASK_PSTATE) ? "User" : "Krnl";
+ _stp_sprintf(str,"%s PSW : ["GPRSIZE"] ["GPRSIZE"]",
+ mode, (void *) regs->psw.mask,
+ (void *) regs->psw.addr);
+
+#ifdef CONFIG_SMP
+ _stp_sprintf(str, " CPU: %d", smp_processor_id());
+#endif /* CONFIG_SMP */
+
+ for (i = 0; i < 16; i++) {
+ if ((i % 4) == 0) {
+ _stp_sprintf(str, "\n GPRS%02d: ", i);
+ }
+ _stp_sprintf(str, GPRSIZE, regs->gprs[i]);
+ }
+ _stp_string_cat(str, "\n");
+}
+
#endif
/** Print the registers.