aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/signal_64.c
diff options
context:
space:
mode:
authorGravatar Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> 2008-10-23 17:14:25 -0700
committerGravatar Ingo Molnar <mingo@elte.hu> 2008-10-27 14:14:01 +0100
commit709110bd5624094992579f5311541f2e2b7ce58a (patch)
tree8e3f93ba88f709b6e53f87a106b98b40f7b8f660 /arch/x86/kernel/signal_64.c
parentMerge branch 'for-linus' of git://neil.brown.name/md (diff)
downloadlinux-709110bd5624094992579f5311541f2e2b7ce58a.tar.gz
linux-709110bd5624094992579f5311541f2e2b7ce58a.tar.bz2
linux-709110bd5624094992579f5311541f2e2b7ce58a.zip
x86: signal: cosmetic unification of restore_sigcontext()
Impact: cleanup Make restore_sigcontext() the same. Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/signal_64.c')
-rw-r--r--arch/x86/kernel/signal_64.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index a5c9627f4db9..9c469da7f9e8 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -76,8 +76,17 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
/* Always make any pending restarted system calls return -EINTR */
current_thread_info()->restart_block.fn = do_no_restart_syscall;
+#ifdef CONFIG_X86_32
+ GET_SEG(gs);
+ COPY_SEG(fs);
+ COPY_SEG(es);
+ COPY_SEG(ds);
+#endif /* CONFIG_X86_32 */
+
COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
COPY(dx); COPY(cx); COPY(ip);
+
+#ifdef CONFIG_X86_64
COPY(r8);
COPY(r9);
COPY(r10);
@@ -86,11 +95,17 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
COPY(r13);
COPY(r14);
COPY(r15);
+#endif /* CONFIG_X86_64 */
+#ifdef CONFIG_X86_32
+ COPY_SEG_STRICT(cs);
+ COPY_SEG_STRICT(ss);
+#else /* !CONFIG_X86_32 */
/* Kernel saves and restores only the CS segment register on signals,
* which is the bare minimum needed to allow mixed 32/64-bit code.
* App's signal handler can save/restore other segments if needed. */
COPY_SEG_STRICT(cs);
+#endif /* CONFIG_X86_32 */
err |= __get_user(tmpflags, &sc->flags);
regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);