* Copyright 2003-2008 Ximian, Inc.
*
* See LICENSE for licensing information.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include <config.h>
#include <signal.h>
#include <mono/metadata/mono-config.h>
#include <mono/metadata/environment.h>
#include <mono/metadata/mono-debug.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
#include <mono/metadata/threads-types.h>
#include <mono/metadata/verify.h>
#include <mono/metadata/verify-internals.h>
#include <mono/utils/mono-math.h>
#include <mono/utils/mono-compiler.h>
#include <mono/utils/mono-counters.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
#include <mono/utils/mono-mmap.h>
#include <mono/utils/dtrace.h>
#include "jit-icalls.h"
+#ifdef _WIN32
+#include <mmsystem.h>
+#endif
+
void
mono_runtime_install_handlers (void)
{
#ifndef MONO_CROSS_COMPILE
- win32_seh_init();
- win32_seh_set_handler(SIGFPE, mono_sigfpe_signal_handler);
- win32_seh_set_handler(SIGILL, mono_sigill_signal_handler);
- win32_seh_set_handler(SIGSEGV, mono_sigsegv_signal_handler);
- if (mini_get_debug_options ()->handle_sigint)
- win32_seh_set_handler(SIGINT, mono_sigint_signal_handler);
+ if (!mono_aot_only) {
+ win32_seh_init();
+ win32_seh_set_handler(SIGFPE, mono_sigfpe_signal_handler);
+ win32_seh_set_handler(SIGILL, mono_sigill_signal_handler);
+ win32_seh_set_handler(SIGSEGV, mono_sigsegv_signal_handler);
+ if (mini_get_debug_options ()->handle_sigint)
+ win32_seh_set_handler(SIGINT, mono_sigint_signal_handler);
+ }
#endif
}
mono_runtime_cleanup_handlers (void)
{
#ifndef MONO_CROSS_COMPILE
- win32_seh_cleanup();
+ if (!mono_aot_only) {
+ win32_seh_cleanup();
+ }
#endif
}
* was called, false otherwise.
*/
gboolean
-SIG_HANDLER_SIGNATURE (mono_chain_signal)
+MONO_SIG_HANDLER_SIGNATURE (mono_chain_signal)
{
MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
jit_tls->mono_win_chained_exception_needs_run = TRUE;
ctx = &tctx->ctx;
memset (ctx, 0, sizeof (MonoContext));
-#ifdef TARGET_AMD64
- ctx->rip = context.Rip;
- ctx->rax = context.Rax;
- ctx->rcx = context.Rcx;
- ctx->rdx = context.Rdx;
- ctx->rbx = context.Rbx;
- ctx->rsp = context.Rsp;
- ctx->rbp = context.Rbp;
- ctx->rsi = context.Rsi;
- ctx->rdi = context.Rdi;
- ctx->r8 = context.R8;
- ctx->r9 = context.R9;
- ctx->r10 = context.R10;
- ctx->r11 = context.R11;
- ctx->r12 = context.R12;
- ctx->r13 = context.R13;
- ctx->r14 = context.R14;
- ctx->r15 = context.R15;
-#else
- ctx->edi = context.Edi;
- ctx->esi = context.Esi;
- ctx->ebx = context.Ebx;
- ctx->edx = context.Edx;
- ctx->ecx = context.Ecx;
- ctx->eax = context.Eax;
- ctx->ebp = context.Ebp;
- ctx->esp = context.Esp;
-#endif
+ mono_sigctx_to_monoctx (&context, ctx);
/* mono_set_jit_tls () sets this */
jit_tls = mono_thread_info_tls_get (info, TLS_KEY_JIT_TLS);