Skip to content

Commit

Permalink
x86: ia32_signal: do save_i387_xstate_ia32 at get_sigframe()
Browse files Browse the repository at this point in the history
Impact: cleanup

move calling save_i387_xstate_ia32() into get_sigframe() from
setup_sigcontext().

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Hiroshi Shimamoto authored and Ingo Molnar committed Nov 6, 2008
1 parent 4b33669 commit 99ea1b9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions arch/x86/ia32/ia32_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,7 @@ static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc,
err |= __put_user(regs->flags, &sc->flags);
err |= __put_user(regs->sp, &sc->sp_at_signal);

tmp = save_i387_xstate_ia32(fpstate);
if (tmp < 0)
err = -EFAULT;
else
err |= __put_user(ptr_to_compat(tmp ? fpstate : NULL),
&sc->fpstate);
err |= __put_user(ptr_to_compat(fpstate), &sc->fpstate);

/* non-iBCS2 extensions.. */
err |= __put_user(mask, &sc->oldmask);
Expand Down Expand Up @@ -408,6 +403,8 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
if (used_math()) {
sp = sp - sig_xstate_ia32_size;
*fpstate = (struct _fpstate_ia32 *) sp;
if (save_i387_xstate_ia32(*fpstate) < 0)
return (void __user *) -1L;
}

sp -= frame_size;
Expand Down

0 comments on commit 99ea1b9

Please sign in to comment.