aboutsummaryrefslogtreecommitdiff
path: root/tccrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'tccrun.c')
-rw-r--r--tccrun.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tccrun.c b/tccrun.c
index 13c2012..264322b 100644
--- a/tccrun.c
+++ b/tccrun.c
@@ -605,6 +605,27 @@ static int rt_get_caller_pc(addr_t *paddr, ucontext_t *uc, int level)
}
/* ------------------------------------------------------------- */
+#elif defined(__aarch64__)
+
+static int rt_get_caller_pc(addr_t *paddr, ucontext_t *uc, int level)
+{
+ if (level < 0)
+ return -1;
+ else if (level == 0) {
+ *paddr = uc->uc_mcontext.pc;
+ return 0;
+ }
+ else {
+ addr_t *fp = (addr_t *)uc->uc_mcontext.regs[29];
+ int i;
+ for (i = 1; i < level; i++)
+ fp = (addr_t *)fp[0];
+ *paddr = fp[1];
+ return 0;
+ }
+}
+
+/* ------------------------------------------------------------- */
#else
#warning add arch specific rt_get_caller_pc()