aboutsummaryrefslogtreecommitdiff
path: root/linux-user/signal.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-21 16:07:30 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-21 16:07:30 +0000
commit75b680e5234d7641105919a2a47079e9a0d5d800 (patch)
tree557eb66182ecd1709831f1f52d9209ba7cccf993 /linux-user/signal.c
parent3b89f26c11e4060a203518d8bc203b6fb0b6cf96 (diff)
Fix Thumb signal handlers.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4089 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/signal.c')
-rw-r--r--linux-user/signal.c31
1 files changed, 3 insertions, 28 deletions
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);