summaryrefslogtreecommitdiffstats
path: root/arch/x86/ia32
diff options
context:
space:
mode:
authorHiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>2008-11-17 15:47:06 -0800
committerIngo Molnar <mingo@elte.hu>2008-11-18 16:55:34 +0100
commitd71a68dca54756049e0eae62458a1705bf680d09 (patch)
tree80e9e8103ebe7417185335b9d886d76fa0635324 /arch/x86/ia32
parentb78a5b5260abf90d574911e7c7b8d35d5b48d6c0 (diff)
downloadblackbird-op-linux-d71a68dca54756049e0eae62458a1705bf680d09.tar.gz
blackbird-op-linux-d71a68dca54756049e0eae62458a1705bf680d09.zip
x86: ia32_signal: introduce COPY_SEG_CPL3
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>
Diffstat (limited to 'arch/x86/ia32')
-rw-r--r--arch/x86/ia32/ia32_signal.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index 610a17774ea2..fe44c314c9c0 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -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; \
@@ -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);
OpenPOWER on IntegriCloud