summaryrefslogtreecommitdiff
path: root/lang/mono/files/patch-mono_utils_mono-sigcontext.h
diff options
context:
space:
mode:
Diffstat (limited to 'lang/mono/files/patch-mono_utils_mono-sigcontext.h')
-rw-r--r--lang/mono/files/patch-mono_utils_mono-sigcontext.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/lang/mono/files/patch-mono_utils_mono-sigcontext.h b/lang/mono/files/patch-mono_utils_mono-sigcontext.h
index 22cf2458435d..f208802581d0 100644
--- a/lang/mono/files/patch-mono_utils_mono-sigcontext.h
+++ b/lang/mono/files/patch-mono_utils_mono-sigcontext.h
@@ -15,3 +15,17 @@
#endif
#elif defined(TARGET_ARM)
+@@ -460,6 +460,13 @@ typedef struct ucontext {
+ #define UCONTEXT_REG_SP(ctx) (((ucontext64_t*)(ctx))->uc_mcontext64->__ss.__sp)
+ #define UCONTEXT_REG_R0(ctx) (((ucontext64_t*)(ctx))->uc_mcontext64->__ss.__x [ARMREG_R0])
+ #define UCONTEXT_GREGS(ctx) (&(((ucontext64_t*)(ctx))->uc_mcontext64->__ss.__x))
++#elif defined(__FreeBSD__)
++#include <ucontext.h>
++ /* https://lists.freebsd.org/pipermail/freebsd-arm/2017-February/015611.html */
++ #define UCONTEXT_REG_PC(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_gpregs.gp_elr)
++ #define UCONTEXT_REG_SP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_gpregs.gp_sp)
++ #define UCONTEXT_REG_R0(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_gpregs.gp_x [ARMREG_R0])
++ #define UCONTEXT_GREGS(ctx) (&(((ucontext_t*)(ctx))->uc_mcontext.mc_gpregs.gp_x))
+ #else
+ #include <ucontext.h>
+ #define UCONTEXT_REG_PC(ctx) (((ucontext_t*)(ctx))->uc_mcontext.pc)