提交 d8e16698 编写于 作者: R Robert Nagy 提交者: Zoltan Varga

Make sgen compile on OpenBSD, by adding the missing stuff

上级 f76a4bf8
......@@ -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
......
......@@ -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 */
......
......@@ -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;
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册