summaryrefslogtreecommitdiffstats
path: root/runtime/regs.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/regs.c')
-rw-r--r--runtime/regs.c53
1 files changed, 8 insertions, 45 deletions
diff --git a/runtime/regs.c b/runtime/regs.c
index 81b865b1..e963affa 100644
--- a/runtime/regs.c
+++ b/runtime/regs.c
@@ -23,43 +23,6 @@
* @{
*/
-
-/** Get the current return address.
- * Call from kprobes (not jprobes).
- * @param regs The pt_regs saved by the kprobe.
- * @return The return address saved in the stack pointer.
- * @note i386 and x86_64 only so far.
- */
-
-unsigned long _stp_ret_addr (struct pt_regs *regs)
-{
-#if defined (STAPCONF_X86_UNIREGS) && (defined (__x86_64__) || defined (__i386__))
- unsigned long *ra = (unsigned long *)regs->sp;
- if (ra)
- return *ra;
- else
- return 0;
-#elif defined (__x86_64__)
- unsigned long *ra = (unsigned long *)regs->rsp;
- if (ra)
- return *ra;
- else
- return 0;
-#elif defined (__i386__)
- return regs->esp;
-#elif defined (__powerpc64__) || defined (__arm__)
- return REG_LINK(regs);
-#elif defined (__ia64__)
- return regs->b0;
-#elif defined (__s390__) || defined (__s390x__)
- return regs->gprs[14];
-#elif defined (__arm__)
- return regs->ARM_r0;
-#else
- #error Unimplemented architecture
-#endif
-}
-
/** Get the current return address for a return probe.
* Call from kprobe return probe.
* @param ri Pointer to the struct kretprobe_instance.
@@ -85,7 +48,7 @@ unsigned long _stp_ret_addr (struct pt_regs *regs)
#if defined (STAPCONF_X86_UNIREGS) && defined (__x86_64__)
-void _stp_print_regs(struct pt_regs * regs)
+static void _stp_print_regs(struct pt_regs * regs)
{
unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L, fs, gs, shadowgs;
unsigned int fsindex,gsindex;
@@ -126,7 +89,7 @@ void _stp_print_regs(struct pt_regs * regs)
#elif defined (STAPCONF_X86_UNIREGS) && defined (__i386__)
-void _stp_print_regs(struct pt_regs * regs)
+static void _stp_print_regs(struct pt_regs * regs)
{
unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
@@ -153,7 +116,7 @@ void _stp_print_regs(struct pt_regs * regs)
}
#elif defined (__x86_64__)
-void _stp_print_regs(struct pt_regs * regs)
+static void _stp_print_regs(struct pt_regs * regs)
{
unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L, fs, gs, shadowgs;
unsigned int fsindex,gsindex;
@@ -193,7 +156,7 @@ void _stp_print_regs(struct pt_regs * regs)
}
#elif defined (__ia64__)
-void _stp_print_regs(struct pt_regs * regs)
+static void _stp_print_regs(struct pt_regs * regs)
{
unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri;
@@ -228,7 +191,7 @@ void _stp_print_regs(struct pt_regs * regs)
* @param regs The pt_regs saved by the kprobe.
* @note i386 and x86_64 only so far.
*/
-void _stp_print_regs(struct pt_regs * regs)
+static void _stp_print_regs(struct pt_regs * regs)
{
unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
@@ -263,7 +226,7 @@ static int _stp_probing_32bit_app(struct pt_regs *regs)
return (user_mode(regs) && test_tsk_thread_flag(current, TIF_32BIT));
}
-void _stp_print_regs(struct pt_regs * regs)
+static void _stp_print_regs(struct pt_regs * regs)
{
int i;
@@ -302,7 +265,7 @@ static const char *processor_modes[]=
};
-void _stp_print_regs(struct pt_regs * regs)
+static void _stp_print_regs(struct pt_regs * regs)
{
unsigned long flags = condition_codes(regs);
@@ -365,7 +328,7 @@ void _stp_print_regs(struct pt_regs * regs)
#define GPRSIZE "%08lX "
#endif
-void _stp_print_regs(struct pt_regs * regs)
+static void _stp_print_regs(struct pt_regs * regs)
{
char *mode;
int i;