View | Details | Raw Unified | Return to bug 262447 | Differences between
and this patch

Collapse All | Expand All

(-)b/devel/libunwind/files/patch-include_libunwind-aarch64.h (+28 lines)
Added Link Here
1
--- include/libunwind-aarch64.h.orig	2021-12-01 00:46:39 UTC
2
+++ include/libunwind-aarch64.h
3
@@ -226,15 +226,24 @@ typedef struct
4
 #else
5
 /* On AArch64, we can directly use ucontext_t as the unwind context.  */
6
 typedef ucontext_t unw_tdep_context_t;
7
+#if defined(__FreeBSD__)
8
+typedef ucontext_t unw_fpsimd_context_t;
9
 #endif
10
+#endif
11
 
12
 
13
 #include "libunwind-common.h"
14
 #include "libunwind-dynamic.h"
15
 
16
+#if defined(__FreeBSD__)
17
+#define UNW_BASE register uint64_t unw_base __asm__ ("x0") = (uint64_t) unw_ctx->uc_mcontext.mc_gpregs.gp_x[0];
18
+#else
19
+#define UNW_BASE register uint64_t unw_base __asm__ ("x0") = (uint64_t) unw_ctx->uc_mcontext.regs;
20
+#endif
21
+
22
 #define unw_tdep_getcontext(uc) ({					\
23
   unw_tdep_context_t *unw_ctx = (uc);					\
24
-  register uint64_t unw_base __asm__ ("x0") = (uint64_t) unw_ctx->uc_mcontext.regs; \
25
+  UNW_BASE \
26
   __asm__ __volatile__ (					        \
27
      "stp x0, x1, [%[base], #0]\n" \
28
      "stp x2, x3, [%[base], #16]\n" \
(-)b/devel/libunwind/files/patch-src_aarch64_Ginit.c (+20 lines)
Added Link Here
1
--- src/aarch64/Ginit.c.orig	2021-11-30 17:12:31 UTC
2
+++ src/aarch64/Ginit.c
3
@@ -47,9 +47,17 @@ static inline void *
4
 uc_addr (unw_tdep_context_t *uc, int reg)
5
 {
6
   if (reg >= UNW_AARCH64_X0 && reg < UNW_AARCH64_V0)
7
+#if defined(__FreeBSD__)
8
+    return &uc->uc_mcontext.mc_gpregs.gp_x[reg];
9
+#else
10
     return &uc->uc_mcontext.regs[reg];
11
+#endif
12
   else if (reg >= UNW_AARCH64_V0 && reg <= UNW_AARCH64_V31)
13
+#if defined(__FreeBSD__)
14
+    return &GET_FPCTX(uc)->uc_mcontext.mc_fpregs.fp_q[reg - UNW_AARCH64_V0];
15
+#else
16
     return &GET_FPCTX(uc)->vregs[reg - UNW_AARCH64_V0];
17
+#endif
18
   else
19
     return NULL;
20
 }
(-)b/devel/libunwind/files/patch-src_aarch64_unwind__i.h (-1 / +13 lines)
Added Link Here
0
- 
1
--- src/aarch64/unwind_i.h.orig	2020-04-28 15:49:14 UTC
2
+++ src/aarch64/unwind_i.h
3
@@ -59,6 +59,10 @@ extern int aarch64_local_resume (unw_addr_space_t as, 
4
   } while (0)
5
 #endif
6
 
7
+#if defined(__FreeBSD__)
8
+#define GET_FPCTX(uc) ((unw_tdep_context_t *)(&uc->uc_mcontext.mc_spare))
9
+#else
10
 #define GET_FPCTX(uc) ((unw_fpsimd_context_t *)(&uc->uc_mcontext.__reserved))
11
+#endif
12
 
13
 #endif /* unwind_i_h */

Return to bug 262447