Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Wildt <mail@patrick-wildt.de>2021-06-10 15:57:10 +0300
committerGitHub <noreply@github.com>2021-06-10 15:57:10 +0300
commit804b0c516b08442daf2ef9bcde981a510f6b1596 (patch)
tree2a1edba228c8069770cc908f397e4b85c4cb1dad
parent4208c224955a4959b17fd68d0c8ae1db19f0dc46 (diff)
Add support for OpenBSD/arm64 (#21015)
Provide the UCONTEXT macros, which for OpenBSD simply map to sigcontext.
-rw-r--r--mono/utils/mono-sigcontext.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/mono/utils/mono-sigcontext.h b/mono/utils/mono-sigcontext.h
index 72aa7619c40..b4cd08d2910 100644
--- a/mono/utils/mono-sigcontext.h
+++ b/mono/utils/mono-sigcontext.h
@@ -485,6 +485,12 @@ typedef struct ucontext {
#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))
+#elif defined(__OpenBSD__)
+ /* ucontext_t == sigcontext */
+ #define UCONTEXT_REG_PC(ctx) (((ucontext_t*)(ctx))->sc_elr)
+ #define UCONTEXT_REG_SP(ctx) (((ucontext_t*)(ctx))->sc_sp)
+ #define UCONTEXT_REG_R0(ctx) (((ucontext_t*)(ctx))->sc_x [ARMREG_R0])
+ #define UCONTEXT_GREGS(ctx) (&(((ucontext_t*)(ctx))->sc_x))
#elif !defined(HOST_WIN32)
#include <ucontext.h>
#define UCONTEXT_REG_PC(ctx) (((ucontext_t*)(ctx))->uc_mcontext.pc)