aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/ia32
diff options
context:
space:
mode:
authorHiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>2008-11-17 18:47:06 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-18 10:55:34 -0500
commitd71a68dca54756049e0eae62458a1705bf680d09 (patch)
tree80e9e8103ebe7417185335b9d886d76fa0635324 /arch/x86/ia32
parentb78a5b5260abf90d574911e7c7b8d35d5b48d6c0 (diff)
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
201 err |= __get_user(regs->x, &sc->x); \ 201 err |= __get_user(regs->x, &sc->x); \
202} 202}
203 203
204#define COPY_SEG_CPL3(seg) { \
205 unsigned short tmp; \
206 err |= __get_user(tmp, &sc->seg); \
207 regs->seg = tmp | 3; \
208}
209
204#define RELOAD_SEG(seg,mask) \ 210#define RELOAD_SEG(seg,mask) \
205 { unsigned int cur; \ 211 { unsigned int cur; \
206 unsigned short pre; \ 212 unsigned short pre; \
@@ -246,10 +252,8 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
246 COPY(dx); COPY(cx); COPY(ip); 252 COPY(dx); COPY(cx); COPY(ip);
247 /* Don't touch extended registers */ 253 /* Don't touch extended registers */
248 254
249 err |= __get_user(regs->cs, &sc->cs); 255 COPY_SEG_CPL3(cs);
250 regs->cs |= 3; 256 COPY_SEG_CPL3(ss);
251 err |= __get_user(regs->ss, &sc->ss);
252 regs->ss |= 3;
253 257
254 err |= __get_user(tmpflags, &sc->flags); 258 err |= __get_user(tmpflags, &sc->flags);
255 regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); 259 regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);