diff options
author | mikael <mikael@FreeBSD.org> | 2022-03-23 10:07:49 +0100 |
---|---|---|
committer | Dave Watson <dade.watson@gmail.com> | 2022-05-22 11:02:22 -0700 |
commit | d3583edb22b84cf8fe46c0d6b2e5454b453f4acc (patch) | |
tree | 3188b2345ea4805a49461f2e1015a70db35481d8 /include | |
parent | 1f09d917a4d0da9b3b54f17f669ee0a190dbb14e (diff) | |
download | libunwind-d3583edb22b84cf8fe46c0d6b2e5454b453f4acc.tar.gz |
Fix for FreeBSD aarch64
Diffstat (limited to 'include')
-rw-r--r-- | include/libunwind-aarch64.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/libunwind-aarch64.h b/include/libunwind-aarch64.h index 3cb01348..0abe67a1 100644 --- a/include/libunwind-aarch64.h +++ b/include/libunwind-aarch64.h @@ -225,15 +225,24 @@ typedef struct #else /* On AArch64, we can directly use ucontext_t as the unwind context. */ typedef ucontext_t unw_tdep_context_t; +#if defined(__FreeBSD__) +typedef ucontext_t unw_fpsimd_context_t; +#endif #endif #include "libunwind-common.h" #include "libunwind-dynamic.h" +#if defined(__FreeBSD__) +#define UNW_BASE register uint64_t unw_base __asm__ ("x0") = (uint64_t) unw_ctx->uc_mcontext.mc_gpregs.gp_x[0]; +#else +#define UNW_BASE register uint64_t unw_base __asm__ ("x0") = (uint64_t) unw_ctx->uc_mcontext.regs; +#endif + #define unw_tdep_getcontext(uc) ({ \ unw_tdep_context_t *unw_ctx = (uc); \ - register uint64_t unw_base __asm__ ("x0") = (uint64_t) unw_ctx->uc_mcontext.regs; \ + UNW_BASE \ __asm__ __volatile__ ( \ "stp x0, x1, [%[base], #0]\n" \ "stp x2, x3, [%[base], #16]\n" \ |