Enable MONO_ARCH_HAS_MONO_CONTEXT on mingw.
authorZoltan Varga <vargaz@gmail.com>
Sun, 11 Aug 2013 20:40:44 +0000 (22:40 +0200)
committerZoltan Varga <vargaz@gmail.com>
Sun, 11 Aug 2013 20:46:00 +0000 (22:46 +0200)
mono/metadata/sgen-os-win32.c
mono/utils/mono-context.h [changed mode: 0644->0755]

index a476c73d3b047c77733a1b84020b5ba523247b08..760e3eb3cf7e84bc33db01d858d52d8de745e099 100755 (executable)
@@ -60,6 +60,17 @@ sgen_suspend_thread (SgenThreadInfo *info)
        info->stopped_ip = (gpointer)context.Eip;
        info->stack_start = (char*)context.Esp - REDZONE_SIZE;
 
+#ifdef USE_MONO_CTX
+       memset (&info->ctx, 0, sizeof (MonoContext));
+       info->ctx.edi = context.Edi;
+       info->ctx.esi = context.Esi;
+       info->ctx.ebx = context.Ebx;
+       info->ctx.edx = context.Edx;
+       info->ctx.ecx = context.Ecx;
+       info->ctx.eax = context.Eax;
+       info->ctx.ebp = context.Ebp;
+       info->ctx.esp = context.Esp;
+#else
        info->regs [0] = context.Edi;
        info->regs [1] = context.Esi;
        info->regs [2] = context.Ebx;
@@ -68,6 +79,7 @@ sgen_suspend_thread (SgenThreadInfo *info)
        info->regs [5] = context.Eax;
        info->regs [6] = context.Ebp;
        info->regs [7] = context.Esp;
+#endif
 
        /* Notify the JIT */
        if (mono_gc_get_gc_callbacks ()->thread_suspend_func)
old mode 100644 (file)
new mode 100755 (executable)
index 43ceb84..e7d5ebd
@@ -121,7 +121,7 @@ typedef struct {
        : "a" (&(ctx))  \
        : "memory")
 
-#if !defined(HOST_WIN32)
+#ifndef _MSC_VER
 #define MONO_ARCH_HAS_MONO_CONTEXT 1
 #endif