summaryrefslogtreecommitdiffstats
path: root/runtime/current.c
diff options
context:
space:
mode:
authoraskeshav <askeshav>2005-10-28 22:49:28 +0000
committeraskeshav <askeshav>2005-10-28 22:49:28 +0000
commit1c9db4fdf66fe88a731319b99942872fa567d742 (patch)
tree33a86507a7fcf9a9c771cf9a1801c8f81c566cf8 /runtime/current.c
parent063b69fe3f1109ec81b5e4c1f1333a442ccb3734 (diff)
downloadsystemtap-steved-1c9db4fdf66fe88a731319b99942872fa567d742.tar.gz
systemtap-steved-1c9db4fdf66fe88a731319b99942872fa567d742.tar.xz
systemtap-steved-1c9db4fdf66fe88a731319b99942872fa567d742.zip
IA64 Runtime support patches. With this in place
Systemtap should now be able to build on Ia64. Includes supports for - function probes, return probes, function parameter access and dumping stack backtrace. Added by Anil S Keshavamurthy <Anil.s.keshavamurthy@intel.com>
Diffstat (limited to 'runtime/current.c')
-rw-r--r--runtime/current.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/runtime/current.c b/runtime/current.c
index 00ddb3e1..0b2d84ad 100644
--- a/runtime/current.c
+++ b/runtime/current.c
@@ -1,3 +1,13 @@
+/* Functions to access the members of pt_regs struct
+ * Copyright (C) 2005 Red Hat Inc.
+ * Copyright (C) 2005 Intel Corporation.
+ *
+ * This file is part of systemtap, and is free software. You can
+ * redistribute it and/or modify it under the terms of the GNU General
+ * Public License (GPL); either version 2, or (at your option) any
+ * later version.
+ */
+
#ifndef _CURRENT_C_ /* -*- linux-c -*- */
#define _CURRENT_C_
@@ -31,6 +41,8 @@ unsigned long _stp_ret_addr (struct pt_regs *regs)
return regs->esp;
#elif defined (__powerpc64__)
return REG_LINK(regs);
+#elif defined (__ia64__)
+ return regs->b0;
#else
#error Unimplemented architecture
#endif
@@ -99,6 +111,36 @@ void _stp_sprint_regs(String str, struct pt_regs * regs)
_stp_sprintf(str,"CR2: %016lx CR3: %016lx CR4: %016lx\n", cr2, cr3, cr4);
}
+#elif defined (__ia64__)
+void _stp_sprint_regs(String str, struct pt_regs * regs)
+{
+ unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri;
+
+ _stp_sprintf(str, "\nPid: %d, CPU %d, comm: %20s\n", current->pid,
+ smp_processor_id(), current->comm);
+ _stp_sprintf(str, "psr : %016lx ifs : %016lx ip : [<%016lx>] \n",
+ regs->cr_ipsr, regs->cr_ifs, ip);
+ _stp_sprintf(str, "unat: %016lx pfs : %016lx rsc : %016lx\n",
+ regs->ar_unat, regs->ar_pfs, regs->ar_rsc);
+ _stp_sprintf(str, "rnat: %016lx bsps: %016lx pr : %016lx\n",
+ regs->ar_rnat, regs->ar_bspstore, regs->pr);
+ _stp_sprintf(str, "ldrs: %016lx ccv : %016lx fpsr: %016lx\n",
+ regs->loadrs, regs->ar_ccv, regs->ar_fpsr);
+ _stp_sprintf(str, "csd : %016lx ssd : %016lx\n",
+ regs->ar_csd, regs->ar_ssd);
+ _stp_sprintf(str, "b0 : %016lx b6 : %016lx b7 : %016lx\n",
+ regs->b0, regs->b6, regs->b7);
+ _stp_sprintf(str, "f6 : %05lx%016lx f7 : %05lx%016lx\n",
+ regs->f6.u.bits[1], regs->f6.u.bits[0],
+ regs->f7.u.bits[1], regs->f7.u.bits[0]);
+ _stp_sprintf(str, "f8 : %05lx%016lx f9 : %05lx%016lx\n",
+ regs->f8.u.bits[1], regs->f8.u.bits[0],
+ regs->f9.u.bits[1], regs->f9.u.bits[0]);
+ _stp_sprintf(str, "f10 : %05lx%016lx f11 : %05lx%016lx\n",
+ regs->f10.u.bits[1], regs->f10.u.bits[0],
+ regs->f11.u.bits[1], regs->f11.u.bits[0]);
+}
+
#elif defined (__i386__)
/** Write the registers to a string.