Commit 5a63215b authored by Alexander Kartashov's avatar Alexander Kartashov Committed by Pavel Emelyanov

arm: restore the VFP sigframe field fpscr properly

The routine restore_fpu() contains two bugs:

1) it reads more bytes from the array ThreadInfoArm::fpstate::vfp_regs
   than it actually containes;

2) the value of the field ThreadInfoArm::fpstate::fpscr is dropped
   on the floor.
Signed-off-by: 's avatarAlexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent e89af96d
......@@ -192,10 +192,9 @@ void arch_free_thread_info(CoreEntry *core)
int restore_fpu(struct rt_sigframe *sigframe, CoreEntry *core)
{
struct aux_sigframe *aux = (struct aux_sigframe *)&sigframe->sig.uc.uc_regspace;
fpu_state_t *fpu_state = &sigframe->fpu_state;
memcpy(&aux->vfp.ufp, CORE_THREAD_ARCH_INFO(core)->fpstate->vfp_regs, sizeof(aux->vfp.ufp));
fpu_state->ufp.fpscr = CORE_THREAD_ARCH_INFO(core)->fpstate->fpscr;
memcpy(&aux->vfp.ufp.fpregs, CORE_THREAD_ARCH_INFO(core)->fpstate->vfp_regs, sizeof(aux->vfp.ufp.fpregs));
aux->vfp.ufp.fpscr = CORE_THREAD_ARCH_INFO(core)->fpstate->fpscr;
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment