summaryrefslogtreecommitdiffstats
path: root/runtime/regs-ia64.c
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-07-10 16:39:17 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-07-18 17:47:23 -0400
commit9020300d0fca87336f84a8d40da9362735eda896 (patch)
treebc5920a41b3c4e62b2b343eb4f46ec836ded03bf /runtime/regs-ia64.c
parent6908711142cf34dc1b67d32a68a91998891af764 (diff)
downloadsystemtap-steved-9020300d0fca87336f84a8d40da9362735eda896.tar.gz
systemtap-steved-9020300d0fca87336f84a8d40da9362735eda896.tar.xz
systemtap-steved-9020300d0fca87336f84a8d40da9362735eda896.zip
PR442528
Diffstat (limited to 'runtime/regs-ia64.c')
-rw-r--r--runtime/regs-ia64.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/runtime/regs-ia64.c b/runtime/regs-ia64.c
index 66dc60f3..fd8d8ca8 100644
--- a/runtime/regs-ia64.c
+++ b/runtime/regs-ia64.c
@@ -35,6 +35,32 @@ static void ia64_stap_get_arbsp(struct unw_frame_info *info, void *arg)
lp->address = 0;
}
+/*
+ * bspcache: get cached unwound address and
+ * set a probe local cache of the offset of unwound address.
+ */
+#define bspcache(cache, regs, pp)\
+ if(regs) {\
+ static unsigned __offset = 0; /* probe local cache */\
+ static const char * __pp = NULL; /* reference probe point */\
+ unsigned long *bsp;\
+ asm volatile("{ flushrs }\n"); /* flushrs for fixing bsp */\
+ bsp = (void*)ia64_getreg(_IA64_REG_AR_BSP);\
+ if (__offset == 0) {\
+ struct ia64_stap_get_arbsp_param pa;\
+ pa.ip = regs->cr_iip;\
+ unw_init_running(ia64_stap_get_arbsp, &pa);\
+ if (pa.address != 0) {\
+ __offset = ia64_rse_num_regs(pa.address, bsp)\
+ -(regs->cr_ifs & 127);\
+ __pp = (const char *)pp;\
+ cache = pa.address;\
+ }\
+ } else if (pp == __pp)\
+ cache = ia64_rse_skip_regs(bsp,\
+ -(__offset + (regs->cr_ifs & 127)));\
+ }
+
static long ia64_fetch_register(int regno, struct pt_regs *pt_regs, unsigned long **cache)
{
struct ia64_stap_get_arbsp_param pa;
@@ -89,6 +115,10 @@ static void ia64_store_register(int regno,
return;
}
+#else /* if defined __ia64__ */
+
+#define bspcache(cache, regs, pp) do {} while(0)
+
#endif /* if defined __ia64__ */