aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/ia32/ia32_signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/ia32/ia32_signal.c')
-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);