aboutsummaryrefslogtreecommitdiff
path: root/tccrun.c
diff options
context:
space:
mode:
authorEdmund Grimley Evans <Edmund.Grimley.Evans@gmail.com>2015-02-13 18:58:31 +0000
committerEdmund Grimley Evans <Edmund.Grimley.Evans@gmail.com>2015-02-23 22:51:03 +0000
commitb14ef0e24bcb70d70360690130b2bf2a0c8f8d33 (patch)
tree11faa1933ceaaba6ffd6975d57eec9d58f4a7cb1 /tccrun.c
parent738606dbd5608cb2ed6789beecea40712809c397 (diff)
downloadtinycc-b14ef0e24bcb70d70360690130b2bf2a0c8f8d33.tar.gz
tinycc-b14ef0e24bcb70d70360690130b2bf2a0c8f8d33.tar.bz2
Add arm64 (AArch64) as a target architecture.
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()