mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
Fix Thumb signal handlers.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4089 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
3b89f26c11
commit
75b680e523
1 changed files with 3 additions and 28 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue