aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@mailshack.com>2008-07-01 19:31:34 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-09 02:17:59 -0400
commita7bbb0ce1d1f956c8491b925c74767adf654f373 (patch)
tree709d561fcc50ae55c79b573826d3143bc4e40f05 /arch
parente423f49fc8ccd761618748d7139638d8ddc1d16f (diff)
x86: traps_xx: modify do_trap
if (cond) block -> if (!cond) goto end_of_block Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Acked-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/traps_64.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index 019a06fcfbdc..1c2d533fe7ff 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -630,38 +630,38 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs,
630{ 630{
631 struct task_struct *tsk = current; 631 struct task_struct *tsk = current;
632 632
633 if (user_mode(regs)) { 633 if (!user_mode(regs))
634 /* 634 goto kernel_trap;
635 * We want error_code and trap_no set for userspace
636 * faults and kernelspace faults which result in
637 * die(), but not kernelspace faults which are fixed
638 * up. die() gives the process no chance to handle
639 * the signal and notice the kernel fault information,
640 * so that won't result in polluting the information
641 * about previously queued, but not yet delivered,
642 * faults. See also do_general_protection below.
643 */
644 tsk->thread.error_code = error_code;
645 tsk->thread.trap_no = trapnr;
646
647 if (show_unhandled_signals && unhandled_signal(tsk, signr) &&
648 printk_ratelimit()) {
649 printk(KERN_INFO
650 "%s[%d] trap %s ip:%lx sp:%lx error:%lx",
651 tsk->comm, tsk->pid, str,
652 regs->ip, regs->sp, error_code);
653 print_vma_addr(" in ", regs->ip);
654 printk("\n");
655 }
656 635
657 if (info) 636 /*
658 force_sig_info(signr, info, tsk); 637 * We want error_code and trap_no set for userspace faults and
659 else 638 * kernelspace faults which result in die(), but not
660 force_sig(signr, tsk); 639 * kernelspace faults which are fixed up. die() gives the
661 return; 640 * process no chance to handle the signal and notice the
641 * kernel fault information, so that won't result in polluting
642 * the information about previously queued, but not yet
643 * delivered, faults. See also do_general_protection below.
644 */
645 tsk->thread.error_code = error_code;
646 tsk->thread.trap_no = trapnr;
647
648 if (show_unhandled_signals && unhandled_signal(tsk, signr) &&
649 printk_ratelimit()) {
650 printk(KERN_INFO
651 "%s[%d] trap %s ip:%lx sp:%lx error:%lx",
652 tsk->comm, tsk->pid, str,
653 regs->ip, regs->sp, error_code);
654 print_vma_addr(" in ", regs->ip);
655 printk("\n");
662 } 656 }
663 657
658 if (info)
659 force_sig_info(signr, info, tsk);
660 else
661 force_sig(signr, tsk);
662 return;
664 663
664kernel_trap:
665 if (!fixup_exception(regs)) { 665 if (!fixup_exception(regs)) {
666 tsk->thread.error_code = error_code; 666 tsk->thread.error_code = error_code;
667 tsk->thread.trap_no = trapnr; 667 tsk->thread.trap_no = trapnr;