From ba61c7bb373f1bc84fa445dcd9ebdcb2fbc72d85 Mon Sep 17 00:00:00 2001 From: Christian Jullien Date: Wed, 23 Dec 2020 20:08:26 +0100 Subject: [PATCH] NetBSD: arm64 is curiously detected as evbarm. Struct uc_mcontext is once again different. --- configure | 2 +- tccrun.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 7e814839..e6b15433 100755 --- a/configure +++ b/configure @@ -178,7 +178,7 @@ case "$cpu" in x86_64|amd64|x86-64) cpu="x86_64" ;; - aarch64|arm64) + aarch64|arm64|evbarm) cpu="aarch64" ;; arm*) diff --git a/tccrun.c b/tccrun.c index c216f747..198dd0d5 100644 --- a/tccrun.c +++ b/tccrun.c @@ -667,6 +667,9 @@ static void rt_getcontext(ucontext_t *uc, rt_context *rc) #elif defined(__aarch64__) && defined(__FreeBSD__) rc->ip = uc->uc_mcontext.mc_gpregs.gp_elr; /* aka REG_PC */ rc->fp = uc->uc_mcontext.mc_gpregs.gp_x[29]; +#elif defined(__aarch64__) && defined(__NetBSD__) + rc->ip = uc->uc_mcontext.__gregs[_REG_PC]; + rc->fp = uc->uc_mcontext.__gregs[_REG_FP]; #elif defined(__aarch64__) rc->ip = uc->uc_mcontext.pc; rc->fp = uc->uc_mcontext.regs[29];