aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/ia32
diff options
context:
space:
mode:
authorHiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>2008-11-17 18:47:48 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-18 10:55:35 -0500
commit8c6e5ce0fd67c57ad5e19d1718e1250214e855db (patch)
tree87473b9b99276b34e555e57c533b297d7abd4e2a /arch/x86/ia32
parentd71a68dca54756049e0eae62458a1705bf680d09 (diff)
x86: ia32_signal: cleanup macro RELOAD_SEG
Impact: cleanup Remove mask parameter because it's always 3. Cleanup coding styles. Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> Reviewed-by: WANG Cong <wangcong@zeuux.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/ia32')
-rw-r--r--arch/x86/ia32/ia32_signal.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index fe44c314c9c0..2c56e6857d1a 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -207,13 +207,14 @@ struct rt_sigframe
207 regs->seg = tmp | 3; \ 207 regs->seg = tmp | 3; \
208} 208}
209 209
210#define RELOAD_SEG(seg,mask) \ 210#define RELOAD_SEG(seg) { \
211 { unsigned int cur; \ 211 unsigned int cur, pre; \
212 unsigned short pre; \ 212 err |= __get_user(pre, &sc->seg); \
213 err |= __get_user(pre, &sc->seg); \ 213 savesegment(seg, cur); \
214 savesegment(seg, cur); \ 214 pre |= 3; \
215 pre |= mask; \ 215 if (pre != cur) \
216 if (pre != cur) loadsegment(seg, pre); } 216 loadsegment(seg, pre); \
217}
217 218
218static int ia32_restore_sigcontext(struct pt_regs *regs, 219static int ia32_restore_sigcontext(struct pt_regs *regs,
219 struct sigcontext_ia32 __user *sc, 220 struct sigcontext_ia32 __user *sc,
@@ -244,9 +245,9 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
244 if (gs != oldgs) 245 if (gs != oldgs)
245 load_gs_index(gs); 246 load_gs_index(gs);
246 247
247 RELOAD_SEG(fs, 3); 248 RELOAD_SEG(fs);
248 RELOAD_SEG(ds, 3); 249 RELOAD_SEG(ds);
249 RELOAD_SEG(es, 3); 250 RELOAD_SEG(es);
250 251
251 COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx); 252 COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
252 COPY(dx); COPY(cx); COPY(ip); 253 COPY(dx); COPY(cx); COPY(ip);