diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-01-30 07:32:59 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:59 -0500 |
commit | b3a5acc17c4ad9c28c00ee5e5271de1b1285d22b (patch) | |
tree | 409780f5604ed756327923126b2d1563ed13423b /arch/x86/kernel/traps_64.c | |
parent | 318aa296c329625916c47703eab906d6ebf13930 (diff) |
x86: use fixup_exception() in traps_64.c
Use the fixup_exception() helper instead of the open-coded
search_extable() users.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/traps_64.c')
-rw-r--r-- | arch/x86/kernel/traps_64.c | 47 |
1 files changed, 15 insertions, 32 deletions
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c index 7118fa0320ae..37b07d08704b 100644 --- a/arch/x86/kernel/traps_64.c +++ b/arch/x86/kernel/traps_64.c | |||
@@ -601,19 +601,12 @@ static void __kprobes do_trap(int trapnr, int signr, char *str, | |||
601 | } | 601 | } |
602 | 602 | ||
603 | 603 | ||
604 | /* kernel trap */ | 604 | if (!fixup_exception(regs)) { |
605 | { | 605 | tsk->thread.error_code = error_code; |
606 | const struct exception_table_entry *fixup; | 606 | tsk->thread.trap_no = trapnr; |
607 | fixup = search_exception_tables(regs->ip); | 607 | die(str, regs, error_code); |
608 | if (fixup) | ||
609 | regs->ip = fixup->fixup; | ||
610 | else { | ||
611 | tsk->thread.error_code = error_code; | ||
612 | tsk->thread.trap_no = trapnr; | ||
613 | die(str, regs, error_code); | ||
614 | } | ||
615 | return; | ||
616 | } | 608 | } |
609 | return; | ||
617 | } | 610 | } |
618 | 611 | ||
619 | #define DO_ERROR(trapnr, signr, str, name) \ | 612 | #define DO_ERROR(trapnr, signr, str, name) \ |
@@ -703,22 +696,15 @@ asmlinkage void __kprobes do_general_protection(struct pt_regs * regs, | |||
703 | return; | 696 | return; |
704 | } | 697 | } |
705 | 698 | ||
706 | /* kernel gp */ | 699 | if (fixup_exception(regs)) |
707 | { | 700 | return; |
708 | const struct exception_table_entry *fixup; | ||
709 | fixup = search_exception_tables(regs->ip); | ||
710 | if (fixup) { | ||
711 | regs->ip = fixup->fixup; | ||
712 | return; | ||
713 | } | ||
714 | 701 | ||
715 | tsk->thread.error_code = error_code; | 702 | tsk->thread.error_code = error_code; |
716 | tsk->thread.trap_no = 13; | 703 | tsk->thread.trap_no = 13; |
717 | if (notify_die(DIE_GPF, "general protection fault", regs, | 704 | if (notify_die(DIE_GPF, "general protection fault", regs, |
718 | error_code, 13, SIGSEGV) == NOTIFY_STOP) | 705 | error_code, 13, SIGSEGV) == NOTIFY_STOP) |
719 | return; | 706 | return; |
720 | die("general protection fault", regs, error_code); | 707 | die("general protection fault", regs, error_code); |
721 | } | ||
722 | } | 708 | } |
723 | 709 | ||
724 | static __kprobes void | 710 | static __kprobes void |
@@ -910,12 +896,9 @@ clear_TF_reenable: | |||
910 | 896 | ||
911 | static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr) | 897 | static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr) |
912 | { | 898 | { |
913 | const struct exception_table_entry *fixup; | 899 | if (fixup_exception(regs)) |
914 | fixup = search_exception_tables(regs->ip); | ||
915 | if (fixup) { | ||
916 | regs->ip = fixup->fixup; | ||
917 | return 1; | 900 | return 1; |
918 | } | 901 | |
919 | notify_die(DIE_GPF, str, regs, 0, trapnr, SIGFPE); | 902 | notify_die(DIE_GPF, str, regs, 0, trapnr, SIGFPE); |
920 | /* Illegal floating point operation in the kernel */ | 903 | /* Illegal floating point operation in the kernel */ |
921 | current->thread.trap_no = trapnr; | 904 | current->thread.trap_no = trapnr; |