aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/signal_64.c
diff options
context:
space:
mode:
authorHiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>2008-10-23 20:14:25 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-27 09:14:01 -0400
commit709110bd5624094992579f5311541f2e2b7ce58a (patch)
tree8e3f93ba88f709b6e53f87a106b98b40f7b8f660 /arch/x86/kernel/signal_64.c
parentf8d56f1771e4867acc461146764b4feeb5245669 (diff)
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,
76 /* Always make any pending restarted system calls return -EINTR */ 76 /* Always make any pending restarted system calls return -EINTR */
77 current_thread_info()->restart_block.fn = do_no_restart_syscall; 77 current_thread_info()->restart_block.fn = do_no_restart_syscall;
78 78
79#ifdef CONFIG_X86_32
80 GET_SEG(gs);
81 COPY_SEG(fs);
82 COPY_SEG(es);
83 COPY_SEG(ds);
84#endif /* CONFIG_X86_32 */
85
79 COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx); 86 COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
80 COPY(dx); COPY(cx); COPY(ip); 87 COPY(dx); COPY(cx); COPY(ip);
88
89#ifdef CONFIG_X86_64
81 COPY(r8); 90 COPY(r8);
82 COPY(r9); 91 COPY(r9);
83 COPY(r10); 92 COPY(r10);
@@ -86,11 +95,17 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
86 COPY(r13); 95 COPY(r13);
87 COPY(r14); 96 COPY(r14);
88 COPY(r15); 97 COPY(r15);
98#endif /* CONFIG_X86_64 */
89 99
100#ifdef CONFIG_X86_32
101 COPY_SEG_STRICT(cs);
102 COPY_SEG_STRICT(ss);
103#else /* !CONFIG_X86_32 */
90 /* Kernel saves and restores only the CS segment register on signals, 104 /* Kernel saves and restores only the CS segment register on signals,
91 * which is the bare minimum needed to allow mixed 32/64-bit code. 105 * which is the bare minimum needed to allow mixed 32/64-bit code.
92 * App's signal handler can save/restore other segments if needed. */ 106 * App's signal handler can save/restore other segments if needed. */
93 COPY_SEG_STRICT(cs); 107 COPY_SEG_STRICT(cs);
108#endif /* CONFIG_X86_32 */
94 109
95 err |= __get_user(tmpflags, &sc->flags); 110 err |= __get_user(tmpflags, &sc->flags);
96 regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); 111 regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);