diff --git a/configure.in b/configure.in index b7cf4bbe55b29b6d1c58ffeb16fd3c3ed773bae3..25f6c01fbf78706a70dc9f04c97a55e1f975a48a 100644 --- a/configure.in +++ b/configure.in @@ -2129,7 +2129,7 @@ case "$host" in haiku*) LIBC=libroot.so ;; - linux*|darwin*) + linux*|darwin*|openbsd*) sgen_supported=true ;; esac @@ -2140,7 +2140,7 @@ case "$host" in JIT_SUPPORTED=yes jit_wanted=true case $host_os in - linux*|darwin*) + linux*|darwin*|openbsd*) sgen_supported=true ;; esac diff --git a/mono/metadata/sgen-gc.c b/mono/metadata/sgen-gc.c index 4d85cc1550d97378414c20a0489d5e83ad9505e0..57347476d5a0461c69e01eeba8ab1da630af36e3 100644 --- a/mono/metadata/sgen-gc.c +++ b/mono/metadata/sgen-gc.c @@ -4565,11 +4565,12 @@ suspend_handler (int sig, siginfo_t *siginfo, void *context) int old_errno = errno; gpointer regs [ARCH_NUM_REGS]; gpointer stack_start; + ucontext_t *ctx = (ucontext_t*)context; id = pthread_self (); info = mono_sgen_thread_info_lookup (id); info->stopped_domain = mono_domain_get (); - info->stopped_ip = (gpointer) ARCH_SIGCTX_IP (context); + info->stopped_ip = (gpointer) ARCH_SIGCTX_IP (ctx); stop_count = global_stop_count; /* duplicate signal */ if (0 && info->stop_count == stop_count) { @@ -4580,13 +4581,13 @@ suspend_handler (int sig, siginfo_t *siginfo, void *context) /* update the remset info in the thread data structure */ info->remset = remembered_set; #endif - stack_start = (char*) ARCH_SIGCTX_SP (context) - REDZONE_SIZE; + stack_start = (char*) ARCH_SIGCTX_SP (ctx) - REDZONE_SIZE; /* If stack_start is not within the limits, then don't set it in info and we will be restarted. */ if (stack_start >= info->stack_start_limit && info->stack_start <= info->stack_end) { info->stack_start = stack_start; - ARCH_COPY_SIGCTX_REGS (regs, context); + ARCH_COPY_SIGCTX_REGS (regs, ctx); info->stopped_regs = regs; } else { g_assert (!info->stack_start); @@ -4594,7 +4595,7 @@ suspend_handler (int sig, siginfo_t *siginfo, void *context) /* Notify the JIT */ if (gc_callbacks.thread_suspend_func) - gc_callbacks.thread_suspend_func (info->runtime_data, context); + gc_callbacks.thread_suspend_func (info->runtime_data, ctx); DEBUG (4, fprintf (gc_debug_file, "Posting suspend_ack_semaphore for suspend from %p %p\n", info, (gpointer)ARCH_GET_THREAD ())); /* notify the waiting thread */ diff --git a/mono/metadata/sgen-gc.h b/mono/metadata/sgen-gc.h index b16e0ebdcdd39daaf5d8344fd7c355e1d1c256e4..f41fc1d32e30dd119bff818dac8701ff9eafdf4e 100644 --- a/mono/metadata/sgen-gc.h +++ b/mono/metadata/sgen-gc.h @@ -178,7 +178,7 @@ struct _GCMemSection { typedef struct _SgenPinnedChunk SgenPinnedChunk; -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__OpenBSD__) const static int suspend_signal_num = SIGXFSZ; #else const static int suspend_signal_num = SIGPWR; diff --git a/mono/utils/mono-sigcontext.h b/mono/utils/mono-sigcontext.h index 634cb2fa3c92c2db60cf8102fe23bd0875101498..5c8a57a450a18a26fabc1fa62ad82fd927b5388c 100644 --- a/mono/utils/mono-sigcontext.h +++ b/mono/utils/mono-sigcontext.h @@ -112,6 +112,10 @@ #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_R8(ctx) ((ctx)->sc_r8) + #define UCONTEXT_REG_R9(ctx) ((ctx)->sc_r9) + #define UCONTEXT_REG_R10(ctx) ((ctx)->sc_r10) + #define UCONTEXT_REG_R11(ctx) ((ctx)->sc_r11) #define UCONTEXT_REG_R12(ctx) ((ctx)->sc_r12) #define UCONTEXT_REG_R13(ctx) ((ctx)->sc_r13) #define UCONTEXT_REG_R14(ctx) ((ctx)->sc_r14)