Set the thumb bit in the CPSR when resuming from a signal handler to a thumb function...
authorZoltan Varga <vargaz@gmail.com>
Fri, 19 Nov 2010 00:38:36 +0000 (01:38 +0100)
committerZoltan Varga <vargaz@gmail.com>
Fri, 19 Nov 2010 00:38:36 +0000 (01:38 +0100)
mono/mini/exceptions-arm.c
mono/utils/mono-sigcontext.h

index 9477444e0875c0df2b16a3004fd846fcdee5775c..ce7f21bfb7628d96778bf14533bb84400bd20cfd 100644 (file)
@@ -509,6 +509,11 @@ mono_arch_handle_exception (void *ctx, gpointer obj, gboolean test_only)
        UCONTEXT_REG_SP (sigctx) = sp;
 
        UCONTEXT_REG_PC (sigctx) = (gsize)handle_signal_exception;
+#ifdef UCONTEXT_REG_CPSR
+       if ((gsize)UCONTEXT_REG_PC (sigctx) | 1)
+               /* Transition to thumb */
+               UCONTEXT_REG_CPSR (sigctx) |= (1 << 5);
+#endif
 
        return TRUE;
 #else
index a794a288e7f89183e375bdb7ca6f17c324c1d96f..2335f6fc8a76b3352ee9793b139658ef8eb360ba 100644 (file)
        #define UCONTEXT_REG_R10(ctx) (((arm_ucontext*)(ctx))->sig_ctx.arm_r10)
        #define UCONTEXT_REG_R11(ctx) (((arm_ucontext*)(ctx))->sig_ctx.arm_fp)
        #define UCONTEXT_REG_R12(ctx) (((arm_ucontext*)(ctx))->sig_ctx.arm_ip)
+       #define UCONTEXT_REG_CPSR(ctx) (((arm_ucontext*)(ctx))->sig_ctx.arm_cpsr)
 #endif
 #elif defined(__s390x__)