From: Zoltan Varga Date: Fri, 19 Nov 2010 00:38:36 +0000 (+0100) Subject: Set the thumb bit in the CPSR when resuming from a signal handler to a thumb function... X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=9458c05d903c867695e17422617a5d2f922cda26;p=mono.git Set the thumb bit in the CPSR when resuming from a signal handler to a thumb function on arm. --- diff --git a/mono/mini/exceptions-arm.c b/mono/mini/exceptions-arm.c index 9477444e087..ce7f21bfb76 100644 --- a/mono/mini/exceptions-arm.c +++ b/mono/mini/exceptions-arm.c @@ -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 diff --git a/mono/utils/mono-sigcontext.h b/mono/utils/mono-sigcontext.h index a794a288e7f..2335f6fc8a7 100644 --- a/mono/utils/mono-sigcontext.h +++ b/mono/utils/mono-sigcontext.h @@ -244,6 +244,7 @@ #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__)