$OpenBSD: patch-mono_utils_mono-sigcontext_h,v 1.4 2010/04/28 17:06:26 robert Exp $
--- mono/utils/mono-sigcontext.h.orig	Tue Apr 27 10:09:07 2010
+++ mono/utils/mono-sigcontext.h	Tue Apr 27 10:09:37 2010
@@ -80,6 +80,21 @@
 
 #ifdef __FreeBSD__
 #define UCONTEXT_GREGS(ctx)	&(((ucontext_t*)(ctx))->uc_mcontext)
+#elif defined(__OpenBSD__)
+	/* OpenBSD/amd64 has no gregs array, ucontext_t == sigcontext */
+	#define UCONTEXT_REG_RAX(ctx) ((ctx)->sc_rax)
+	#define UCONTEXT_REG_RBX(ctx) ((ctx)->sc_rbx)
+	#define UCONTEXT_REG_RCX(ctx) ((ctx)->sc_rcx)
+	#define UCONTEXT_REG_RDX(ctx) ((ctx)->sc_rdx)
+	#define UCONTEXT_REG_RBP(ctx) ((ctx)->sc_rbp)
+	#define UCONTEXT_REG_RSP(ctx) ((ctx)->sc_rsp)
+	#define UCONTEXT_REG_RSI(ctx) ((ctx)->sc_rsi)
+	#define UCONTEXT_REG_RDI(ctx) ((ctx)->sc_rdi)
+	#define UCONTEXT_REG_RIP(ctx) ((ctx)->sc_rip)
+	#define UCONTEXT_REG_R12(ctx) ((ctx)->sc_r12)
+	#define UCONTEXT_REG_R13(ctx) ((ctx)->sc_r13)
+	#define UCONTEXT_REG_R14(ctx) ((ctx)->sc_r14)
+	#define UCONTEXT_REG_R15(ctx) ((ctx)->sc_r15)
 #else
 #define UCONTEXT_GREGS(ctx)	&(((ucontext_t*)(ctx))->uc_mcontext.gregs)
 #endif
