diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2010-11-24 15:20:08 +0000 |
---|---|---|
committer | Riku Voipio <riku.voipio@nokia.com> | 2010-12-03 15:09:39 +0200 |
commit | a59d69da66da551fa078e05ff08cf535b768c308 (patch) | |
tree | a5fb1684643f4fd35343e83b2918adee47cd410f /linux-user | |
parent | 08e11256f6a0caae9b8f18fb6a71359b590d97c6 (diff) |
ARM: linux-user: Restore iWMMXT state from ucontext on sigreturn
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/signal.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/linux-user/signal.c b/linux-user/signal.c index b4b610bd18..c846b8c7d4 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -1602,6 +1602,30 @@ static abi_ulong *restore_sigframe_v2_vfp(CPUState *env, abi_ulong *regspace) return (abi_ulong*)(vfpframe + 1); } +static abi_ulong *restore_sigframe_v2_iwmmxt(CPUState *env, abi_ulong *regspace) +{ + int i; + abi_ulong magic, sz; + struct target_iwmmxt_sigframe *iwmmxtframe; + iwmmxtframe = (struct target_iwmmxt_sigframe *)regspace; + + __get_user(magic, &iwmmxtframe->magic); + __get_user(sz, &iwmmxtframe->size); + if (magic != TARGET_IWMMXT_MAGIC || sz != sizeof(*iwmmxtframe)) { + return 0; + } + for (i = 0; i < 16; i++) { + __get_user(env->iwmmxt.regs[i], &iwmmxtframe->regs[i]); + } + __get_user(env->vfp.xregs[ARM_IWMMXT_wCSSF], &iwmmxtframe->wcssf); + __get_user(env->vfp.xregs[ARM_IWMMXT_wCASF], &iwmmxtframe->wcssf); + __get_user(env->vfp.xregs[ARM_IWMMXT_wCGR0], &iwmmxtframe->wcgr0); + __get_user(env->vfp.xregs[ARM_IWMMXT_wCGR1], &iwmmxtframe->wcgr1); + __get_user(env->vfp.xregs[ARM_IWMMXT_wCGR2], &iwmmxtframe->wcgr2); + __get_user(env->vfp.xregs[ARM_IWMMXT_wCGR3], &iwmmxtframe->wcgr3); + return (abi_ulong*)(iwmmxtframe + 1); +} + static int do_sigframe_return_v2(CPUState *env, target_ulong frame_addr, struct target_ucontext_v2 *uc) { @@ -1622,6 +1646,12 @@ static int do_sigframe_return_v2(CPUState *env, target_ulong frame_addr, return 1; } } + if (arm_feature(env, ARM_FEATURE_IWMMXT)) { + regspace = restore_sigframe_v2_iwmmxt(env, regspace); + if (!regspace) { + return 1; + } + } if (do_sigaltstack(frame_addr + offsetof(struct target_ucontext_v2, tuc_stack), 0, get_sp_from_cpustate(env)) == -EFAULT) return 1; |