Skip to content

Commit

Permalink
x86: ia32_signal: introduce COPY_SEG_CPL3
Browse files Browse the repository at this point in the history
Impact: cleanup

Introduce COPY_SEG_CPL3 for ia32_restore_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 18, 2008
1 parent b78a5b5 commit d71a68d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions arch/x86/ia32/ia32_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ struct rt_sigframe
err |= __get_user(regs->x, &sc->x); \
}

#define COPY_SEG_CPL3(seg) { \
unsigned short tmp; \
err |= __get_user(tmp, &sc->seg); \
regs->seg = tmp | 3; \
}

#define RELOAD_SEG(seg,mask) \
{ unsigned int cur; \
unsigned short pre; \
Expand Down Expand Up @@ -246,10 +252,8 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
COPY(dx); COPY(cx); COPY(ip);
/* Don't touch extended registers */

err |= __get_user(regs->cs, &sc->cs);
regs->cs |= 3;
err |= __get_user(regs->ss, &sc->ss);
regs->ss |= 3;
COPY_SEG_CPL3(cs);
COPY_SEG_CPL3(ss);

err |= __get_user(tmpflags, &sc->flags);
regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);
Expand Down

0 comments on commit d71a68d

Please sign in to comment.