Commit d71a68dc authored by Hiroshi Shimamoto's avatar Hiroshi Shimamoto Committed by Ingo Molnar

x86: ia32_signal: introduce COPY_SEG_CPL3

Impact: cleanup

Introduce COPY_SEG_CPL3 for ia32_restore_sigcontext().
Signed-off-by: default avatarHiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent b78a5b52
...@@ -201,6 +201,12 @@ struct rt_sigframe ...@@ -201,6 +201,12 @@ struct rt_sigframe
err |= __get_user(regs->x, &sc->x); \ 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) \ #define RELOAD_SEG(seg,mask) \
{ unsigned int cur; \ { unsigned int cur; \
unsigned short pre; \ unsigned short pre; \
...@@ -246,10 +252,8 @@ static int ia32_restore_sigcontext(struct pt_regs *regs, ...@@ -246,10 +252,8 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
COPY(dx); COPY(cx); COPY(ip); COPY(dx); COPY(cx); COPY(ip);
/* Don't touch extended registers */ /* Don't touch extended registers */
err |= __get_user(regs->cs, &sc->cs); COPY_SEG_CPL3(cs);
regs->cs |= 3; COPY_SEG_CPL3(ss);
err |= __get_user(regs->ss, &sc->ss);
regs->ss |= 3;
err |= __get_user(tmpflags, &sc->flags); err |= __get_user(tmpflags, &sc->flags);
regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);
......
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