diff --git a/linux-user/signal.c b/linux-user/signal.c index fe3cd58eed..3aa8590c68 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -1129,33 +1129,7 @@ setup_return(CPUState *env, struct emulated_sigaction *ka, { abi_ulong handler = ka->sa._sa_handler; abi_ulong retcode; - int thumb = 0; -#if defined(TARGET_CONFIG_CPU_32) -#if 0 - abi_ulong cpsr = env->cpsr; - - /* - * Maybe we need to deliver a 32-bit signal to a 26-bit task. - */ - if (ka->sa.sa_flags & SA_THIRTYTWO) - cpsr = (cpsr & ~MODE_MASK) | USR_MODE; - -#ifdef CONFIG_ARM_THUMB - if (elf_hwcap & HWCAP_THUMB) { - /* - * The LSB of the handler determines if we're going to - * be using THUMB or ARM mode for this signal handler. - */ - thumb = handler & 1; - - if (thumb) - cpsr |= T_BIT; - else - cpsr &= ~T_BIT; - } -#endif /* CONFIG_ARM_THUMB */ -#endif /* 0 */ -#endif /* TARGET_CONFIG_CPU_32 */ + int thumb = handler & 1; if (ka->sa.sa_flags & TARGET_SA_RESTORER) { retcode = ka->sa.sa_restorer; @@ -1178,6 +1152,7 @@ setup_return(CPUState *env, struct emulated_sigaction *ka, env->regs[13] = frame_addr; env->regs[14] = retcode; env->regs[15] = handler & (thumb ? ~1 : ~3); + env->thumb = thumb; #if 0 #ifdef TARGET_CONFIG_CPU_32 @@ -1295,7 +1270,7 @@ restore_sigcontext(CPUState *env, struct target_sigcontext *sc) __get_user_error(env->regs[15], &sc->arm_pc, err); #ifdef TARGET_CONFIG_CPU_32 __get_user_error(cpsr, &sc->arm_cpsr, err); - cpsr_write(env, cpsr, 0xffffffff); + cpsr_write(env, cpsr, CPSR_USER | CPSR_EXEC); #endif err |= !valid_user_regs(env);